On 6/25/21 11:42 AM, Kevin Traynor wrote:
> On 22/06/2021 19:53, David Wilder wrote:
>> This change removes the assumption that numa nodes and cores are numbered
>> contiguously in linux.  This change is required to support some Power
>> systems.
>>
>> A check has been added to verify that cores are online,
>> offline cores result in non-contiguously numbered cores.
>>
>> Dpdk EAL option generation is updated to work with non-contiguous numa nodes.
>> These options can be seen in the ovs-vswitchd.log.  For example:
>> a system containing only numa nodes 0 and 8 will generate the following:
>>
>> EAL ARGS: ovs-vswitchd --socket-mem 1024,0,0,0,0,0,0,0,1024 \
>>                          --socket-limit 1024,0,0,0,0,0,0,0,1024 -l 0
>>
>> Tests for pmd and dpif-netdev have been updated to validate non-contiguous
>> numbered nodes.
>>
>> Signed-off-by: David Wilder <[email protected]>
>> ---
>>  lib/dpdk.c           | 57 +++++++++++++++++++++++++++++++++++------
>>  lib/ovs-numa.c       | 51 ++++++++++++++++++++++++------------
>>  lib/ovs-numa.h       |  2 ++
>>  tests/dpif-netdev.at |  2 +-
>>  tests/pmd.at         | 61 ++++++++++++++++++++++++++++++++++++++++----
>>  5 files changed, 142 insertions(+), 31 deletions(-)
>>
>> diff --git a/lib/dpdk.c b/lib/dpdk.c
>> index 2eaaa569c..238d0fffb 100644
>> --- a/lib/dpdk.c
>> +++ b/lib/dpdk.c
>> @@ -130,22 +130,63 @@ construct_dpdk_options(const struct smap 
>> *ovs_other_config, struct svec *args)
>>      }
>>  }
>>  
>> +static int
>> +compare_numa_node_list(const void *a_, const void *b_)
>> +{
>> +    int a = *(const int *) a_;
>> +    int b = *(const int *) b_;
>> +
>> +    if (a < b) {
>> +        return -1;
>> +    }
>> +    if (a > b) {
>> +        return 1;
>> +    }
>> +    return 0;
>> +}
>> +
>>  static char *
>>  construct_dpdk_socket_mem(void)
>>  {
>>      const char *def_value = "1024";
>> -    int numa, numa_nodes = ovs_numa_get_n_numas();
>> +    struct ovs_numa_dump *dump;
>> +    const struct ovs_numa_info_numa *node;
>> +    int k = 0, last_node = 0, n_numa_nodes, *numa_node_list;
> 
> I probably would have kept k and n_numa_nodes as size_t as they are used
> for handling around the hmap_count() return, but realistically it's not
> going to make any difference. i'm not sure it's worth another re-spin
> unless you have to do it anyway for other comments.
> 
> Acked-by: Kevin Traynor <[email protected]>

Thanks!  Applied.

I re-factored this part a bit and changed the type of n_numa_nodes to size_t
as it derived from the hmap_count().  The k doesn't seem very important as
it mostly an iterator, so I kept it as is.  I also added a NEWS entry.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to