From: Mark Bloch <mbloch@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Simon Horman <horms@kernel.org>,
saeedm@nvidia.com, gal@nvidia.com, leonro@nvidia.com,
tariqt@nvidia.com, Leon Romanovsky <leon@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 7/9] net/mlx5e: Properly access RCU protected qdisc_sleeping variable
Date: Thu, 12 Jun 2025 10:31:45 +0300 [thread overview]
Message-ID: <bdfe62f4-8b70-4284-b06d-e50ea6ae2d88@nvidia.com> (raw)
In-Reply-To: <20250611144013.300c79ea@kernel.org>
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@nvidia.com>
>> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
>> Signed-off-by: Mark Bloch <mbloch@nvidia.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
next prev parent reply other threads:[~2025-06-12 7:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 15:15 [PATCH net 0/9] mlx5 misc fixes 2025-06-10 Mark Bloch
2025-06-10 15:15 ` [PATCH net 1/9] net/mlx5: Ensure fw pages are always allocated on same NUMA Mark Bloch
2025-06-13 16:22 ` Zhu Yanjun
2025-06-15 5:55 ` Moshe Shemesh
2025-06-15 14:44 ` Zhu Yanjun
2025-06-19 16:31 ` Moshe Shemesh
2025-06-10 15:15 ` [PATCH net 2/9] net/mlx5: Fix ECVF vports unload on shutdown flow Mark Bloch
2025-06-10 15:15 ` [PATCH net 3/9] net/mlx5: Fix return value when searching for existing flow group Mark Bloch
2025-06-10 15:15 ` [PATCH net 4/9] net/mlx5: HWS, Init mutex on the correct path Mark Bloch
2025-06-10 15:15 ` [PATCH net 5/9] net/mlx5: HWS, fix missing ip_version handling in definer Mark Bloch
2025-06-10 15:15 ` [PATCH net 6/9] net/mlx5: HWS, make sure the uplink is the last destination Mark Bloch
2025-06-10 15:15 ` [PATCH net 7/9] net/mlx5e: Properly access RCU protected qdisc_sleeping variable Mark Bloch
2025-06-11 21:40 ` Jakub Kicinski
2025-06-12 7:31 ` Mark Bloch [this message]
2025-06-12 14:22 ` Jakub Kicinski
2025-06-12 14:47 ` Mark Bloch
2025-06-10 15:15 ` [PATCH net 8/9] net/mlx5e: Fix leak of Geneve TLV option object Mark Bloch
2025-06-10 15:15 ` [PATCH net 9/9] net/mlx5e: Fix number of lanes to UNKNOWN when using data_rate_oper Mark Bloch
2025-06-11 21:43 ` [PATCH net 0/9] mlx5 misc fixes 2025-06-10 Jakub Kicinski
2025-06-11 21:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bdfe62f4-8b70-4284-b06d-e50ea6ae2d88@nvidia.com \
--to=mbloch@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=leonro@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).