Re: [PATCH net v2 6/8] veth: take into account device reconfiguration for xdp_features flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,

On 13/03/2023 16:53, Eric Dumazet wrote:
> On Mon, Mar 13, 2023 at 8:50 AM Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
>>
>> On Mon, Mar 13, 2023 at 7:15 AM Matthieu Baerts
>> <matthieu.baerts@xxxxxxxxxxxx> wrote:
>>>
>>> Hi Lorenzo,
>>>
>>> On 09/03/2023 13:25, Lorenzo Bianconi wrote:
>>>> Take into account tx/rx queues reconfiguration setting device
>>>> xdp_features flag. Moreover consider NETIF_F_GRO flag in order to enable
>>>> ndo_xdp_xmit callback.
>>>>
>>>> Fixes: 66c0e13ad236 ("drivers: net: turn on XDP features")
>>>> Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
>>>
>>> Thank you for the modification.
>>>
>>> Unfortunately, 'git bisect' just told me this modification is the origin
>>> of a new WARN when using veth in a netns:
>>>
>>>
>>> ###################### 8< ######################
>>>
>>> =============================
>>> WARNING: suspicious RCU usage
>>> 6.3.0-rc1-00144-g064d70527aaa #149 Not tainted
>>> -----------------------------
>>> drivers/net/veth.c:1265 suspicious rcu_dereference_check() usage!
>>>
>>> other info that might help us debug this:
>>>
>>
>> Same observation here, I am releasing a syzbot report with a repro.
>>
>>
> 
> I guess a fix would be:
> 
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 293dc3b2c84a6c1931e8df42cdcd5f2798004f3c..4da74ac27f9a2425d8d3f4ffcc93f453bd58e3a5
> 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -1262,7 +1262,7 @@ static void veth_set_xdp_features(struct net_device *dev)
>         struct veth_priv *priv = netdev_priv(dev);
>         struct net_device *peer;
> 
> -       peer = rcu_dereference(priv->peer);
> +       peer = rtnl_dereference(priv->peer);
>         if (peer && peer->real_num_tx_queues <= dev->real_num_rx_queues) {
>                 xdp_features_t val = NETDEV_XDP_ACT_BASIC |
>                                      NETDEV_XDP_ACT_REDIRECT |
> 

Thank you for having looked!

This patch avoids the warning on our side.

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux