* [Intel-wired-lan] [PATCH net-queue v1] igc: Use num_tx_queues when iterating over tx_ring queue
@ 2021-07-22 0:34 Vinicius Costa Gomes
2021-07-22 5:02 ` Sasha Neftin
0 siblings, 1 reply; 2+ messages in thread
From: Vinicius Costa Gomes @ 2021-07-22 0:34 UTC (permalink / raw)
To: intel-wired-lan
From: "Nishioka, Toshiki" <toshiki.nishioka@intel.com>
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")
Signed-off-by: Toshiki Nishioka <toshiki.nishioka@intel.com>
Tested-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index e29aadbc6744..2b3b741f816c 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -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)))
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Intel-wired-lan] [PATCH net-queue v1] igc: Use num_tx_queues when iterating over tx_ring queue
2021-07-22 0:34 [Intel-wired-lan] [PATCH net-queue v1] igc: Use num_tx_queues when iterating over tx_ring queue Vinicius Costa Gomes
@ 2021-07-22 5:02 ` Sasha Neftin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Neftin @ 2021-07-22 5:02 UTC (permalink / raw)
To: intel-wired-lan
On 7/22/2021 03:34, Vinicius Costa Gomes wrote:
> From: "Nishioka, Toshiki" <toshiki.nishioka@intel.com>
>
> 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")
> Signed-off-by: Toshiki Nishioka <toshiki.nishioka@intel.com>
> Tested-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
> Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index e29aadbc6744..2b3b741f816c 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -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)))
>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-22 5:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 0:34 [Intel-wired-lan] [PATCH net-queue v1] igc: Use num_tx_queues when iterating over tx_ring queue Vinicius Costa Gomes
2021-07-22 5:02 ` Sasha Neftin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.