Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 2b4cc3d

Browse files
AKASHI Takahiroanguy11
AKASHI Takahiro
authored andcommitted
igc: fix the validation logic for taprio's gate list
The check introduced in the commit a5fd394 ("igc: Lift TAPRIO schedule restriction") can detect a false positive error in some corner case. For instance, tc qdisc replace ... taprio num_tc 4 ... sched-entry S 0x01 100000 # slot#1 sched-entry S 0x03 100000 # slot#2 sched-entry S 0x04 100000 # slot#3 sched-entry S 0x08 200000 # slot#4 flags 0x02 # hardware offload Here the queue#0 (the first queue) is on at the slot#1 and #2, and off at the slot#3 and #4. Under the current logic, when the slot#4 is examined, validate_schedule() returns *false* since the enablement count for the queue#0 is two and it is already off at the previous slot (i.e. #3). But this definition is truely correct. Let's fix the logic to enforce a strict validation for consecutively-opened slots. Fixes: a5fd394 ("igc: Lift TAPRIO schedule restriction") Signed-off-by: AKASHI Takahiro <[email protected]> Reviewed-by: Kurt Kanzenbach <[email protected]> Acked-by: Vinicius Costa Gomes <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 02c8379 commit 2b4cc3d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -6010,18 +6010,18 @@ static bool validate_schedule(struct igc_adapter *adapter,
60106010
if (e->command != TC_TAPRIO_CMD_SET_GATES)
60116011
return false;
60126012

6013-
for (i = 0; i < adapter->num_tx_queues; i++) {
6014-
if (e->gate_mask & BIT(i))
6013+
for (i = 0; i < adapter->num_tx_queues; i++)
6014+
if (e->gate_mask & BIT(i)) {
60156015
queue_uses[i]++;
60166016

6017-
/* There are limitations: A single queue cannot be
6018-
* opened and closed multiple times per cycle unless the
6019-
* gate stays open. Check for it.
6020-
*/
6021-
if (queue_uses[i] > 1 &&
6022-
!(prev->gate_mask & BIT(i)))
6023-
return false;
6024-
}
6017+
/* There are limitations: A single queue cannot
6018+
* be opened and closed multiple times per cycle
6019+
* unless the gate stays open. Check for it.
6020+
*/
6021+
if (queue_uses[i] > 1 &&
6022+
!(prev->gate_mask & BIT(i)))
6023+
return false;
6024+
}
60256025
}
60266026

60276027
return true;

0 commit comments

Comments
 (0)