Skip to content

Commit 691bd4d

Browse files
tnishiokanguy11
authored andcommitted
igc: Use num_tx_queues when iterating over tx_ring queue
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: ec50a9d ("igc: Add support for taprio offloading") Signed-off-by: Toshiki Nishioka <[email protected]> Signed-off-by: Muhammad Husaini Zulkifli <[email protected]> Tested-by: Muhammad Husaini Zulkifli <[email protected]> Acked-by: Sasha Neftin <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 4b79959 commit 691bd4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5495,7 +5495,7 @@ static bool validate_schedule(struct igc_adapter *adapter,
54955495
if (e->command != TC_TAPRIO_CMD_SET_GATES)
54965496
return false;
54975497

5498-
for (i = 0; i < IGC_MAX_TX_QUEUES; i++) {
5498+
for (i = 0; i < adapter->num_tx_queues; i++) {
54995499
if (e->gate_mask & BIT(i))
55005500
queue_uses[i]++;
55015501

@@ -5552,7 +5552,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
55525552

55535553
end_time += e->interval;
55545554

5555-
for (i = 0; i < IGC_MAX_TX_QUEUES; i++) {
5555+
for (i = 0; i < adapter->num_tx_queues; i++) {
55565556
struct igc_ring *ring = adapter->tx_ring[i];
55575557

55585558
if (!(e->gate_mask & BIT(i)))

0 commit comments

Comments
 (0)