DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Andy Moreton <amoreton@solarflare.com>
Subject: [dpdk-dev] [PATCH 23/80] net/sfc/base: support runtime VI window size
Date: Tue, 20 Feb 2018 07:33:41 +0000	[thread overview]
Message-ID: <1519112078-20113-24-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1519112078-20113-1-git-send-email-arybchenko@solarflare.com>

From: Andy Moreton <amoreton@solarflare.com>

Medford2 uses a configurable VI window size, and requires
updates to register accesses to use a runtime VI window size
rather than the *_STEP register constants used for earlier
controllers.

Update the common code to query the VI window size via MCDI,
and add new EFX_BAR_VI_* accessor macros for per-VI registers.

The existing EFX_BAR_TBL_* macros can be used for non-VI
register tables (and for code that can never be called for
a Medford2 controller e.g. Siena-only code).

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_ev.c      | 10 ++---
 drivers/net/sfc/base/ef10_impl.h    |  5 +++
 drivers/net/sfc/base/ef10_nic.c     | 78 ++++++++++++++++++++++++++++++++--
 drivers/net/sfc/base/ef10_rx.c      |  6 +--
 drivers/net/sfc/base/ef10_tx.c      |  8 ++--
 drivers/net/sfc/base/efx.h          |  8 ++++
 drivers/net/sfc/base/efx_impl.h     | 83 ++++++++++++++++++++++++++++---------
 drivers/net/sfc/base/hunt_nic.c     | 11 +++++
 drivers/net/sfc/base/medford2_nic.c |  9 ++++
 drivers/net/sfc/base/medford_nic.c  | 11 +++++
 drivers/net/sfc/base/siena_nic.c    |  4 ++
 11 files changed, 199 insertions(+), 34 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_ev.c b/drivers/net/sfc/base/ef10_ev.c
index a05a35a..36ff2cb 100644
--- a/drivers/net/sfc/base/ef10_ev.c
+++ b/drivers/net/sfc/base/ef10_ev.c
@@ -577,7 +577,7 @@ ef10_ev_qprime(
 		    EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH,
 		    ERF_DD_EVQ_IND_RPTR,
 		    (rptr >> ERF_DD_EVQ_IND_RPTR_WIDTH));
-		EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index,
+		EFX_BAR_VI_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index,
 		    &dword, B_FALSE);
 
 		EFX_POPULATE_DWORD_2(dword,
@@ -585,11 +585,11 @@ ef10_ev_qprime(
 		    EFE_DD_EVQ_IND_RPTR_FLAGS_LOW,
 		    ERF_DD_EVQ_IND_RPTR,
 		    rptr & ((1 << ERF_DD_EVQ_IND_RPTR_WIDTH) - 1));
-		EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index,
+		EFX_BAR_VI_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index,
 		    &dword, B_FALSE);
 	} else {
 		EFX_POPULATE_DWORD_1(dword, ERF_DZ_EVQ_RPTR, rptr);
-		EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_RPTR_REG, eep->ee_index,
+		EFX_BAR_VI_WRITED(enp, ER_DZ_EVQ_RPTR_REG, eep->ee_index,
 		    &dword, B_FALSE);
 	}
 
@@ -702,13 +702,13 @@ ef10_ev_qmoderate(
 			    EFE_DD_EVQ_IND_TIMER_FLAGS,
 			    ERF_DD_EVQ_IND_TIMER_MODE, mode,
 			    ERF_DD_EVQ_IND_TIMER_VAL, ticks);
-			EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT,
+			EFX_BAR_VI_WRITED(enp, ER_DD_EVQ_INDIRECT,
 			    eep->ee_index, &dword, 0);
 		} else {
 			EFX_POPULATE_DWORD_2(dword,
 			    ERF_DZ_TC_TIMER_MODE, mode,
 			    ERF_DZ_TC_TIMER_VAL, ticks);
-			EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG,
+			EFX_BAR_VI_WRITED(enp, ER_DZ_EVQ_TMR_REG,
 			    eep->ee_index, &dword, 0);
 		}
 	}
diff --git a/drivers/net/sfc/base/ef10_impl.h b/drivers/net/sfc/base/ef10_impl.h
index e004d15..08e2f9f 100644
--- a/drivers/net/sfc/base/ef10_impl.h
+++ b/drivers/net/sfc/base/ef10_impl.h
@@ -1160,6 +1160,11 @@ extern	__checkReturn	efx_rc_t
 ef10_get_datapath_caps(
 	__in		efx_nic_t *enp);
 
+extern	__checkReturn	efx_rc_t
+ef10_get_vi_window_shift(
+	__in		efx_nic_t *enp,
+	__out		uint32_t *vi_window_shiftp);
+
 extern	__checkReturn		efx_rc_t
 ef10_get_privilege_mask(
 	__in			efx_nic_t *enp,
diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c
index 8b9ef15..a48f2ac 100644
--- a/drivers/net/sfc/base/ef10_nic.c
+++ b/drivers/net/sfc/base/ef10_nic.c
@@ -1143,6 +1143,71 @@ ef10_get_datapath_caps(
 	return (rc);
 }
 
+	__checkReturn	efx_rc_t
+ef10_get_vi_window_shift(
+	__in		efx_nic_t *enp,
+	__out		uint32_t *vi_window_shiftp)
+{
+	efx_mcdi_req_t req;
+	uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN,
+			    MC_CMD_GET_CAPABILITIES_V3_OUT_LEN)];
+	uint32_t mode;
+	efx_rc_t rc;
+
+	(void) memset(payload, 0, sizeof (payload));
+	req.emr_cmd = MC_CMD_GET_CAPABILITIES;
+	req.emr_in_buf = payload;
+	req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN;
+	req.emr_out_buf = payload;
+	req.emr_out_length = MC_CMD_GET_CAPABILITIES_V3_OUT_LEN;
+
+	efx_mcdi_execute_quiet(enp, &req);
+
+	if (req.emr_rc != 0) {
+		rc = req.emr_rc;
+		goto fail1;
+	}
+
+	if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V3_OUT_LEN) {
+		rc = EMSGSIZE;
+		goto fail2;
+	}
+	mode = MCDI_OUT_BYTE(req, GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE);
+
+	switch (mode) {
+	case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_8K:
+		EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K == 8 * 1024);
+		*vi_window_shiftp = EFX_VI_WINDOW_SHIFT_8K;
+		break;
+
+	case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_16K:
+		EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_16K == 16 * 1024);
+		*vi_window_shiftp = EFX_VI_WINDOW_SHIFT_16K;
+		break;
+
+	case MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_64K:
+		EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_64K == 64 * 1024);
+		*vi_window_shiftp = EFX_VI_WINDOW_SHIFT_64K;
+		break;
+
+	default:
+		*vi_window_shiftp = EFX_VI_WINDOW_SHIFT_INVALID;
+		rc = EINVAL;
+		goto fail3;
+	}
+
+	return (0);
+
+fail3:
+	EFSYS_PROBE(fail3);
+fail2:
+	EFSYS_PROBE(fail2);
+fail1:
+	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+	return (rc);
+}
+
 
 #define	EF10_LEGACY_PF_PRIVILEGE_MASK					\
 	(MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN			|	\
@@ -1559,6 +1624,7 @@ ef10_nic_init(
 	uint32_t i;
 	uint32_t retry;
 	uint32_t delay_us;
+	uint32_t vi_window_size;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
@@ -1621,15 +1687,21 @@ ef10_nic_init(
 	enp->en_arch.ef10.ena_pio_write_vi_base =
 	    vi_count - enp->en_arch.ef10.ena_piobuf_count;
 
+	EFSYS_ASSERT3U(enp->en_nic_cfg.enc_vi_window_shift, !=,
+	    EFX_VI_WINDOW_SHIFT_INVALID);
+	EFSYS_ASSERT3U(enp->en_nic_cfg.enc_vi_window_shift, <=,
+	    EFX_VI_WINDOW_SHIFT_64K);
+	vi_window_size = 1U << enp->en_nic_cfg.enc_vi_window_shift;
+
 	/* Save UC memory mapping details */
 	enp->en_arch.ef10.ena_uc_mem_map_offset = 0;
 	if (enp->en_arch.ef10.ena_piobuf_count > 0) {
 		enp->en_arch.ef10.ena_uc_mem_map_size =
-		    (ER_DZ_TX_PIOBUF_STEP *
+		    (vi_window_size *
 		    enp->en_arch.ef10.ena_pio_write_vi_base);
 	} else {
 		enp->en_arch.ef10.ena_uc_mem_map_size =
-		    (ER_DZ_TX_PIOBUF_STEP *
+		    (vi_window_size *
 		    enp->en_arch.ef10.ena_vi_count);
 	}
 
@@ -1639,7 +1711,7 @@ ef10_nic_init(
 	    enp->en_arch.ef10.ena_uc_mem_map_size;
 
 	enp->en_arch.ef10.ena_wc_mem_map_size =
-	    (ER_DZ_TX_PIOBUF_STEP *
+	    (vi_window_size *
 	    enp->en_arch.ef10.ena_piobuf_count);
 
 	/* Link piobufs to extra VIs in WC mapping */
diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/net/sfc/base/ef10_rx.c
index ea3df21..79f2587 100644
--- a/drivers/net/sfc/base/ef10_rx.c
+++ b/drivers/net/sfc/base/ef10_rx.c
@@ -795,8 +795,8 @@ ef10_rx_qpush(
 	EFX_DMA_SYNC_QUEUE_FOR_DEVICE(erp->er_esmp, erp->er_mask + 1,
 	    wptr, pushed & erp->er_mask);
 	EFSYS_PIO_WRITE_BARRIER();
-	EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG,
-			    erp->er_index, &dword, B_FALSE);
+	EFX_BAR_VI_WRITED(enp, ER_DZ_RX_DESC_UPD_REG,
+	    erp->er_index, &dword, B_FALSE);
 }
 
 #if EFSYS_OPT_RX_PACKED_STREAM
@@ -827,7 +827,7 @@ ef10_rx_qpush_ps_credits(
 	    ERF_DZ_RX_DESC_MAGIC_CMD,
 	    ERE_DZ_RX_DESC_MAGIC_CMD_PS_CREDITS,
 	    ERF_DZ_RX_DESC_MAGIC_DATA, credits);
-	EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG,
+	EFX_BAR_VI_WRITED(enp, ER_DZ_RX_DESC_UPD_REG,
 	    erp->er_index, &dword, B_FALSE);
 
 	rxq_state->eers_rx_packed_stream_credits = 0;
diff --git a/drivers/net/sfc/base/ef10_tx.c b/drivers/net/sfc/base/ef10_tx.c
index ab11749..18877d4 100644
--- a/drivers/net/sfc/base/ef10_tx.c
+++ b/drivers/net/sfc/base/ef10_tx.c
@@ -511,8 +511,8 @@ ef10_tx_qpush(
 		EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1,
 					    wptr, id);
 		EFSYS_PIO_WRITE_BARRIER();
-		EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG,
-					    etp->et_index, &oword);
+		EFX_BAR_VI_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG,
+		    etp->et_index, &oword);
 	} else {
 		efx_dword_t dword;
 
@@ -527,8 +527,8 @@ ef10_tx_qpush(
 		EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1,
 					    wptr, id);
 		EFSYS_PIO_WRITE_BARRIER();
-		EFX_BAR_TBL_WRITED2(enp, ER_DZ_TX_DESC_UPD_REG,
-				    etp->et_index, &dword, B_FALSE);
+		EFX_BAR_VI_WRITED2(enp, ER_DZ_TX_DESC_UPD_REG,
+		    etp->et_index, &dword, B_FALSE);
 	}
 }
 
diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 5135673..c0ba5e9 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -1087,6 +1087,13 @@ typedef enum efx_tunnel_protocol_e {
 	EFX_TUNNEL_NPROTOS
 } efx_tunnel_protocol_t;
 
+typedef enum efx_vi_window_shift_e {
+	EFX_VI_WINDOW_SHIFT_INVALID = 0,
+	EFX_VI_WINDOW_SHIFT_8K = 13,
+	EFX_VI_WINDOW_SHIFT_16K = 14,
+	EFX_VI_WINDOW_SHIFT_64K = 16,
+} efx_vi_window_shift_t;
+
 typedef struct efx_nic_cfg_s {
 	uint32_t		enc_board_type;
 	uint32_t		enc_phy_type;
@@ -1100,6 +1107,7 @@ typedef struct efx_nic_cfg_s {
 	uint32_t		enc_mon_stat_mask[(EFX_MON_NSTATS + 31) / 32];
 #endif
 	unsigned int		enc_features;
+	efx_vi_window_shift_t	enc_vi_window_shift;
 	uint8_t			enc_mac_addr[6];
 	uint8_t			enc_port;	/* PHY port number */
 	uint32_t		enc_intr_vec_base;
diff --git a/drivers/net/sfc/base/efx_impl.h b/drivers/net/sfc/base/efx_impl.h
index 76214fb..e202b10 100644
--- a/drivers/net/sfc/base/efx_impl.h
+++ b/drivers/net/sfc/base/efx_impl.h
@@ -924,6 +924,15 @@ struct efx_txq_s {
 	_NOTE(CONSTANTCONDITION)					\
 	} while (B_FALSE)
 
+/*
+ * Accessors for memory BAR non-VI tables.
+ *
+ * Code used on EF10 *must* use EFX_BAR_VI_*() macros for per-VI registers,
+ * to ensure the correct runtime VI window size is used on Medford2.
+ *
+ * Siena-only code may continue using EFX_BAR_TBL_*() macros for VI registers.
+ */
+
 #define	EFX_BAR_TBL_READD(_enp, _reg, _index, _edp, _lock)		\
 	do {								\
 		EFX_CHECK_REG((_enp), (_reg));				\
@@ -950,21 +959,6 @@ struct efx_txq_s {
 	_NOTE(CONSTANTCONDITION)					\
 	} while (B_FALSE)
 
-#define	EFX_BAR_TBL_WRITED2(_enp, _reg, _index, _edp, _lock)		\
-	do {								\
-		EFX_CHECK_REG((_enp), (_reg));				\
-		EFSYS_PROBE4(efx_bar_tbl_writed, const char *, #_reg,	\
-		    uint32_t, (_index),					\
-		    uint32_t, _reg ## _OFST,				\
-		    uint32_t, (_edp)->ed_u32[0]);			\
-		EFSYS_BAR_WRITED((_enp)->en_esbp,			\
-		    (_reg ## _OFST +					\
-		    (2 * sizeof (efx_dword_t)) +			\
-		    ((_index) * _reg ## _STEP)),			\
-		    (_edp), (_lock));					\
-	_NOTE(CONSTANTCONDITION)					\
-	} while (B_FALSE)
-
 #define	EFX_BAR_TBL_WRITED3(_enp, _reg, _index, _edp, _lock)		\
 	do {								\
 		EFX_CHECK_REG((_enp), (_reg));				\
@@ -1041,16 +1035,66 @@ struct efx_txq_s {
 	} while (B_FALSE)
 
 /*
- * Allow drivers to perform optimised 128-bit doorbell writes.
+ * Accessors for memory BAR per-VI registers.
+ *
+ * The VI window size is 8KB for Medford and all earlier controllers.
+ * For Medford2, the VI window size can be 8KB, 16KB or 64KB.
+ */
+
+#define	EFX_BAR_VI_READD(_enp, _reg, _index, _edp, _lock)		\
+	do {								\
+		EFX_CHECK_REG((_enp), (_reg));				\
+		EFSYS_BAR_READD((_enp)->en_esbp,			\
+		    ((_reg ## _OFST) +					\
+		    ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \
+		    (_edp), (_lock));					\
+		EFSYS_PROBE4(efx_bar_vi_readd, const char *, #_reg,	\
+		    uint32_t, (_index),					\
+		    uint32_t, _reg ## _OFST,				\
+		    uint32_t, (_edp)->ed_u32[0]);			\
+	_NOTE(CONSTANTCONDITION)					\
+	} while (B_FALSE)
+
+#define	EFX_BAR_VI_WRITED(_enp, _reg, _index, _edp, _lock)		\
+	do {								\
+		EFX_CHECK_REG((_enp), (_reg));				\
+		EFSYS_PROBE4(efx_bar_vi_writed, const char *, #_reg,	\
+		    uint32_t, (_index),					\
+		    uint32_t, _reg ## _OFST,				\
+		    uint32_t, (_edp)->ed_u32[0]);			\
+		EFSYS_BAR_WRITED((_enp)->en_esbp,			\
+		    ((_reg ## _OFST) +					\
+		    ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \
+		    (_edp), (_lock));					\
+	_NOTE(CONSTANTCONDITION)					\
+	} while (B_FALSE)
+
+#define	EFX_BAR_VI_WRITED2(_enp, _reg, _index, _edp, _lock)		\
+	do {								\
+		EFX_CHECK_REG((_enp), (_reg));				\
+		EFSYS_PROBE4(efx_bar_vi_writed, const char *, #_reg,	\
+		    uint32_t, (_index),					\
+		    uint32_t, _reg ## _OFST,				\
+		    uint32_t, (_edp)->ed_u32[0]);			\
+		EFSYS_BAR_WRITED((_enp)->en_esbp,			\
+		    ((_reg ## _OFST) +					\
+		    (2 * sizeof (efx_dword_t)) +			\
+		    ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \
+		    (_edp), (_lock));					\
+	_NOTE(CONSTANTCONDITION)					\
+	} while (B_FALSE)
+
+/*
+ * Allow drivers to perform optimised 128-bit VI doorbell writes.
  * The DMA descriptor pointers (RX_DESC_UPD and TX_DESC_UPD) are
  * special-cased in the BIU on the Falcon/Siena and EF10 architectures to avoid
  * the need for locking in the host, and are the only ones known to be safe to
  * use 128-bites write with.
  */
-#define	EFX_BAR_TBL_DOORBELL_WRITEO(_enp, _reg, _index, _eop)		\
+#define	EFX_BAR_VI_DOORBELL_WRITEO(_enp, _reg, _index, _eop)		\
 	do {								\
 		EFX_CHECK_REG((_enp), (_reg));				\
-		EFSYS_PROBE7(efx_bar_tbl_doorbell_writeo,		\
+		EFSYS_PROBE7(efx_bar_vi_doorbell_writeo,		\
 		    const char *, #_reg,				\
 		    uint32_t, (_index),					\
 		    uint32_t, _reg ## _OFST,				\
@@ -1059,7 +1103,8 @@ struct efx_txq_s {
 		    uint32_t, (_eop)->eo_u32[1],			\
 		    uint32_t, (_eop)->eo_u32[0]);			\
 		EFSYS_BAR_DOORBELL_WRITEO((_enp)->en_esbp,		\
-		    (_reg ## _OFST + ((_index) * _reg ## _STEP)),	\
+		    (_reg ## _OFST +					\
+		    ((_index) << (_enp)->en_nic_cfg.enc_vi_window_shift)), \
 		    (_eop));						\
 	_NOTE(CONSTANTCONDITION)					\
 	} while (B_FALSE)
diff --git a/drivers/net/sfc/base/hunt_nic.c b/drivers/net/sfc/base/hunt_nic.c
index fb39850..903c669 100644
--- a/drivers/net/sfc/base/hunt_nic.c
+++ b/drivers/net/sfc/base/hunt_nic.c
@@ -92,6 +92,17 @@ hunt_board_cfg(
 	uint32_t bandwidth;
 	efx_rc_t rc;
 
+	/* Huntington has a fixed 8Kbyte VI window size */
+	EFX_STATIC_ASSERT(ER_DZ_EVQ_RPTR_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_EVQ_TMR_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_RX_DESC_UPD_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_TX_DESC_UPD_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_TX_PIOBUF_STEP		== 8192);
+
+	EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K	== 8192);
+	encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K;
+
+
 	if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0)
 		goto fail1;
 
diff --git a/drivers/net/sfc/base/medford2_nic.c b/drivers/net/sfc/base/medford2_nic.c
index 4faf786..327fcaa 100644
--- a/drivers/net/sfc/base/medford2_nic.c
+++ b/drivers/net/sfc/base/medford2_nic.c
@@ -62,6 +62,7 @@ medford2_board_cfg(
 	uint32_t base, nvec;
 	uint32_t end_padding;
 	uint32_t bandwidth;
+	uint32_t vi_window_shift;
 	efx_rc_t rc;
 
 	/*
@@ -69,6 +70,14 @@ medford2_board_cfg(
 	 * Parts of this should be shared with Huntington.
 	 */
 
+	/* Medford2 has a variable VI window size (8K, 16K or 64K) */
+	if ((rc = ef10_get_vi_window_shift(enp, &vi_window_shift)) != 0)
+		goto fail1;
+
+	EFSYS_ASSERT3U(vi_window_shift, <=, EFX_VI_WINDOW_SHIFT_64K);
+	encp->enc_vi_window_shift = vi_window_shift;
+
+
 	if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0)
 		goto fail1;
 
diff --git a/drivers/net/sfc/base/medford_nic.c b/drivers/net/sfc/base/medford_nic.c
index 9a92153..9b8da99 100644
--- a/drivers/net/sfc/base/medford_nic.c
+++ b/drivers/net/sfc/base/medford_nic.c
@@ -67,6 +67,17 @@ medford_board_cfg(
 	 * Parts of this should be shared with Huntington.
 	 */
 
+	/* Medford has a fixed 8Kbyte VI window size */
+	EFX_STATIC_ASSERT(ER_DZ_EVQ_RPTR_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_EVQ_TMR_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_RX_DESC_UPD_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_TX_DESC_UPD_REG_STEP	== 8192);
+	EFX_STATIC_ASSERT(ER_DZ_TX_PIOBUF_STEP		== 8192);
+
+	EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K	== 8192);
+	encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K;
+
+
 	if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0)
 		goto fail1;
 
diff --git a/drivers/net/sfc/base/siena_nic.c b/drivers/net/sfc/base/siena_nic.c
index f223c9b..c051c59 100644
--- a/drivers/net/sfc/base/siena_nic.c
+++ b/drivers/net/sfc/base/siena_nic.c
@@ -66,6 +66,10 @@ siena_board_cfg(
 	uint32_t nevq, nrxq, ntxq;
 	efx_rc_t rc;
 
+	/* Siena has a fixed 8Kbyte VI window size */
+	EFX_STATIC_ASSERT(1U << EFX_VI_WINDOW_SHIFT_8K	== 8192);
+	encp->enc_vi_window_shift = EFX_VI_WINDOW_SHIFT_8K;
+
 	/* External port identifier using one-based port numbering */
 	encp->enc_external_port = (uint8_t)enp->en_mcdi.em_emip.emi_port;
 
-- 
2.7.4

  parent reply	other threads:[~2018-02-20  7:35 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20  7:33 [dpdk-dev] [PATCH 00/80] net/sfc/base: update base driver Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 01/80] net/sfc: add missing defines for SAL annotation Andrew Rybchenko
2018-03-05 20:47   ` Ferruh Yigit
2018-02-20  7:33 ` [dpdk-dev] [PATCH 02/80] net/sfc/base: regenerate files with genfwdef after ID update Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 03/80] net/sfc/base: update autogenerated headers from firmwaresrc Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 04/80] net/sfc/base: add 3.3V and 12.0V current sensors Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 05/80] net/sfc/base: add Medford2 PCI IDs Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 06/80] net/sfc/base: add efsys option for Medford2 Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 07/80] net/sfc/base: add Medford2 support to NIC module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 08/80] net/sfc/base: correct PIO buffer dimensions for Medford2 Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 09/80] net/sfc/base: move RxDP config get to EF10 NIC code Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 10/80] net/sfc/base: add Medford2 support to EV module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 11/80] net/sfc/base: add Medford2 support to FILTER module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 12/80] net/sfc/base: add Medford2 support to INTR module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 13/80] net/sfc/base: add Medford2 support to MAC module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 14/80] net/sfc/base: add Medford2 support to MCDI module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 15/80] net/sfc/base: add Medford2 support to PHY module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 16/80] net/sfc/base: add Medford2 support to Rx module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 17/80] net/sfc/base: add Medford2 support to Tx module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 18/80] net/sfc/base: add Medford2 support to NVRAM module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 19/80] net/sfc/base: add Medford2 support to SRAM module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 20/80] net/sfc/base: add Medford2 support to BOOTCFG module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 21/80] net/sfc/base: add Medford2 support to VPD module Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 22/80] net/sfc/base: add Medford2 support to MON module Andrew Rybchenko
2018-02-20  7:33 ` Andrew Rybchenko [this message]
2018-02-20  7:33 ` [dpdk-dev] [PATCH 24/80] net/sfc/base: improve comments for EF10 ext port mapping Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 25/80] net/sfc/base: add method to make checksum option descriptors Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 26/80] net/sfc/base: update hardware headers for Medford2 Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 27/80] net/sfc/base: refactoring eliminating code analysis warnings Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 28/80] net/sfc/base: fix too long line Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 29/80] net/sfc/base: update notes on interrupt testing on VFs Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 30/80] net/sfc/base: report memory BAR number Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 31/80] net/sfc/base: simplify loopback type checking Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 32/80] net/sfc/base: add support new link modes Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 33/80] net/sfc/base: add new loopback modes Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 34/80] net/sfc/base: add efsys macro to get memory region size Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 35/80] net/sfc/base: handle new speeds in linkchange events Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 36/80] net/sfc/base: refactor EF10 get datapath capabilities Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 37/80] net/sfc/base: retrieve number of MAC stats from NIC Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 38/80] net/sfc/base: improve robustness of MAC stats get via MCDI Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 39/80] net/sfc/base: use MAC stats DMA buffer size from caps Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 40/80] net/sfc/base: use MAC stats DMA buffer size when decoding Andrew Rybchenko
2018-02-20  7:33 ` [dpdk-dev] [PATCH 41/80] net/sfc/base: run mkconfig.py to add FEC MAC stats Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 42/80] net/sfc/base: decode Medford2 FEC stats if available Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 43/80] net/sfc/base: resolve code analysis warnings Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 44/80] net/sfc: size MAC stats DMA buffer to support Medford2 Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 45/80] net/sfc/base: remove MAC stats size define Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 46/80] net/sfc/base: use correct name for frame truncation event Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 47/80] net/sfc/base: add ef10 NIC board config method Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 48/80] net/sfc/base: move port config to ef10 NIC board config Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 49/80] net/sfc/base: move PF/VF " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 50/80] net/sfc/base: move MAC address config to ef10 NIC board cfg Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 51/80] net/sfc/base: move legacy board " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 52/80] net/sfc/base: move PHY/link " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 53/80] net/sfc/base: move datapath " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 54/80] net/sfc/base: move Rx config to ef10 NIC board config Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 55/80] net/sfc/base: move Tx " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 56/80] net/sfc/base: move limits " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 57/80] net/sfc/base: move vector " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 58/80] net/sfc/base: move privilege " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 59/80] net/sfc/base: move VI window size config to ef10 NIC board Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 60/80] net/sfc/base: remove obsolete comments Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 61/80] net/sfc/base: support FEC mode settings Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 62/80] net/sfc/base: support Medford2 event timer semantics Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 63/80] net/sfc/base: clarify port mode names and masks Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 64/80] net/sfc/base: group Medford external port mapping entries Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 65/80] net/sfc/base: add Medford2 support for external port numbers Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 66/80] net/sfc/base: add Medford2 support for licencing Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 67/80] net/sfc/base: add Medford2 support for tunnel encapsulations Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 68/80] net/sfc/base: provide a flag for controlling CTPIO mode Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 69/80] net/sfc/base: add 1.3V voltage and current sensors Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 70/80] net/sfc/base: document the event type for CTPIO sends Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 71/80] net/sfc/base: run genfwdef to update headers Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 72/80] net/sfc/base: add CTPIO statistics Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 73/80] net/sfc/base: add bit to indicate CTPIO availability Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 74/80] net/sfc/base: regenerate headers to pick up CTPIO stats Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 75/80] net/sfc/base: support " Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 76/80] net/sfc/base: add encapsulated TSOv2 capability Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 77/80] net/sfc/base: add outer IP ID parameter to TSOv2 descriptor Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 78/80] net/sfc/base: add firmware image layout option Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 79/80] net/sfc/base: add signed image layout support Andrew Rybchenko
2018-02-20  7:34 ` [dpdk-dev] [PATCH 80/80] net/sfc/base: sync MCDI headers and TLV layout Andrew Rybchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1519112078-20113-24-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=amoreton@solarflare.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).