* [Intel-wired-lan] [PATCH net-next v1] igc: Add qbv_config_change_errors counter
@ 2022-12-15 3:39 Muhammad Husaini Zulkifli
2022-12-15 18:31 ` Nguyen, Anthony L
0 siblings, 1 reply; 3+ messages in thread
From: Muhammad Husaini Zulkifli @ 2022-12-15 3:39 UTC (permalink / raw)
To: intel-wired-lan, vinicius.gomes
Cc: muhammad.husaini.zulkifli, anthony.l.nguyen
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 <muhammad.husaini.zulkifli@intel.com>
---
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(+)
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 1f3f83013125..5b191798504c 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -196,6 +196,7 @@ struct igc_adapter {
bool frame_preemption_active;
u32 add_frag_size;
bool qbv_enable;
+ u32 qbv_config_change_errors;
/* OS defined structs */
struct pci_dev *pdev;
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index d72a51f6fec2..165dbcda600d 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -68,6 +68,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) { \
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index fbc81b8a0b50..c83fbabe98fc 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6194,6 +6194,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];
diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
index 1de93d07ea24..3eb7fd7fb0a8 100644
--- a/drivers/net/ethernet/intel/igc/igc_tsn.c
+++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
@@ -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.
--
2.17.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next v1] igc: Add qbv_config_change_errors counter
2022-12-15 3:39 [Intel-wired-lan] [PATCH net-next v1] igc: Add qbv_config_change_errors counter Muhammad Husaini Zulkifli
@ 2022-12-15 18:31 ` Nguyen, Anthony L
2022-12-15 22:19 ` Zulkifli, Muhammad Husaini
0 siblings, 1 reply; 3+ messages in thread
From: Nguyen, Anthony L @ 2022-12-15 18:31 UTC (permalink / raw)
To: Zulkifli, Muhammad Husaini, intel-wired-lan, Gomes, Vinicius
> -----Original Message-----
> From: Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>
> Sent: Wednesday, December 14, 2022 7:39 PM
> To: intel-wired-lan@osuosl.org; Gomes, Vinicius <vinicius.gomes@intel.com>
> Cc: Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>;
> naamax.meir@linux.intel.com; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>
> Subject: [PATCH net-next v1] 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.
>
> Signed-off-by: Muhammad Husaini Zulkifli
> <muhammad.husaini.zulkifli@intel.com>
This patch doesn't apply to the tree.
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next v1] igc: Add qbv_config_change_errors counter
2022-12-15 18:31 ` Nguyen, Anthony L
@ 2022-12-15 22:19 ` Zulkifli, Muhammad Husaini
0 siblings, 0 replies; 3+ messages in thread
From: Zulkifli, Muhammad Husaini @ 2022-12-15 22:19 UTC (permalink / raw)
To: Nguyen, Anthony L, intel-wired-lan, Gomes, Vinicius
Hi Anthony,
> -----Original Message-----
> From: Nguyen, Anthony L <anthony.l.nguyen@intel.com>
> Sent: Friday, 16 December, 2022 2:32 AM
> To: Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>;
> intel-wired-lan@osuosl.org; Gomes, Vinicius <vinicius.gomes@intel.com>
> Cc: naamax.meir@linux.intel.com
> Subject: RE: [PATCH net-next v1] igc: Add qbv_config_change_errors counter
>
> > -----Original Message-----
> > From: Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>
> > Sent: Wednesday, December 14, 2022 7:39 PM
> > To: intel-wired-lan@osuosl.org; Gomes, Vinicius
> > <vinicius.gomes@intel.com>
> > Cc: Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>;
> > naamax.meir@linux.intel.com; Nguyen, Anthony L
> > <anthony.l.nguyen@intel.com>
> > Subject: [PATCH net-next v1] 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.
> >
> > Signed-off-by: Muhammad Husaini Zulkifli
> > <muhammad.husaini.zulkifli@intel.com>
>
> This patch doesn't apply to the tree.
My bad. I will send v2 to fix this.
Thanks,
Husaini
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-15 22:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15 3:39 [Intel-wired-lan] [PATCH net-next v1] igc: Add qbv_config_change_errors counter Muhammad Husaini Zulkifli
2022-12-15 18:31 ` Nguyen, Anthony L
2022-12-15 22:19 ` Zulkifli, Muhammad Husaini
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.