[PATCH net v1] octeon_ep_vf: Resolve netdevice usage count issue

Sathesh B Edara posted 1 patch 1 month ago
There is a newer version of this series
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH net v1] octeon_ep_vf: Resolve netdevice usage count issue
Posted by Sathesh B Edara 1 month ago
Address the netdevice usage count problem in the following scenarios:
- When the interface is down
- During transmit queue timeouts
Additionally, ensure all queues are stopped when the interface is down.

Signed-off-by: Sathesh B Edara <sedara@marvell.com>
---
 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
index 18c922dd5fc6..f16b5930d414 100644
--- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
@@ -526,6 +526,7 @@ static int octep_vf_stop(struct net_device *netdev)
 	netdev_info(netdev, "Stopping the device ...\n");
 
 	/* Stop Tx from stack */
+	netif_tx_stop_all_queues(netdev);
 	netif_carrier_off(netdev);
 	netif_tx_disable(netdev);
 
@@ -819,7 +820,6 @@ static void octep_vf_tx_timeout_task(struct work_struct *work)
 		octep_vf_open(netdev);
 	}
 	rtnl_unlock();
-	netdev_put(netdev, NULL);
 }
 
 /**
@@ -834,7 +834,6 @@ static void octep_vf_tx_timeout(struct net_device *netdev, unsigned int txqueue)
 {
 	struct octep_vf_device *oct = netdev_priv(netdev);
 
-	netdev_hold(netdev, NULL, GFP_ATOMIC);
 	schedule_work(&oct->tx_timeout_task);
 }
 
-- 
2.36.0
Re: [PATCH net v1] octeon_ep_vf: Resolve netdevice usage count issue
Posted by Kalesh Anakkur Purayil 1 month ago
On Wed, Apr 9, 2025 at 9:04 PM Sathesh B Edara <sedara@marvell.com> wrote:
>
> Address the netdevice usage count problem in the following scenarios:
> - When the interface is down
> - During transmit queue timeouts
> Additionally, ensure all queues are stopped when the interface is down.

Looks like 2 different fixes and better split it as two separate patches.

Also, please add Fixes tag for bug fix patches.
>
> Signed-off-by: Sathesh B Edara <sedara@marvell.com>
> ---
>  drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
> index 18c922dd5fc6..f16b5930d414 100644
> --- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
> +++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
> @@ -526,6 +526,7 @@ static int octep_vf_stop(struct net_device *netdev)
>         netdev_info(netdev, "Stopping the device ...\n");
>
>         /* Stop Tx from stack */
> +       netif_tx_stop_all_queues(netdev);
>         netif_carrier_off(netdev);
>         netif_tx_disable(netdev);

netif_tx_disable() will internally invoke netif_tx_stop_queue() for
all the Tx queues.
>
> @@ -819,7 +820,6 @@ static void octep_vf_tx_timeout_task(struct work_struct *work)
>                 octep_vf_open(netdev);
>         }
>         rtnl_unlock();
> -       netdev_put(netdev, NULL);
>  }
>
>  /**
> @@ -834,7 +834,6 @@ static void octep_vf_tx_timeout(struct net_device *netdev, unsigned int txqueue)
>  {
>         struct octep_vf_device *oct = netdev_priv(netdev);
>
> -       netdev_hold(netdev, NULL, GFP_ATOMIC);
>         schedule_work(&oct->tx_timeout_task);
>  }
>
> --
> 2.36.0
>
>


-- 
Regards,
Kalesh AP