Commit d387b8a1 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: make use of napi_consume_skb()

Use napi_consume_skb() in nfp_net_tx_complete() to get bulk free.
Pass 0 as budget for ctrl queue completion since it runs out of
a tasklet.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 670b5274
...@@ -946,10 +946,11 @@ static int nfp_net_tx(struct sk_buff *skb, struct net_device *netdev) ...@@ -946,10 +946,11 @@ static int nfp_net_tx(struct sk_buff *skb, struct net_device *netdev)
/** /**
* nfp_net_tx_complete() - Handled completed TX packets * nfp_net_tx_complete() - Handled completed TX packets
* @tx_ring: TX ring structure * @tx_ring: TX ring structure
* @budget: NAPI budget (only used as bool to determine if in NAPI context)
* *
* Return: Number of completed TX descriptors * Return: Number of completed TX descriptors
*/ */
static void nfp_net_tx_complete(struct nfp_net_tx_ring *tx_ring) static void nfp_net_tx_complete(struct nfp_net_tx_ring *tx_ring, int budget)
{ {
struct nfp_net_r_vector *r_vec = tx_ring->r_vec; struct nfp_net_r_vector *r_vec = tx_ring->r_vec;
struct nfp_net_dp *dp = &r_vec->nfp_net->dp; struct nfp_net_dp *dp = &r_vec->nfp_net->dp;
...@@ -999,7 +1000,7 @@ static void nfp_net_tx_complete(struct nfp_net_tx_ring *tx_ring) ...@@ -999,7 +1000,7 @@ static void nfp_net_tx_complete(struct nfp_net_tx_ring *tx_ring)
/* check for last gather fragment */ /* check for last gather fragment */
if (fidx == nr_frags - 1) if (fidx == nr_frags - 1)
dev_consume_skb_any(skb); napi_consume_skb(skb, budget);
tx_ring->txbufs[idx].dma_addr = 0; tx_ring->txbufs[idx].dma_addr = 0;
tx_ring->txbufs[idx].skb = NULL; tx_ring->txbufs[idx].skb = NULL;
...@@ -1828,7 +1829,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget) ...@@ -1828,7 +1829,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget)
unsigned int pkts_polled = 0; unsigned int pkts_polled = 0;
if (r_vec->tx_ring) if (r_vec->tx_ring)
nfp_net_tx_complete(r_vec->tx_ring); nfp_net_tx_complete(r_vec->tx_ring, budget);
if (r_vec->rx_ring) if (r_vec->rx_ring)
pkts_polled = nfp_net_rx(r_vec->rx_ring, budget); pkts_polled = nfp_net_rx(r_vec->rx_ring, budget);
...@@ -2062,7 +2063,7 @@ static void nfp_ctrl_poll(unsigned long arg) ...@@ -2062,7 +2063,7 @@ static void nfp_ctrl_poll(unsigned long arg)
struct nfp_net_r_vector *r_vec = (void *)arg; struct nfp_net_r_vector *r_vec = (void *)arg;
spin_lock_bh(&r_vec->lock); spin_lock_bh(&r_vec->lock);
nfp_net_tx_complete(r_vec->tx_ring); nfp_net_tx_complete(r_vec->tx_ring, 0);
__nfp_ctrl_tx_queued(r_vec); __nfp_ctrl_tx_queued(r_vec);
spin_unlock_bh(&r_vec->lock); spin_unlock_bh(&r_vec->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment