[ovs-dev] [RFC PATCH v2 1/1] dpdk: Support both shared and per port mempools.

Ian Stokes ian.stokes at intel.com
Wed Jun 20 12:36:33 UTC 2018


On 6/19/2018 12:46 PM, Kevin Traynor wrote:
> On 06/19/2018 12:16 PM, Kevin Traynor wrote:
>> On 06/19/2018 12:11 PM, Kevin Traynor wrote:
>>>> +            if (per_port_mp && rte_errno == EEXIST) {
>>>> +                LIST_FOR_EACH (next, list_node, &dpdk_mp_list) {
>>>> +                    if (dmp->mp == next->mp) {
>>>> +                        rte_free(dmp);
>>>> +                        dmp = next;
>>>> +                        dmp->refcount = 1;
>>>> +                    }
>>>> +                }
>>>> +            }
>>>> +            else {
>>>> +                ovs_list_push_back(&dpdk_mp_list, &dmp->list_node);
>>>> +            }
>>> I think you need to increment refcount and use the safe list option. How
>>> about
>>>
>>
>> Actually no, you don't need the safe list option, as it's the dmp that
>> is being freed
> 
> I obviously misread this (or wasn't concentrating enough), you do still
> need the dmp = next as well.
> 

Sure, I've responded in the original thread that I'll take this 
approach. I'm not against using the second safe list but wanted to keep 
it to 1 list if possible.

Ian
>>
>>> if (rte_errno == EEXIST) {
>>>      LIST_FOR_EACH_SAFE (next, list_node, &dpdk_mp_list) {
>>>          if (dmp->mp == next->mp) {
>>>              next->refcount++;
>>>              rte_free(dmp);
>>>              break;
>>>          }
>>>      }
>>> } else {
>>>      dmp->refcount++;
>>>      ovs_list_push_back(&dpdk_mp_list, &dmp->list_node);
>>> }
>>>
>>
> 



More information about the dev mailing list