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

Kevin Traynor ktraynor at redhat.com
Tue Jun 19 11:46:45 UTC 2018


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.

> 
>> 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