[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLikQtZ6c50q44Un-jQM4G2mvMf31Qp0+fRFUbNF9p9NJ_A@mail.gmail.com>
Date: Mon, 12 May 2025 15:08:34 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Stanislav Fomichev <stfomichev@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, andrew+netdev@...n.ch,
pavan.chebbi@...adcom.com, andrew.gospodarek@...adcom.com, sdf@...ichev.me,
Kalesh AP <kalesh-anakkur.purayil@...adcom.com>
Subject: Re: [PATCH net] bnxt_en: bring back rtnl_lock() in bnxt_fw_reset_task()
On Mon, May 12, 2025 at 7:20 AM Stanislav Fomichev <stfomichev@...il.com> wrote:
> Will the following work instead? netdev_ops_assert_locked should take
> care of asserting either ops lock or rtnl lock depending on the device
> properties.
It works for netif_set_real_num_tx_queues() but I also need to replace
the ASSERT_RTNL() with netdev_ops_assert_locked(dev) in
__udp_tunnel_nic_reset_ntf().
With the additional change, it works well with repeated NIC resets.
Thanks for the suggestion.
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index c9013632296f..d8d29729c685 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3177,7 +3177,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,
> @@ -3227,7 +3226,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,
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4196 bytes)
Powered by blists - more mailing lists