Skip to contentSkip to conversation

igc: Use num_tx_queues when iterating over tx_ring queue

PATCH New Vinicius Costa Gomes 2 participants 2 messages Jul 22, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: Use num_tx_queues when iterating over tx_ring queue

From: "Nishioka, Toshiki" <[email protected]>

Use num_tx_queues rather than the IGC_MAX_TX_QUEUES fixed number 4 when iterating over tx_ring queue since instantiated queue count could be less than 4 where on-line cpu count is less than 4.

Fixes ec50a9d437f0 ("igc: Add support for taprio offloading")
---
 drivers/net/ethernet/intel/igc/igc_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +2 -2
index e29aadbc6744..2b3b741f816c 100644
@@ -5489,7 +5489,7 @@ static bool validate_schedule(struct igc_adapter *adapter,
 		if (e->command != TC_TAPRIO_CMD_SET_GATES)
 			return false;
 
-		for (i = 0; i < IGC_MAX_TX_QUEUES; i++) {
+		for (i = 0; i < adapter->num_tx_queues; i++) {
 			if (e->gate_mask & BIT(i))
 				queue_uses[i]++;
 
@@ -5546,7 +5546,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
 
 		end_time += e->interval;
 
-		for (i = 0; i < IGC_MAX_TX_QUEUES; i++) {
+		for (i = 0; i < adapter->num_tx_queues; i++) {
 			struct igc_ring *ring = adapter->tx_ring[i];
 
 			if (!(e->gate_mask & BIT(i)))
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/1 igc: Use num_tx_queues when iterating over tx_ring queue

Quoted 29 lines · Vinicius Costa Gomes

From: "Nishioka, Toshiki" <[email protected]>

Use num_tx_queues rather than the IGC_MAX_TX_QUEUES fixed number 4 when iterating over tx_ring queue since instantiated queue count could be less than 4 where on-line cpu count is less than 4.

Fixes ec50a9d437f0 ("igc: Add support for taprio offloading")
---
  drivers/net/ethernet/intel/igc/igc_main.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
index e29aadbc6744..2b3b741f816c 100644
@@ -5489,7 +5489,7 @@ static bool validate_schedule(struct igc_adapter *adapter,
  		if (e->command != TC_TAPRIO_CMD_SET_GATES)
  			return false;
 
-		for (i = 0; i < IGC_MAX_TX_QUEUES; i++) {
+		for (i = 0; i < adapter->num_tx_queues; i++) {
  			if (e->gate_mask & BIT(i))
  				queue_uses[i]++;
 

drivers/net/ethernet/intel/igc/igc_main.c static int igc_save_qbv_schedule(struct igc_adapter *adapter, · line 5552

Quoted 8 lines
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
@@ -5546,7 +5546,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
 
  		end_time += e->interval;
 
-		for (i = 0; i < IGC_MAX_TX_QUEUES; i++) {
+		for (i = 0; i < adapter->num_tx_queues; i++) {
  			struct igc_ring *ring = adapter->tx_ring[i];
 
  			if (!(e->gate_mask & BIT(i)))