diff mbox series

[net] net: fec: remove useless fec_enet_reset_skb()

Message ID 20230518130016.1615671-1-wei.fang@nxp.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: fec: remove useless fec_enet_reset_skb() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers fail 1 blamed authors not CCed: B38611@freescale.com; 1 maintainers not CCed: B38611@freescale.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 33 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Wei Fang May 18, 2023, 1 p.m. UTC
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.

Fixes: 59d0f7465644 ("net: fec: init multi queue date structure")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 21 ---------------------
 1 file changed, 21 deletions(-)

Comments

Simon Horman May 18, 2023, 5:17 p.m. UTC | #1
On Thu, May 18, 2023 at 09:00:16PM +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.
> 
> Fixes: 59d0f7465644 ("net: fec: init multi queue date structure")
> Signed-off-by: Wei Fang <wei.fang@nxp.com>

Hi Wei Fang,

this change looks fine to me.
But it feels much more like a cleanup than a fix to me:
what user-visible problem is it fixing?

If so, I suggest targeting against net-next without the fixes tag.
Wei Fang May 19, 2023, 1:26 a.m. UTC | #2
> -----Original Message-----
> From: Simon Horman <simon.horman@corigine.com>
> Sent: 2023年5月19日 1:18
> To: Wei Fang <wei.fang@nxp.com>
> Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; Frank.Li@freescale.com; Shenwei Wang
> <shenwei.wang@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>;
> netdev@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net] net: fec: remove useless fec_enet_reset_skb()
> 
> On Thu, May 18, 2023 at 09:00:16PM +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.
> >
> > Fixes: 59d0f7465644 ("net: fec: init multi queue date structure")
> > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> 
> Hi Wei Fang,
> 
> this change looks fine to me.
> But it feels much more like a cleanup than a fix to me:
> what user-visible problem is it fixing?
> 
There is no user-visible problem, just a cleanup.

> If so, I suggest targeting against net-next without the fixes tag.
Okay, I'll change the tree tag. Thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 577d94821b3e..70ef969e6588 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 */