intel: switch to napi_build_skb()
Subsystems (3)
cover intel: switch to napi_build_skb()
napi_build_skb() I introduced earlier this year ([0]) aims to decrease MM pressure and the overhead from in-place kmem_cache_alloc() on each Rx entry processing by decaching skbuff_heads from NAPI per-cpu cache filled prior to that by napi_consume_skb() (so it is sort of a direct shortcut for free -> mm -> alloc cycle).
Currently, no in-tree drivers use it. Switch all Intel Ethernet drivers to it to get slight-to-medium perf boosts depending on the frame size.
ice driver, 50 Gbps link, pktgen + XDP_PASS (local in) sample:
frame_size/nthreads 64/42 128/20 256/8 512/4 1024/2 1532/1
net-next (Kpps) 46062 34654 18248 9830 5343 2714 series 47438 34708 18330 9875 5435 2777 increase 2.9% 0.15% 0.45% 0.46% 1.72% 2.32%
Additionally, e1000's been switched to napi_consume_skb() as it's safe and works fine there, and there's no point in napi_build_skb() without paired NAPI cache feeding point.
[0] https://lore.kernel.org/all/20210213141021.87840-1-alobakin at pm.me
Alexander Lobakin (9):
e1000: switch to napi_consume_skb()
e1000: switch to napi_build_skb()
i40e: switch to napi_build_skb()
iavf: switch to napi_build_skb()
ice: switch to napi_build_skb()
igb: switch to napi_build_skb()
igc: switch to napi_build_skb()
ixgbe: switch to napi_build_skb()
ixgbevf: switch to napi_build_skb()
drivers/net/ethernet/intel/e1000/e1000_main.c | 14 ++++++++------ drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- drivers/net/ethernet/intel/igc/igc_main.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-)
--
2.33.1
PATCH 1/9 e1000: switch to napi_consume_skb()
In order to take the best from per-cpu NAPI skbuff_head caches and CPU cycles, let's switch from dev_kfree_skb_any(), which passes skb back to the mm layer, to napi_consume_skb(), which feeds those caches on non-zero budget instead (falls back to the former on 0). Do the replacement in e1000_unmap_and_free_tx_resource(). There are 4 call sites of this function throughout the driver:
* e1000_clean_tx_ring(). Slowpath, process context, cleans the whole Tx ring on ifdown. Use budget of 0 here;
* e1000_tx_map(). Hotpath, net Tx softirq, unmaps the buffers in case of error. Use 0 as well;
* e1000_clean_tx_irq(). Hotpath, NAPI Tx completion polling cycle. As the driver doesn't count completed Tx entries towards the NAPI budget, just use the poll budget of 64 to utilize caches.
Apart from being a preparation for switching to napi_build_skb(), this is useful on its own as well, as napi_consume_skb() flushes skb caches by batches of 32 instead of one-at-a-time.
--- drivers/net/ethernet/intel/e1000/e1000_main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +7 -5
@@ -1953,7 +1953,8 @@ void e1000_free_all_tx_resources(struct e1000_adapter *adapter)static void e1000_unmap_and_free_tx_resource (struct e1000_adapter *adapter, -struct e1000_tx_buffer *buffer_info) +struct e1000_tx_buffer *buffer_info, +int budget) {if (buffer_info->dma) {if (buffer_info->mapped_as_page)
@@ -1966,7 +1967,7 @@ e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, buffer_info->dma =0 ; }if (buffer_info->skb) { -dev_kfree_skb_any (buffer_info->skb); +napi_consume_skb (buffer_info->skb, budget); buffer_info->skb =NULL ; } buffer_info->time_stamp =0 ;
@@ -1990,7 +1991,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,for (i =0 ; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; -e1000_unmap_and_free_tx_resource (adapter, buffer_info); +e1000_unmap_and_free_tx_resource (adapter, buffer_info,0 ); }netdev_reset_queue (adapter->netdev);
@@ -2958,7 +2959,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter, i += tx_ring->count; i--; buffer_info = &tx_ring->buffer_info[i]; -e1000_unmap_and_free_tx_resource (adapter, buffer_info); +e1000_unmap_and_free_tx_resource (adapter, buffer_info,0 ); }return 0 ;
@@ -3856,7 +3857,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, } } -e1000_unmap_and_free_tx_resource (adapter, buffer_info); +e1000_unmap_and_free_tx_resource (adapter, buffer_info, +64 ); tx_desc->upper.data =0 ;if (unlikely (++i == tx_ring->count))
--
2.33.1
RE: [Intel-wired-lan] [PATCH net-next 1/9] e1000: switch to napi_consume_skb()
Quoted 28 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Tuesday, November 23, 2021 9:19 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 1/9] e1000: switch tonapi_consume_skb()In order to take the best from per-cpu NAPI
skbuff_headcaches and CPU cycles, let's switch fromdev_kfree_skb_any(), which passes skb back to the mm layer, tonapi_consume_skb(), which feeds those caches on non-zero budget instead (falls back to the former on 0).
Do the replacement ine1000_unmap_and_free_tx_resource(). There are 4 call sites of this function throughout the driver:
*e1000_clean_tx_ring(). Slowpath, process context, cleans the whole Tx ring on ifdown. Use budget of 0 here;
*e1000_tx_map(). Hotpath, net Tx softirq, unmaps the buffers in case of error. Use 0 as well;
*e1000_clean_tx_irq(). Hotpath, NAPI Tx completion polling cycle. As the driver doesn't count completed Tx entries towards the NAPI budget, just use the poll budget of 64 to utilize caches.Apart from being a preparation for switching to
napi_build_skb(), this is useful on its own as well, asnapi_consume_skb()flushes skb caches by batches of 32 instead of one-at-a-time.
Quoted 5 lines
Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/e1000/e1000_main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
PATCH 2/9 e1000: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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 element.
e1000 driver runs Tx completion polling cycle right before the Rx one. Now that e1000 uses napi_consume_skb() to put skbuff_heads of completed entries into the cache, it will never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx and increase throughput.
--- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +1 -1
@@ -4384,7 +4384,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,if (!skb) {unsigned int frag_len =e1000_frag_len (adapter); - skb =build_skb (data -E1000_HEADROOM , frag_len); + skb =napi_build_skb (data -E1000_HEADROOM , frag_len);if (!skb) { adapter->alloc_rx_buff_failed++;break ;
--
2.33.1
RE: [Intel-wired-lan] [PATCH net-next 2/9] e1000: switch to napi_build_skb()
Quoted 19 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Tuesday, November 23, 2021 9:19 AM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 2/9] e1000: switch tonapi_build_skb()
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx element.
e1000 driver runs Tx completion polling cycle right before the Rx one. Now that e1000 usesnapi_consume_skb()to putskbuff_headsof completed entries into the cache, it will never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx and increase throughput.
Quoted 5 lines
Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 3/9 i40e: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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.
i40e 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.
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +1 -1
@@ -2204,7 +2204,7 @@ static struct sk_buff *i40e_build_skb(struct i40e_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.33.1
RE: [Intel-wired-lan] [PATCH net-next 3/9] i40e: switch to napi_build_skb()
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Tuesday, November 23, 2021 10:49 PM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 3/9] i40e: switch tonapi_build_skb()
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx. i40e driver runs Tx completion polling cycle right before the Rx one and usesnapi_consume_skb()to feed the cache withskbuff_headsof completed entries, so it's never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx.
Quoted 6 lines
Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 4/9 iavf: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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.
iavf 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.
--- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_txrx.c +1 -1
@@ -1363,7 +1363,7 @@ static struct sk_buff *iavf_build_skb(struct iavf_ring *rx_ring,net_prefetch (va);/* build an skb around the page buffer */ - skb =build_skb (va -IAVF_SKB_PAD , truesize); + skb =napi_build_skb (va -IAVF_SKB_PAD , truesize);if (unlikely (!skb))return NULL ;
--
2.33.1
RE: [Intel-wired-lan] [PATCH net-next 4/9] iavf: switch to napi_build_skb()
drivers/net/ethernet/intel/iavf/iavf_txrx.c static struct sk_buff *iavf_build_skb(struct
Quoted 32 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: wtorek, 23 listopada 2021 18:19
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 4/9] iavf: switch tonapi_build_skb()
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx.
iavf driver runs Tx completion polling cycle right before the Rx one and usesnapi_consume_skb()to feed the cache withskbuff_headsof completed entries, so it's never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx.Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_txrx.c +0
-0@@ -1363,7 +1363,7 @@ static struct sk_buff *iavf_build_skb(struct
PATCH 5/9 ice: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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.
ice 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.
--- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +1 -1
@@ -933,7 +933,7 @@ ice_build_skb(struct ice_rx_ring *rx_ring, struct ice_rx_buf *rx_buf,*/ 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.33.1
RE: [Intel-wired-lan] [PATCH net-next 5/9] ice: switch to napi_build_skb()
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Tuesday, November 23, 2021 10:49 PM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 5/9] ice: switch tonapi_build_skb()
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx. ice driver runs Tx completion polling cycle right before the Rx one and usesnapi_consume_skb()to feed the cache withskbuff_headsof completed entries, so it's never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx.
Quoted 6 lines
Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 6/9 igb: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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.
igb 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.
--- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
@@ -8367,7 +8367,7 @@ static struct sk_buff *igb_build_skb(struct igb_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.33.1
RE: [Intel-wired-lan] [PATCH net-next 6/9] igb: switch to napi_build_skb()
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Tuesday, November 23, 2021 10:49 PM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 6/9] igb: switch tonapi_build_skb()
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx. igb driver runs Tx completion polling cycle right before the Rx one and usesnapi_consume_skb()to feed the cache withskbuff_headsof completed entries, so it's never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx.
Quoted 6 lines
Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 7/9 igc: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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.
--- drivers/net/ethernet/intel/igc/igc_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
@@ -1729,7 +1729,7 @@ static struct sk_buff *igc_build_skb(struct igc_ring *rx_ring,net_prefetch (va);/* build an skb around the page buffer */ - skb =build_skb (va -IGC_SKB_PAD , truesize); + skb =napi_build_skb (va -IGC_SKB_PAD , truesize);if (unlikely (!skb))return NULL ;
--
2.33.1
Re: [Intel-wired-lan] [PATCH net-next 7/9] igc: switch to napi_build_skb()
Quoted 9 lines · Alexander Lobakin
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx.
igc driver runs Tx completion polling cycle right before the Rx one and usesnapi_consume_skb()to feed the cache withskbuff_headsof completed entries, so it's never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx.
Quoted 6 lines
Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/igc/igc_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 8/9 ixgbe: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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.
ixgbe 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.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +1 -1
@@ -2170,7 +2170,7 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring,net_prefetch (xdp->data_meta);/* build an skb to 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.33.1
RE: [Intel-wired-lan] [PATCH net-next 8/9] ixgbe: switch to napi_build_skb()
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Tuesday, November 23, 2021 10:49 PM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 8/9] ixgbe: switch tonapi_build_skb()
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx. ixgbe driver runs Tx completion polling cycle right before the Rx one and usesnapi_consume_skb()to feed the cache withskbuff_headsof completed entries, so it's never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx.
Quoted 6 lines
Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 9/9 ixgbevf: switch to napi_build_skb()
In reply to Alexander Lobakinnapi_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.
ixgbevf 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.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 -1
@@ -944,7 +944,7 @@ static struct sk_buff *ixgbevf_build_skb(struct ixgbevf_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.33.1
RE: [Intel-wired-lan] [PATCH net-next 9/9] ixgbevf: switch to napi_build_skb()
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c static struct sk_buff *ixgbevf_build_skb(struct
Quoted 32 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: wtorek, 23 listopada 2021 18:19
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; linux-kernel at vger.kernel.org; Jakub Kicinski <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 9/9] ixgbevf: switch tonapi_build_skb()
napi_build_skb()reuses per-cpu NAPIskbuff_headcache in order to save some cycles on freeing/allocatingskbuff_headson every new Rx or completed Tx.
ixgbevf driver runs Tx completion polling cycle right before the Rx one and usesnapi_consume_skb()to feed the cache withskbuff_headsof completed entries, so it's never empty and always warm at that moment. Switch to thenapi_build_skb()to relax mm pressure on heavy Rx.Signed-off-by Alexander Lobakin <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +0
-0@@ -944,7 +944,7 @@ static struct sk_buff *ixgbevf_build_skb(struct