OpenCloudOS-Kernel/drivers/net/ethernet/amazon/ena
David Arinzon a8ee104f98 net: ena: Update NUMA TPH hint register upon NUMA node update
The device supports a PCIe optimization hint, which indicates on
which NUMA the queue is currently processed. This hint is utilized
by PCIe in order to reduce its access time by accessing the
correct NUMA resources and maintaining cache coherence.

The driver calls the register update for the hint (called TPH -
TLP Processing Hint) during the NAPI loop.

Though the update is expected upon a NUMA change (when a queue
is moved from one NUMA to the other), the current logic performs
a register update when the queue is moved to a different CPU,
but the CPU is not necessarily in a different NUMA.

The changes include:
1. Performing the TPH update only when the queue has switched
a NUMA node.
2. Moving the TPH update call to be triggered only when NAPI was
scheduled from interrupt context, as opposed to a busy-polling loop.
This is due to the fact that during busy-polling, the frequency
of CPU switches for a particular queue is significantly higher,
thus, the likelihood to switch NUMA is much higher. Therefore,
providing the frequent updates to the device upon a NUMA update
are unlikely to be beneficial.

Fixes: 1738cd3ed3 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: David Arinzon <darinzon@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-12-30 07:43:44 +00:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
ena_admin_defs.h net: ena: Add capabilities field with support for ENI stats capability 2022-01-07 19:25:50 -08:00
ena_com.c net: ena: Fix toeplitz initial hash value 2022-12-30 07:43:43 +00:00
ena_com.h net: ena: Add capabilities field with support for ENI stats capability 2022-01-07 19:25:50 -08:00
ena_common_defs.h net: ena: Change license into format to SPDX in all files 2020-09-21 13:54:22 -07:00
ena_eth_com.c net: ena: Improve error logging in driver 2021-06-08 14:41:09 -07:00
ena_eth_com.h net: ena: add device distinct log prefix to files 2020-12-09 15:26:40 -08:00
ena_eth_io_defs.h net: ena: Change license into format to SPDX in all files 2020-09-21 13:54:22 -07:00
ena_ethtool.c net: ena: Fix rx_copybreak value update 2022-12-30 07:43:44 +00:00
ena_netdev.c net: ena: Update NUMA TPH hint register upon NUMA node update 2022-12-30 07:43:44 +00:00
ena_netdev.h net: ena: Update NUMA TPH hint register upon NUMA node update 2022-12-30 07:43:44 +00:00
ena_pci_id_tbl.h net: ena: Change license into format to SPDX in all files 2020-09-21 13:54:22 -07:00
ena_regs_defs.h net: ena: Change license into format to SPDX in all files 2020-09-21 13:54:22 -07:00