Skip to content

Commit 780e354

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Make use of cpumask_local_spread to improve RSS locality
This patch is meant to address locality issues present in the ixgbe driver when it is loaded on a system supporting multiple NUMA nodes and more CPUs then the device can map in a 1:1 fashion. Instead of just arbitrarily mapping itself to CPUs 0-62 it would make much more sense to map itself to the local CPUs first, and then map itself to any remaining CPUs that might be used. The first effect of this is that queue 0 should always be allocated on the local CPU/NUMA node. This is important as it is the default destination if a packet doesn't match any existing flow director filter or RSS rule and as such having it local should help to reduce QPI cross-talk in the event of an unrecognized traffic type. In addition this should increase the likelihood of the RSS queues being allocated and used on CPUs local to the device while the ATR/Flow Director queues would be able to route traffic directly to the CPU that is likely to be processing it. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 0e10044 commit 780e354

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,9 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
832832
int xdp_count, int xdp_idx,
833833
int rxr_count, int rxr_idx)
834834
{
835+
int node = dev_to_node(&adapter->pdev->dev);
835836
struct ixgbe_q_vector *q_vector;
836837
struct ixgbe_ring *ring;
837-
int node = NUMA_NO_NODE;
838838
int cpu = -1;
839839
int ring_count;
840840
u8 tcs = adapter->hw_tcs;
@@ -845,10 +845,8 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
845845
if ((tcs <= 1) && !(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) {
846846
u16 rss_i = adapter->ring_feature[RING_F_RSS].indices;
847847
if (rss_i > 1 && adapter->atr_sample_rate) {
848-
if (cpu_online(v_idx)) {
849-
cpu = v_idx;
850-
node = cpu_to_node(cpu);
851-
}
848+
cpu = cpumask_local_spread(v_idx, node);
849+
node = cpu_to_node(cpu);
852850
}
853851
}
854852

0 commit comments

Comments
 (0)