On 5/2/2024 12:53 AM, Stephen Hemminger wrote:
> On Wed, 1 May 2024 12:13:45 +0100
> Ferruh Yigit <ferruh.yi...@amd.com> wrote:
> 
>>> diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
>>> index fa50fe45d7..a78fd50cd4 100644
>>> --- a/drivers/net/tap/tap_flow.c
>>> +++ b/drivers/net/tap/tap_flow.c
>>> @@ -1595,8 +1595,9 @@ tap_flow_isolate(struct rte_eth_dev *dev,
>>>      * If netdevice is there, setup appropriate flow rules immediately.
>>>      * Otherwise it will be set when bringing up the netdevice (tun_alloc).
>>>      */
>>> -   if (!process_private->rxq_fds[0])
>>> +   if (process_private->fds[0] == -1)
>>>  
>>
>> change in the condition looks reasonable but not directly related with
>> the change, does it require its own patch?
> 
> In this case, the array of fds is moving from the rxq to being global.
> The old code worked because rxq_fds[] was initialized to zero.
> With shared fd's the fds are now initialized to -1.
> 
> Using zero as sentinel fd is bad practice, because it is a valid fd;
> but POSIX says it always is stdin.
>

I agree on the fix, only I don't think it belongs to this patch.

As far as I can see 'rxq_fds' was already initialized to '-1' and
original code was already wrong.

This patch merges 'rxq_fds' & 'txq_fds' to 'fds', but this patch doesn't
do anything that requires updating the above condition, or if I missing
it please show me.

I think better to fix condition first in a separate patch.

Reply via email to