[ovs-dev] [PATCH V3 09/12] dpif-netdev: Don't use zero flow mark

Eli Britstein elibr at mellanox.com
Mon Jun 29 12:10:06 UTC 2020


On 6/29/2020 2:47 AM, Ilya Maximets wrote:
> On 6/21/20 1:19 PM, Eli Britstein wrote:
>> Zero flow mark is used to indicate the HW to remove the mark. A packet
>> marked with zero mark is received in SW without a mark at all, so it
>> cannot be used as a valid mark. Change the pool range to fix it.
>>
>> Fixes: 241bad15d99a ("dpif-netdev: associate flow with a mark id")
>> Signed-off-by: Eli Britstein <elibr at mellanox.com>
>> Reviewed-by: Roni Bar Yanai <roniba at mellanox.com>
>> ---
>>   lib/dpif-netdev.c    |  4 ++--
>>   tests/dpif-netdev.at | 18 +++++++++---------
>>   2 files changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index 87068803e..57565802a 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -2150,7 +2150,7 @@ dp_netdev_pmd_find_dpcls(struct dp_netdev_pmd_thread *pmd,
>>   }
>>   
>>   #define MAX_FLOW_MARK       (UINT32_MAX - 1)
>> -#define INVALID_FLOW_MARK   (UINT32_MAX)
>> +#define INVALID_FLOW_MARK   0
>>   
>>   struct megaflow_to_mark_data {
>>       const struct cmap_node node;
>> @@ -2176,7 +2176,7 @@ flow_mark_alloc(void)
>>   
>>       if (!flow_mark.pool) {
>>           /* Haven't initiated yet, do it here */
> It might be good to add information to the comment why zero is not used here.
I thought in the commit message is enough. I'll add a comment here too.
>
>> -        flow_mark.pool = id_pool_create(0, MAX_FLOW_MARK);
>> +        flow_mark.pool = id_pool_create(1, MAX_FLOW_MARK);
>>       }
>>   
>>       if (id_pool_alloc_id(flow_mark.pool, &mark)) {
>>


More information about the dev mailing list