提交 6e5bea52 编写于 作者: T Toshiki Nishioka 提交者: Zheng Zengkai

igc: Use num_tx_queues when iterating over tx_ring queue

mainline inclusion
from mainline-5.10.62
commit 58b3dbf10c01ee076504a203ae93c43d46accf15
bugzilla: 182217 https://gitee.com/openeuler/kernel/issues/I4EFOS

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=58b3dbf10c01ee076504a203ae93c43d46accf15

--------------------------------

[ Upstream commit 691bd4d7 ]

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: ec50a9d4 ("igc: Add support for taprio offloading")
Signed-off-by: NToshiki Nishioka <toshiki.nishioka@intel.com>
Signed-off-by: NMuhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Tested-by: NMuhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Acked-by: NSasha Neftin <sasha.neftin@intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 285337f3
...@@ -4744,7 +4744,7 @@ static bool validate_schedule(struct igc_adapter *adapter, ...@@ -4744,7 +4744,7 @@ static bool validate_schedule(struct igc_adapter *adapter,
if (e->command != TC_TAPRIO_CMD_SET_GATES) if (e->command != TC_TAPRIO_CMD_SET_GATES)
return false; 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)) if (e->gate_mask & BIT(i))
queue_uses[i]++; queue_uses[i]++;
...@@ -4801,7 +4801,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter, ...@@ -4801,7 +4801,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
end_time += e->interval; 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]; struct igc_ring *ring = adapter->tx_ring[i];
if (!(e->gate_mask & BIT(i))) if (!(e->gate_mask & BIT(i)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册