All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] net/sfc/base: add new stats
@ 2018-05-03 14:41 Andrew Rybchenko
  2018-05-03 14:41 ` [PATCH 1/4] net/sfc/base: fix Medford2 FEC stats range Andrew Rybchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2018-05-03 14:41 UTC (permalink / raw)
  To: dev

Update net/sfc base driver to provide a new stats available on
XtremeScale X2 (aka Medford2) NICs. No new code is required in
net/sfc PMD.

HLB_IDLE and HLB_TIMEOUT stats are useful for packet drops and
performance investigations.

There are few checkpatches.sh warnings due to coding style difference
in base driver.

Andrew Rybchenko (4):
  net/sfc/base: fix Medford2 FEC stats range
  net/sfc/base: generate Medford2 RxDP stats
  net/sfc/base: support RxDP scatter disabled truncate counter
  net/sfc/base: add Medford2 head-of-line blocking stats

 drivers/net/sfc/base/ef10_mac.c | 41 ++++++++++++++++++++++++++++++++++++++++-
 drivers/net/sfc/base/ef10_nic.c |  6 ++++++
 drivers/net/sfc/base/efx.h      |  6 +++++-
 drivers/net/sfc/base/efx_mac.c  |  5 ++++-
 4 files changed, 55 insertions(+), 3 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] net/sfc/base: fix Medford2 FEC stats range
  2018-05-03 14:41 [PATCH 0/4] net/sfc/base: add new stats Andrew Rybchenko
@ 2018-05-03 14:41 ` Andrew Rybchenko
  2018-05-03 14:41 ` [PATCH 2/4] net/sfc/base: generate Medford2 RxDP stats Andrew Rybchenko
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2018-05-03 14:41 UTC (permalink / raw)
  To: dev

Fixes: 400ba3daeeb1 ("net/sfc/base: decode Medford2 FEC stats if available")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/base/ef10_mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/base/ef10_mac.c b/drivers/net/sfc/base/ef10_mac.c
index df2c0fb80..3a62fd09c 100644
--- a/drivers/net/sfc/base/ef10_mac.c
+++ b/drivers/net/sfc/base/ef10_mac.c
@@ -526,7 +526,7 @@ ef10_mac_stats_get_mask(
 	if (encp->enc_fec_counters) {
 		const struct efx_mac_stats_range ef10_fec[] = {
 			{ EFX_MAC_FEC_UNCORRECTED_ERRORS,
-			    MC_CMD_MAC_FEC_CORRECTED_SYMBOLS_LANE3 },
+			    EFX_MAC_FEC_CORRECTED_SYMBOLS_LANE3 },
 		};
 		if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
 		    ef10_fec, EFX_ARRAY_SIZE(ef10_fec))) != 0)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] net/sfc/base: generate Medford2 RxDP stats
  2018-05-03 14:41 [PATCH 0/4] net/sfc/base: add new stats Andrew Rybchenko
  2018-05-03 14:41 ` [PATCH 1/4] net/sfc/base: fix Medford2 FEC stats range Andrew Rybchenko
@ 2018-05-03 14:41 ` Andrew Rybchenko
  2018-05-03 14:41 ` [PATCH 3/4] net/sfc/base: support RxDP scatter disabled truncate counter Andrew Rybchenko
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2018-05-03 14:41 UTC (permalink / raw)
  To: dev

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/base/efx.h     | 5 ++++-
 drivers/net/sfc/base/efx_mac.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 332c6d06f..7f4e59e99 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -336,7 +336,7 @@ efx_intr_fini(
 
 #if EFSYS_OPT_MAC_STATS
 
-/* START MKCONFIG GENERATED EfxHeaderMacBlock 7d59c0d68431a5d1 */
+/* START MKCONFIG GENERATED EfxHeaderMacBlock ea466a9bc8789994 */
 typedef enum efx_mac_stat_e {
 	EFX_MAC_RX_OCTETS,
 	EFX_MAC_RX_PKTS,
@@ -441,6 +441,9 @@ typedef enum efx_mac_stat_e {
 	EFX_MAC_CTPIO_FALLBACK,
 	EFX_MAC_CTPIO_POISON,
 	EFX_MAC_CTPIO_ERASE,
+	EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC,
+	EFX_MAC_RXDP_HLB_IDLE,
+	EFX_MAC_RXDP_HLB_TIMEOUT,
 	EFX_MAC_NSTATS
 } efx_mac_stat_t;
 
diff --git a/drivers/net/sfc/base/efx_mac.c b/drivers/net/sfc/base/efx_mac.c
index e4a43d9e2..57436b95a 100644
--- a/drivers/net/sfc/base/efx_mac.c
+++ b/drivers/net/sfc/base/efx_mac.c
@@ -492,7 +492,7 @@ efx_mac_filter_default_rxq_clear(
 
 #if EFSYS_OPT_NAMES
 
-/* START MKCONFIG GENERATED EfxMacStatNamesBlock 3cfa8780abd28993 */
+/* START MKCONFIG GENERATED EfxMacStatNamesBlock 1a45a82fcfb30c1b */
 static const char * const __efx_mac_stat_name[] = {
 	"rx_octets",
 	"rx_pkts",
@@ -597,6 +597,9 @@ static const char * const __efx_mac_stat_name[] = {
 	"ctpio_fallback",
 	"ctpio_poison",
 	"ctpio_erase",
+	"rxdp_scatter_disabled_trunc",
+	"rxdp_hlb_idle",
+	"rxdp_hlb_timeout",
 };
 /* END MKCONFIG GENERATED EfxMacStatNamesBlock */
 
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] net/sfc/base: support RxDP scatter disabled truncate counter
  2018-05-03 14:41 [PATCH 0/4] net/sfc/base: add new stats Andrew Rybchenko
  2018-05-03 14:41 ` [PATCH 1/4] net/sfc/base: fix Medford2 FEC stats range Andrew Rybchenko
  2018-05-03 14:41 ` [PATCH 2/4] net/sfc/base: generate Medford2 RxDP stats Andrew Rybchenko
@ 2018-05-03 14:41 ` Andrew Rybchenko
  2018-05-03 14:41 ` [PATCH 4/4] net/sfc/base: add Medford2 head-of-line blocking stats Andrew Rybchenko
  2018-05-09  9:48 ` [PATCH 0/4] net/sfc/base: add new stats Ferruh Yigit
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2018-05-03 14:41 UTC (permalink / raw)
  To: dev

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/base/ef10_mac.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/net/sfc/base/ef10_mac.c b/drivers/net/sfc/base/ef10_mac.c
index 3a62fd09c..e3adcac53 100644
--- a/drivers/net/sfc/base/ef10_mac.c
+++ b/drivers/net/sfc/base/ef10_mac.c
@@ -533,8 +533,21 @@ ef10_mac_stats_get_mask(
 			goto fail7;
 	}
 
+	if (encp->enc_mac_stats_nstats >= MC_CMD_MAC_NSTATS_V4) {
+		const struct efx_mac_stats_range ef10_rxdp_sdt[] = {
+			{ EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC,
+			    EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC },
+		};
+
+		if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+		    ef10_rxdp_sdt, EFX_ARRAY_SIZE(ef10_rxdp_sdt))) != 0)
+			goto fail8;
+	}
+
 	return (0);
 
+fail8:
+	EFSYS_PROBE(fail8);
 fail7:
 	EFSYS_PROBE(fail7);
 fail6:
@@ -978,6 +991,14 @@ ef10_mac_stats_update(
 	EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_ERASE, &value);
 	EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_ERASE]), &value);
 
+	if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS_V4)
+		goto done;
+
+	EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_SCATTER_DISABLED_TRUNC,
+	    &value);
+	EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC]),
+	    &value);
+
 done:
 	/* Read START generation counter */
 	EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp));
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] net/sfc/base: add Medford2 head-of-line blocking stats
  2018-05-03 14:41 [PATCH 0/4] net/sfc/base: add new stats Andrew Rybchenko
                   ` (2 preceding siblings ...)
  2018-05-03 14:41 ` [PATCH 3/4] net/sfc/base: support RxDP scatter disabled truncate counter Andrew Rybchenko
@ 2018-05-03 14:41 ` Andrew Rybchenko
  2018-05-09  9:48 ` [PATCH 0/4] net/sfc/base: add new stats Ferruh Yigit
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2018-05-03 14:41 UTC (permalink / raw)
  To: dev

These stats are availble on Medford2 DPDK firmware variant
which support equal stride super-buffer Rx mode. RXDP_HLB_IDLE
capability bit is set when the stats are available.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/base/ef10_mac.c | 18 ++++++++++++++++++
 drivers/net/sfc/base/ef10_nic.c |  6 ++++++
 drivers/net/sfc/base/efx.h      |  1 +
 3 files changed, 25 insertions(+)

diff --git a/drivers/net/sfc/base/ef10_mac.c b/drivers/net/sfc/base/ef10_mac.c
index e3adcac53..1031e8369 100644
--- a/drivers/net/sfc/base/ef10_mac.c
+++ b/drivers/net/sfc/base/ef10_mac.c
@@ -544,8 +544,19 @@ ef10_mac_stats_get_mask(
 			goto fail8;
 	}
 
+	if (encp->enc_hlb_counters) {
+		const struct efx_mac_stats_range ef10_hlb[] = {
+			{ EFX_MAC_RXDP_HLB_IDLE, EFX_MAC_RXDP_HLB_TIMEOUT },
+		};
+		if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+		    ef10_hlb, EFX_ARRAY_SIZE(ef10_hlb))) != 0)
+			goto fail9;
+	}
+
 	return (0);
 
+fail9:
+	EFSYS_PROBE(fail9);
 fail8:
 	EFSYS_PROBE(fail8);
 fail7:
@@ -999,6 +1010,13 @@ ef10_mac_stats_update(
 	EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC]),
 	    &value);
 
+	/* Head-of-line blocking */
+	EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_IDLE, &value);
+	EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_IDLE]), &value);
+
+	EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_TIMEOUT, &value);
+	EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_TIMEOUT]), &value);
+
 done:
 	/* Read START generation counter */
 	EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp));
diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c
index 44286dbf3..7dbf843bf 100644
--- a/drivers/net/sfc/base/ef10_nic.c
+++ b/drivers/net/sfc/base/ef10_nic.c
@@ -1245,6 +1245,12 @@ ef10_get_datapath_caps(
 	else
 		encp->enc_fec_counters = B_FALSE;
 
+	/* Check if the firmware provides head-of-line blocking counters */
+	if (CAP_FLAGS2(req, RXDP_HLB_IDLE))
+		encp->enc_hlb_counters = B_TRUE;
+	else
+		encp->enc_hlb_counters = B_FALSE;
+
 	if (CAP_FLAGS1(req, RX_RSS_LIMITED)) {
 		/* Only one exclusive RSS context is available per port. */
 		encp->enc_rx_scale_max_exclusive_contexts = 1;
diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 7f4e59e99..5108b9b1f 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -1296,6 +1296,7 @@ typedef struct efx_nic_cfg_s {
 	/* Firmware support for extended MAC_STATS buffer */
 	uint32_t		enc_mac_stats_nstats;
 	boolean_t		enc_fec_counters;
+	boolean_t		enc_hlb_counters;
 	/* Firmware support for "FLAG" and "MARK" filter actions */
 	boolean_t		enc_filter_action_flag_supported;
 	boolean_t		enc_filter_action_mark_supported;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] net/sfc/base: add new stats
  2018-05-03 14:41 [PATCH 0/4] net/sfc/base: add new stats Andrew Rybchenko
                   ` (3 preceding siblings ...)
  2018-05-03 14:41 ` [PATCH 4/4] net/sfc/base: add Medford2 head-of-line blocking stats Andrew Rybchenko
@ 2018-05-09  9:48 ` Ferruh Yigit
  4 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-05-09  9:48 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

On 5/3/2018 3:41 PM, Andrew Rybchenko wrote:
> Update net/sfc base driver to provide a new stats available on
> XtremeScale X2 (aka Medford2) NICs. No new code is required in
> net/sfc PMD.
> 
> HLB_IDLE and HLB_TIMEOUT stats are useful for packet drops and
> performance investigations.
> 
> There are few checkpatches.sh warnings due to coding style difference
> in base driver.
> 
> Andrew Rybchenko (4):
>   net/sfc/base: fix Medford2 FEC stats range
>   net/sfc/base: generate Medford2 RxDP stats
>   net/sfc/base: support RxDP scatter disabled truncate counter
>   net/sfc/base: add Medford2 head-of-line blocking stats

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-09  9:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 14:41 [PATCH 0/4] net/sfc/base: add new stats Andrew Rybchenko
2018-05-03 14:41 ` [PATCH 1/4] net/sfc/base: fix Medford2 FEC stats range Andrew Rybchenko
2018-05-03 14:41 ` [PATCH 2/4] net/sfc/base: generate Medford2 RxDP stats Andrew Rybchenko
2018-05-03 14:41 ` [PATCH 3/4] net/sfc/base: support RxDP scatter disabled truncate counter Andrew Rybchenko
2018-05-03 14:41 ` [PATCH 4/4] net/sfc/base: add Medford2 head-of-line blocking stats Andrew Rybchenko
2018-05-09  9:48 ` [PATCH 0/4] net/sfc/base: add new stats Ferruh Yigit

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.