Skip to content

Commit 41a9a68

Browse files
shifty91anguy11
authored andcommitted
igc: Restore default Qbv schedule when changing channels
The Multi-queue Priority (MQPRIO) and Earliest TxTime First (ETF) offloads utilize the Time Sensitive Networking (TSN) Tx mode. This mode is always coupled to IEEE 802.1Qbv time aware shaper (Qbv). Therefore, the driver sets a default Qbv schedule of all gates opened and a cycle time of 1s. This schedule is set during probe. However, the following sequence of events lead to Tx issues: - Boot a dual core system igc_probe(): igc_tsn_clear_schedule(): -> Default Schedule is set Note: At this point the driver has allocated two Tx/Rx queues, because there are only two CPUs. - ethtool -L enp3s0 combined 4 igc_ethtool_set_channels(): igc_reinit_queues() -> Default schedule is gone, per Tx ring start and end time are zero - tc qdisc replace dev enp3s0 handle 100 parent root mqprio \ num_tc 4 map 3 3 2 2 0 1 1 1 3 3 3 3 3 3 3 3 \ queues 1@0 1@1 1@2 1@3 hw 1 igc_tsn_offload_apply(): igc_tsn_enable_offload(): -> Writes zeros to IGC_STQT(i) and IGC_ENDQT(i), causing Tx to stall/fail Therefore, restore the default Qbv schedule after changing the number of channels. Furthermore, add a restriction to not allow queue reconfiguration when TSN/Qbv is enabled, because it may lead to inconsistent states. Fixes: c814a2d ("igc: Use default cycle 'start' and 'end' values for queues") Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Avigail Dahan <avigailx.dahan@intel.com> Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 01139a2 commit 41a9a68

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,8 +1565,8 @@ static int igc_ethtool_set_channels(struct net_device *netdev,
15651565
if (ch->other_count != NON_Q_VECTORS)
15661566
return -EINVAL;
15671567

1568-
/* Do not allow channel reconfiguration when mqprio is enabled */
1569-
if (adapter->strict_priority_enable)
1568+
/* Do not allow channel reconfiguration when any TSN qdisc is enabled */
1569+
if (adapter->flags & IGC_FLAG_TSN_ANY_ENABLED)
15701570
return -EINVAL;
15711571

15721572
/* Verify the number of channels doesn't exceed hw limits */

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7759,6 +7759,11 @@ int igc_reinit_queues(struct igc_adapter *adapter)
77597759
if (netif_running(netdev))
77607760
err = igc_open(netdev);
77617761

7762+
if (!err) {
7763+
/* Restore default IEEE 802.1Qbv schedule after queue reinit */
7764+
igc_tsn_clear_schedule(adapter);
7765+
}
7766+
77627767
return err;
77637768
}
77647769

0 commit comments

Comments
 (0)