Skip to content

Commit

Permalink
igc: Use num_tx_queues when iterating over tx_ring queue
Browse files Browse the repository at this point in the history
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 <toshiki.nishioka@intel.com>
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Tested-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Toshiki Nishioka authored and Tony Nguyen committed Aug 20, 2021
1 parent 4b79959 commit 691bd4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/igc/igc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5495,7 +5495,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]++;

Expand Down Expand Up @@ -5552,7 +5552,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)))
Expand Down

0 comments on commit 691bd4d

Please sign in to comment.