[ovs-dev] [PATCH 1/2] netdev-dummy: Allow configuring the numa_id for testing purposes.

Daniele Di Proietto diproiettod at vmware.com
Fri Jun 24 21:17:34 UTC 2016






On 23/06/2016 14:53, "Ben Pfaff" <blp at ovn.org> wrote:

>On Tue, Jun 07, 2016 at 02:08:44PM -0700, Daniele Di Proietto wrote:
>> This commit introduces an (undocumented) option for dummy Interfaces to
>> specify a dummy numa_id, to which the device belongs.  It will be used
>> to test the pmd threads in dpif-netdev.
>> 
>> Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>
>
>Acked-by: Ben Pfaff <blp at ovn.org>

Thanks for the review

>
>>  {
>> -    return 0;
>> +    struct netdev_dummy *netdev = netdev_dummy_cast(netdev_);
>> +    int numa_id;
>> +
>> +    ovs_mutex_lock(&netdev->mutex);
>> +    numa_id = netdev->numa_id;
>> +    ovs_mutex_unlock(&netdev->mutex);
>> +
>> +    return numa_id;
>>  }
>
>This is a place where a mid-block declaration seems like a winner:
>
>{
>    struct netdev_dummy *netdev = netdev_dummy_cast(netdev_);
>
>    ovs_mutex_lock(&netdev->mutex);
>    int numa_id = netdev->numa_id;
>    ovs_mutex_unlock(&netdev->mutex);
>
>    return numa_id;
>}

Good idea, changed, thanks!


More information about the dev mailing list