All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>,
	netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
	Nechama Kraus <nechamax.kraus@linux.intel.com>
Subject: [PATCH net-next 7/9] igc: switch to napi_build_skb()
Date: Tue, 28 Dec 2021 09:58:13 -0800	[thread overview]
Message-ID: <20211228175815.281449-8-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20211228175815.281449-1-anthony.l.nguyen@intel.com>

From: Alexander Lobakin <alexandr.lobakin@intel.com>

napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order
to save some cycles on freeing/allocating skbuff_heads on every
new Rx or completed Tx.
igc driver runs Tx completion polling cycle right before the Rx
one and uses napi_consume_skb() to feed the cache with skbuff_heads
of completed entries, so it's never empty and always warm at that
moment. Switch to the napi_build_skb() to relax mm pressure on
heavy Rx.

Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Nechama Kraus <nechamax.kraus@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 142c57b7a451..8af267512afa 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -1729,7 +1729,7 @@ static struct sk_buff *igc_build_skb(struct igc_ring *rx_ring,
 	net_prefetch(xdp->data_meta);
 
 	/* build an skb around the page buffer */
-	skb = build_skb(xdp->data_hard_start, truesize);
+	skb = napi_build_skb(xdp->data_hard_start, truesize);
 	if (unlikely(!skb))
 		return NULL;
 
-- 
2.31.1


  parent reply	other threads:[~2021-12-28 17:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-28 17:58 [PATCH net-next 0/9][pull request] 10GbE Intel Wired LAN Driver Updates 2021-12-28 Tony Nguyen
2021-12-28 17:58 ` [PATCH net-next 1/9] e1000: switch to napi_consume_skb() Tony Nguyen
2021-12-28 17:58 ` [PATCH net-next 2/9] e1000: switch to napi_build_skb() Tony Nguyen
2021-12-28 17:58 ` [PATCH net-next 3/9] i40e: " Tony Nguyen
2021-12-28 17:58 ` [PATCH net-next 4/9] iavf: " Tony Nguyen
2021-12-28 17:58 ` [PATCH net-next 5/9] ice: " Tony Nguyen
2021-12-28 17:58 ` [PATCH net-next 6/9] igb: " Tony Nguyen
2021-12-28 17:58 ` Tony Nguyen [this message]
2021-12-28 17:58 ` [PATCH net-next 8/9] ixgbe: " Tony Nguyen
2021-12-28 17:58 ` [PATCH net-next 9/9] ixgbevf: " Tony Nguyen
2021-12-29  0:20 ` [PATCH net-next 0/9][pull request] 10GbE Intel Wired LAN Driver Updates 2021-12-28 patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-11-23 17:18 [PATCH net-next 0/9] intel: switch to napi_build_skb() Alexander Lobakin
2021-11-23 17:18 ` [PATCH net-next 7/9] igc: " Alexander Lobakin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211228175815.281449-8-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=nechamax.kraus@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.