summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2017-10-26 08:19:00 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-12-12 07:32:42 (GMT)
commit01217dc1c9ff0666c26b99955d324adf227730fc (patch)
tree8b2acce2a4305fd6f135ce6107d9169c9d0e1241
parent6372197ee1e986e9cc3f80e25b4f05169d2c3eb9 (diff)
downloadlinux-01217dc1c9ff0666c26b99955d324adf227730fc.tar.xz
staging: fsl-dpaa2/eth: Use napi_consume_skb()
While in NAPI context, free skbs by calling napi_consume_skb() instead of dev_kfree_skb(), to take advantage of the bulk freeing mechanism. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
-rw-r--r--drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 47bf801..1e9eac9 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -623,7 +623,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,
*/
static void free_tx_fd(const struct dpaa2_eth_priv *priv,
const struct dpaa2_fd *fd,
- u32 *status)
+ u32 *status, bool in_napi)
{
struct device *dev = priv->net_dev->dev.parent;
dma_addr_t fd_addr;
@@ -702,7 +702,7 @@ static void free_tx_fd(const struct dpaa2_eth_priv *priv,
kfree(skbh);
/* Move on with skb release */
- dev_kfree_skb(skb);
+ napi_consume_skb(skb, in_napi);
}
static int dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)
@@ -786,7 +786,7 @@ static int dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)
if (unlikely(err < 0)) {
percpu_stats->tx_errors++;
/* Clean up everything, including freeing the skb */
- free_tx_fd(priv, &fd, NULL);
+ free_tx_fd(priv, &fd, NULL, false);
} else {
percpu_stats->tx_packets++;
percpu_stats->tx_bytes += dpaa2_fd_get_len(&fd);
@@ -839,7 +839,7 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv,
fd->simple.ctrl & DPAA2_FD_TX_ERR_MASK);
}
- free_tx_fd(priv, fd, check_fas_errors ? &status : NULL);
+ free_tx_fd(priv, fd, check_fas_errors ? &status : NULL, true);
/* if there are no errors, we're done */
if (likely(!errors))