netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ibmvnic: Assign XPS map to correct queue index
@ 2023-02-23 15:39 Nick Child
  2023-02-24  8:49 ` Pavan Chebbi
  2023-02-25  2:36 ` Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Nick Child @ 2023-02-23 15:39 UTC (permalink / raw)
  To: netdev; +Cc: bjking1, haren, ricklind, Nick Child

When setting the XPS map value for TX queues, use the index of the
transmit queue.
Previously, the function was passing the index of the loop that iterates
over all queues (RX and TX). This was causing invalid XPS map values.

Fixes: 6831582937bd ("ibmvnic: Toggle between queue types in affinity mapping")
Signed-off-by: Nick Child <nnac123@linux.ibm.com>
---

I am a little surprised that __netif_set_xps_queue() did not complain that some
index values were greater than the number of tx queues. Though maybe the function
assumes that the developers are wise enough :)

Should __netif_set_xps_queue() have a check that index < dev->num_tx_queues?

 drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 146ca1d8031b..c63d3ec9d328 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -296,10 +296,10 @@ static void ibmvnic_set_affinity(struct ibmvnic_adapter *adapter)
 
 		rc = __netif_set_xps_queue(adapter->netdev,
 					   cpumask_bits(queue->affinity_mask),
-					   i, XPS_CPUS);
+					   i_txqs - 1, XPS_CPUS);
 		if (rc)
 			netdev_warn(adapter->netdev, "%s: Set XPS on queue %d failed, rc = %d.\n",
-				    __func__, i, rc);
+				    __func__, i_txqs - 1, rc);
 	}
 
 out:
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-25  2:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-23 15:39 [PATCH net-next] ibmvnic: Assign XPS map to correct queue index Nick Child
2023-02-24  8:49 ` Pavan Chebbi
2023-02-24 16:34   ` Nick Child
2023-02-25  2:36 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).