Skip to content

eth: bnxt_en: allocate memory on the right NUMA node

Jakub Kicinski netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 3 repliesIn review
  2. v16 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- convert the sp_event producers which set the bit directly (Björn)
- correct the comment on ring_nid, it's not only written by the notifier
- allocate ring_nid with kmalloc_objs()
- add a prep patch with a local bp variable in the IRQ affinity notifier
- split the TPH condition in the IRQ affinity notifier (Joe)
- only compare the node of queues with explicitly set IRQ affinity
v1: https://lore.kernel.org/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7eth: bnxt_en: order event data before setting the sp_event bitdrivers/net/ethernet/broadcom/bnxt/bnxt.c+21 -121 reply
2/7eth: bnxt_en: follow explicitly set IRQ affinity when placing page pooldrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h+44 -70 replies
3/7eth: bnxt_en: allocate per-queue SW state on the queue's NUMA nodedrivers/net/ethernet/broadcom/bnxt/bnxt.c+52 -350 replies
4/7eth: bnxt_en: explicitly keep device-only memory on the device's nodedrivers/net/ethernet/broadcom/bnxt/bnxt.c+3 -10 replies
5/7eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA nodedrivers/net/ethernet/broadcom/bnxt/bnxt.c+12 -120 replies
6/7eth: bnxt_en: add a local bp variable in the IRQ affinity notifierdrivers/net/ethernet/broadcom/bnxt/bnxt.c+12 -110 replies
7/7eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA nodedrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h+35 -201 reply

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBjörn TöpelJoe DamatoMichael Chan
SeriesR-b
1/7R-b
2/7R-b R-b
3/7R-b R-b
4/7R-b R-b
5/7R-b R-b
6/7
7/7R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/7] eth: bnxt_en: allocate memory on the right NUMA node

Teach bnxt to allocate the memory touched by the fast path on the NUMA node where NAPI is being serviced.

On modern systems the PCIe controller is part of the CPU. On NUMA systems we get to pick which NUMA node the queue and NAPI related memory will get allocated from. Allocating SW state on the node where NAPI will run is just common sense.
For memory touched by both device and the CPU we need to pick which side will pay the extra price (either device or CPU will have to "reach" futher). This series allocates all state and all descriptor rings on the NAPI CPU.

Testing a dual-IO-die AMD Venice CPU, where NIC is on node 1 and with NAPI+kperf pinned to node 0, this series gives:
placing page pools on the right node: -5.1% CPU load
placing page pools and completion rings: -8.9% CPU load

Moving SW state is in the noise in a tight-loop kperf banchmark as the state fits in the cache, anyway.

This series was the motivation for cleaning up the DMA API
allocations with explicit NUMA node:
commit a0aa9ceca03f ("Merge tag 'dma_alloc_coherent_node' of git://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux")

I held off reallocating the Rx completion ring on queue restart, we need to fix the IRQ coalescing there first:
https://lore.kernel.org/all/[email protected]/

v2:
- convert the sp_event producers which set the bit directly (Björn)
- correct the comment on ring_nid, it's not only written by the notifier
- allocate ring_nid with kmalloc_objs()
- add a prep patch with a local bp variable in the IRQ affinity notifier
- split the TPH condition in the IRQ affinity notifier (Joe)
- only compare the node of queues with explicitly set IRQ affinity
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (7):
eth: bnxt_en: order event data before setting the sp_event bit
eth: bnxt_en: follow explicitly set IRQ affinity when placing page
pool
eth: bnxt_en: allocate per-queue SW state on the queue's NUMA node
eth: bnxt_en: explicitly keep device-only memory on the device's node
eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA node
eth: bnxt_en: add a local bp variable in the IRQ affinity notifier
eth: bnxt_en: restart Rx queues when their IRQ moves to another NUMA
node

 drivers/net/ethernet/broadcom/bnxt/bnxt.h |   7 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 250 ++++++++++++++--------
 2 files changed, 169 insertions(+), 88 deletions(-)
Signature · 1 line
2.56.1