Skip to content

Commit

Permalink
ibmvnic: Update XPS assignments during affinity binding
Browse files Browse the repository at this point in the history
Transmit Packet Steering (XPS) maps cpu numbers to transmit
queues. By running the same connection on the same set of cpu's,
contention for the queue and cache miss rate can be minimized.
When assigning a cpu mask for a tranmit queues irq number, assign
the same cpu mask as the set of cpu's that XPS should use for that
queue.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: Nick Child <nnac123@linux.ibm.com>
Reviewed-by: Rick Lindsley <ricklind@linux.ibm.com>
Reviewed-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nick Child authored and David S. Miller committed Nov 14, 2022
1 parent 92125c3 commit df8f66d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ static void ibmvnic_set_affinity(struct ibmvnic_adapter *adapter)
stride);
if (rc)
goto out;

if (!queue)
continue;

rc = __netif_set_xps_queue(adapter->netdev,
cpumask_bits(queue->affinity_mask),
i, XPS_CPUS);
if (rc)
netdev_warn(adapter->netdev, "%s: Set XPS on queue %d failed, rc = %d.\n",
__func__, i, rc);
}

for (i = 0; i < num_rxqs; i++) {
Expand Down

0 comments on commit df8f66d

Please sign in to comment.