netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 net-next] net: fec: remove useless fec_enet_reset_skb()
@ 2023-05-19  2:01 wei.fang
  2023-05-19  7:35 ` Simon Horman
  2023-05-22 10:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: wei.fang @ 2023-05-19  2:01 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, Frank.Li, shenwei.wang,
	xiaoning.wang, simon.horman, netdev
  Cc: linux-imx, linux-kernel

From: Wei Fang <wei.fang@nxp.com>

This patch is a cleanup for fec driver. The fec_enet_reset_skb()
is used to free skb buffers for tx queues and is only invoked in
fec_restart(). However, fec_enet_bd_init() also resets skb buffers
and is invoked in fec_restart() too. So fec_enet_reset_skb() is
redundant and useless.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
V2 change:
According to Simon Horman's suggestion, it's just a cleanup and without
user-visible problem, so change the target tree from net to net-next.
---
 drivers/net/ethernet/freescale/fec_main.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 10cb5ad2d758..e1975a3c7234 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1011,24 +1011,6 @@ static void fec_enet_enable_ring(struct net_device *ndev)
 	}
 }
 
-static void fec_enet_reset_skb(struct net_device *ndev)
-{
-	struct fec_enet_private *fep = netdev_priv(ndev);
-	struct fec_enet_priv_tx_q *txq;
-	int i, j;
-
-	for (i = 0; i < fep->num_tx_queues; i++) {
-		txq = fep->tx_queue[i];
-
-		for (j = 0; j < txq->bd.ring_size; j++) {
-			if (txq->tx_skbuff[j]) {
-				dev_kfree_skb_any(txq->tx_skbuff[j]);
-				txq->tx_skbuff[j] = NULL;
-			}
-		}
-	}
-}
-
 /*
  * This function is called to start or restart the FEC during a link
  * change, transmit timeout, or to reconfigure the FEC.  The network
@@ -1071,9 +1053,6 @@ fec_restart(struct net_device *ndev)
 
 	fec_enet_enable_ring(ndev);
 
-	/* Reset tx SKB buffers. */
-	fec_enet_reset_skb(ndev);
-
 	/* Enable MII mode */
 	if (fep->full_duplex == DUPLEX_FULL) {
 		/* FD enable */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2 net-next] net: fec: remove useless fec_enet_reset_skb()
  2023-05-19  2:01 [PATCH V2 net-next] net: fec: remove useless fec_enet_reset_skb() wei.fang
@ 2023-05-19  7:35 ` Simon Horman
  2023-05-22 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-05-19  7:35 UTC (permalink / raw)
  To: wei.fang
  Cc: davem, edumazet, kuba, pabeni, Frank.Li, shenwei.wang,
	xiaoning.wang, netdev, linux-imx, linux-kernel

On Fri, May 19, 2023 at 10:01:13AM +0800, wei.fang@nxp.com wrote:
> From: Wei Fang <wei.fang@nxp.com>
> 
> This patch is a cleanup for fec driver. The fec_enet_reset_skb()
> is used to free skb buffers for tx queues and is only invoked in
> fec_restart(). However, fec_enet_bd_init() also resets skb buffers
> and is invoked in fec_restart() too. So fec_enet_reset_skb() is
> redundant and useless.
> 
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> V2 change:
> According to Simon Horman's suggestion, it's just a cleanup and without
> user-visible problem, so change the target tree from net to net-next.

Thanks Wei Fang, looks good.

Reviewed-by: Simon Horman <simon.horman@corigine.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2 net-next] net: fec: remove useless fec_enet_reset_skb()
  2023-05-19  2:01 [PATCH V2 net-next] net: fec: remove useless fec_enet_reset_skb() wei.fang
  2023-05-19  7:35 ` Simon Horman
@ 2023-05-22 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-22 10:20 UTC (permalink / raw)
  To: Wei Fang
  Cc: davem, edumazet, kuba, pabeni, Frank.Li, shenwei.wang,
	xiaoning.wang, simon.horman, netdev, linux-imx, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 19 May 2023 10:01:13 +0800 you wrote:
> From: Wei Fang <wei.fang@nxp.com>
> 
> This patch is a cleanup for fec driver. The fec_enet_reset_skb()
> is used to free skb buffers for tx queues and is only invoked in
> fec_restart(). However, fec_enet_bd_init() also resets skb buffers
> and is invoked in fec_restart() too. So fec_enet_reset_skb() is
> redundant and useless.
> 
> [...]

Here is the summary with links:
  - [V2,net-next] net: fec: remove useless fec_enet_reset_skb()
    https://git.kernel.org/netdev/net-next/c/2ae9c66b0455

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-22 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-19  2:01 [PATCH V2 net-next] net: fec: remove useless fec_enet_reset_skb() wei.fang
2023-05-19  7:35 ` Simon Horman
2023-05-22 10:20 ` patchwork-bot+netdevbpf

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).