igc: Add qbv_config_change_errors counter
Subsystems (2)
PATCH v2 1/1 igc: Add qbv_config_change_errors counter
Add ConfigChangeError(qbv_config_change_errors) when user try to set the AdminBaseTime to past value while the current GCL is still running.
The ConfigChangeError counter should not be increased when a gate control list is scheduled into the future.
User can use "ethtool -S <interface> | grep qbv_config_change_errors" command to check the counter values.
---
V1 -> V2: Fix wrong tree applied
---
--- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_ethtool.c | 1 + drivers/net/ethernet/intel/igc/igc_main.c | 1 + drivers/net/ethernet/intel/igc/igc_tsn.c | 6 ++++++ 4 files changed, 9 insertions(+)
drivers/net/ethernet/intel/igc/igc.h +1 -0
@@ -185,6 +185,7 @@ struct igc_adapter {ktime_t base_time;ktime_t cycle_time;bool qbv_enable; +u32 qbv_config_change_errors;/* OS defined structs */ struct pci_dev *pdev;
drivers/net/ethernet/intel/igc/igc_ethtool.c +1 -0
@@ -67,6 +67,7 @@ static const struct igc_stats igc_gstrings_stats[] = {IGC_STAT ("rx_hwtstamp_cleared" , rx_hwtstamp_cleared),IGC_STAT ("tx_lpi_counter" , stats.tlpic),IGC_STAT ("rx_lpi_counter" , stats.rlpic), + IGC_STAT("qbv_config_change_errors", qbv_config_change_errors), };#define IGC_NETDEV_STAT (_net_stat) { \
drivers/net/ethernet/intel/igc/igc_main.c +1 -0
@@ -6012,6 +6012,7 @@ static int igc_tsn_clear_schedule(struct igc_adapter *adapter) adapter->base_time =0 ; adapter->cycle_time =NSEC_PER_SEC ; + adapter->qbv_config_change_errors =0 ;for (i =0 ; i < adapter->num_tx_queues; i++) {struct igc_ring *ring = adapter->tx_ring[i];
drivers/net/ethernet/intel/igc/igc_tsn.c +6 -0
@@ -239,6 +239,12 @@ static int igc_tsn_enable_offload(struct igc_adapter *adapter)s64 n =div64_s64 (ktime_sub_ns (systim, base_time), cycle); base_time =ktime_add_ns (base_time, (n +1 ) * cycle); + +/* Increase the counter if scheduling into the past while +* Gate Control List (GCL) is running. +*/ +if (rd32 (IGC_BASET_H ) ||rd32 (IGC_BASET_L )) + adapter->qbv_config_change_errors++; }else {/* According to datasheet section 7.5.2.9.3.3, FutScdDis bit * has to be configured before the cycle time and base time.
Signature · 6 lines
2.17.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 14 lines · Muhammad Husaini Zulkifli
Add
ConfigChangeError(qbv_config_change_errors)when user try to set the AdminBaseTime to past value while the current GCL is still running.The ConfigChangeError counter should not be increased when a gate control list is scheduled into the future.
User can use "ethtool -S <interface> | grep
qbv_config_change_errors" command to check the counter values.Signed-off-by Muhammad Husaini Zulkifli <[email protected]>---
V1 -> V2: Fix wrong tree applied
---
Quoted 6 lines
--- drivers/net/ethernet/intel/igc/igc.h | 1 + drivers/net/ethernet/intel/igc/igc_ethtool.c | 1 + drivers/net/ethernet/intel/igc/igc_main.c | 1 + drivers/net/ethernet/intel/igc/igc_tsn.c | 6 ++++++ 4 files changed, 9 insertions(+)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan