RE: [Intel-wired-lan] [PATCH net-next v3 2/4] net: remove redundant ASSERT_RTNL() in queue setup functions
From: Loktionov, Aleksandr
Date: Wed Jun 11 2025 - 03:24:31 EST
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Stanislav Fomichev
> Sent: Tuesday, June 10, 2025 7:15 PM
> To: netdev@xxxxxxxxxxxxxxx
> Cc: davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx;
> pabeni@xxxxxxxxxx; skalluru@xxxxxxxxxxx; manishc@xxxxxxxxxxx;
> andrew+netdev@xxxxxxx; michael.chan@xxxxxxxxxxxx;
> pavan.chebbi@xxxxxxxxxxxx; ajit.khaparde@xxxxxxxxxxxx;
> sriharsha.basavapatna@xxxxxxxxxxxx; somnath.kotur@xxxxxxxxxxxx;
> Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; tariqt@xxxxxxxxxx; saeedm@xxxxxxxxxx;
> louis.peens@xxxxxxxxxxxx; shshaikh@xxxxxxxxxxx; GR-Linux-NIC-
> Dev@xxxxxxxxxxx; ecree.xilinx@xxxxxxxxx; horms@xxxxxxxxxx;
> dsahern@xxxxxxxxxx; shuah@xxxxxxxxxx; ruanjinjie@xxxxxxxxxx;
> mheib@xxxxxxxxxx; stfomichev@xxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> intel-wired-lan@xxxxxxxxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx; oss-
> drivers@xxxxxxxxxxxx; linux-net-drivers@xxxxxxx; linux-
> kselftest@xxxxxxxxxxxxxxx; leon@xxxxxxxxxx
> Subject: [Intel-wired-lan] [PATCH net-next v3 2/4] net: remove
> redundant ASSERT_RTNL() in queue setup functions
>
> The existing netdev_ops_assert_locked() already asserts that either
> the RTNL lock or the per-device lock is held, making the explicit
> ASSERT_RTNL() redundant.
>
> Cc: Michael Chan <michael.chan@xxxxxxxxxxxx>
> Signed-off-by: Stanislav Fomichev <stfomichev@xxxxxxxxx>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>
> ---
> net/core/dev.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c index
> be97c440ecd5..72997636b8ec 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3179,7 +3179,6 @@ int netif_set_real_num_tx_queues(struct
> net_device *dev, unsigned int txq)
>
> if (dev->reg_state == NETREG_REGISTERED ||
> dev->reg_state == NETREG_UNREGISTERING) {
> - ASSERT_RTNL();
> netdev_ops_assert_locked(dev);
>
> rc = netdev_queue_update_kobjects(dev, dev-
> >real_num_tx_queues, @@ -3229,7 +3228,6 @@ int
> netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
> return -EINVAL;
>
> if (dev->reg_state == NETREG_REGISTERED) {
> - ASSERT_RTNL();
> netdev_ops_assert_locked(dev);
>
> rc = net_rx_queue_update_kobjects(dev, dev-
> >real_num_rx_queues,
> --
> 2.49.0