From: Jakub Kicinski <kuba@kernel.org>
To: Mengyuan Lou <mengyuanlou@net-swift.com>
Cc: netdev@vger.kernel.org, jiawenwu@trustnetic.com,
duanqiangwen@net-swift.com, linglingzhang@net-swift.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, jacob.e.keller@intel.com,
richardcochran@gmail.com
Subject: Re: [PATCH net v6] net: Wangxun: protect ring accesses with RCU
Date: Mon, 21 Sep 2026 17:05:09 -0700 [thread overview]
Message-ID: <20260921170509.3f471b54@kernel.org> (raw)
In-Reply-To: <20260915065731.6007-1-mengyuanlou@net-swift.com>
On Tue, 15 Sep 2026 14:57:31 +0800 Mengyuan Lou wrote:
> - wx->tx_ring[i]->count = new_tx_count;
> + rcu_dereference_protected(wx->tx_ring[i],
> + lockdep_is_held(&wx->reset_lock))->count =
> + new_tx_count;
Do you really think this is acceptable code formatting?
Plus I quite clearly asked you to add a helper:
https://lore.kernel.org/all/20260915184127.25de623e@kernel.org/
> @@ -1797,7 +1801,8 @@ static void wx_set_rx_buffer_len(struct wx *wx)
> * the Base and Length of the Rx Descriptor Ring
> */
> for (i = 0; i < wx->num_rx_queues; i++) {
> - rx_ring = wx->rx_ring[i];
> + rx_ring = rcu_dereference_protected(wx->rx_ring[i],
> + lockdep_rtnl_is_held());
And also to use:
/**
* rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
* @p: The pointer to read, prior to dereferencing
*
* Return: the value of the specified RCU-protected pointer, but omit
* the READ_ONCE(), because caller holds RTNL.
*/
#define rtnl_dereference(p) \
rcu_dereference_protected(p, lockdep_rtnl_is_held())
Please, this is not rocket science. Pay more attention to what you're doing,
this sort of change should not require 10 revisions.
--
pw-bot: cr
next prev parent reply other threads:[~2026-09-22 0:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 6:57 [PATCH net v6] net: Wangxun: protect ring accesses with RCU Mengyuan Lou
2026-09-19 7:16 ` netdev-bot+sashiko
2026-09-22 0:05 ` Jakub Kicinski [this message]
2026-09-22 8:48 ` mengyuanlou
2026-09-23 0:19 ` Jakub Kicinski
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=20260921170509.3f471b54@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=duanqiangwen@net-swift.com \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=jiawenwu@trustnetic.com \
--cc=linglingzhang@net-swift.com \
--cc=mengyuanlou@net-swift.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.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