[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdfe62f4-8b70-4284-b06d-e50ea6ae2d88@nvidia.com>
Date: Thu, 12 Jun 2025 10:31:45 +0300
From: Mark Bloch <mbloch@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>, Andrew Lunn <andrew+netdev@...n.ch>,
Simon Horman <horms@...nel.org>, saeedm@...dia.com, gal@...dia.com,
leonro@...dia.com, tariqt@...dia.com, Leon Romanovsky <leon@...nel.org>,
netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 7/9] net/mlx5e: Properly access RCU protected
qdisc_sleeping variable
On 12/06/2025 0:40, Jakub Kicinski wrote:
> On Tue, 10 Jun 2025 18:15:12 +0300 Mark Bloch wrote:
>> qdisc_sleeping variable is declared as "struct Qdisc __rcu" and
>> as such needs proper annotation while accessing it.
>>
>> Without rtnl_dereference(), the following error is generated by smatch:
>
> sparse ?
Right, just tested it myself, it's indeed with sparse.
>
>>
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: warning:
>> incorrect type in initializer (different address spaces)
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: expected
>> struct Qdisc *qdisc
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:377:40: got struct
>> Qdisc [noderef] __rcu *qdisc_sleeping
>>
>> Fixes: 214baf22870c ("net/mlx5e: Support HTB offload")
>
> I don't think this is a functional change? We don't treat silencing
> compiler warnings as fixes, not for sparse or W=1 warnings.
Well Eric's commit: d636fc5dd692c8f4e00ae6e0359c0eceeb5d9bdb
that added this annotation was because of a syzbot report.
Anyway, we don't mind pushing via net-next.
Mark
>
>> Signed-off-by: Leon Romanovsky <leonro@...dia.com>
>> Reviewed-by: Tariq Toukan <tariqt@...dia.com>
>> Signed-off-by: Mark Bloch <mbloch@...dia.com>
>> ---
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
>> index f0744a45db92..2f32111210f8 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
>> @@ -374,7 +374,9 @@ void mlx5e_reactivate_qos_sq(struct mlx5e_priv *priv, u16 qid, struct netdev_que
>> void mlx5e_reset_qdisc(struct net_device *dev, u16 qid)
>> {
>> struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, qid);
>> - struct Qdisc *qdisc = dev_queue->qdisc_sleeping;
>> + struct Qdisc *qdisc;
>> +
>> + qdisc = rtnl_dereference(dev_queue->qdisc_sleeping);
>>
>> if (!qdisc)
>
> nit: no new line between action and error check
Powered by blists - more mailing lists