2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-16 01:24:08 +08:00

net: thunderx: Use napi_consume_skb for bulk free

This patch enables bulk freeing on the Tx side.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sunil Goutham 2016-08-12 16:51:41 +05:30 committed by David S. Miller
parent a3a8ce4ce7
commit c43548d26c

View File

@ -521,7 +521,8 @@ static int nicvf_init_resources(struct nicvf *nic)
static void nicvf_snd_pkt_handler(struct net_device *netdev, static void nicvf_snd_pkt_handler(struct net_device *netdev,
struct cmp_queue *cq, struct cmp_queue *cq,
struct cqe_send_t *cqe_tx, int cqe_type) struct cqe_send_t *cqe_tx,
int cqe_type, int budget)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct nicvf *nic = netdev_priv(netdev); struct nicvf *nic = netdev_priv(netdev);
@ -545,7 +546,7 @@ static void nicvf_snd_pkt_handler(struct net_device *netdev,
if (skb) { if (skb) {
nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1); nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
prefetch(skb); prefetch(skb);
dev_consume_skb_any(skb); napi_consume_skb(skb, budget);
sq->skbuff[cqe_tx->sqe_ptr] = (u64)NULL; sq->skbuff[cqe_tx->sqe_ptr] = (u64)NULL;
} else { } else {
/* In case of HW TSO, HW sends a CQE for each segment of a TSO /* In case of HW TSO, HW sends a CQE for each segment of a TSO
@ -700,7 +701,8 @@ loop:
break; break;
case CQE_TYPE_SEND: case CQE_TYPE_SEND:
nicvf_snd_pkt_handler(netdev, cq, nicvf_snd_pkt_handler(netdev, cq,
(void *)cq_desc, CQE_TYPE_SEND); (void *)cq_desc, CQE_TYPE_SEND,
budget);
tx_done++; tx_done++;
break; break;
case CQE_TYPE_INVALID: case CQE_TYPE_INVALID: