All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] net/sfc: support Medford2 family adapters
@ 2018-03-21 13:51 Andrew Rybchenko
  2018-03-21 13:51 ` [PATCH 1/3] net/sfc: support link speeds up to 100G Andrew Rybchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-03-21 13:51 UTC (permalink / raw)
  To: dev

dpdk-web patch will follow.

Andrew Rybchenko (3):
  net/sfc: support link speeds up to 100G
  net/sfc: support runtime VI window size
  net/sfc: support Medford2 family adapters

 doc/guides/nics/sfc_efx.rst            | 23 ++++++++++++++---------
 doc/guides/rel_notes/release_18_05.rst |  1 +
 drivers/net/sfc/efsys.h                |  4 ++--
 drivers/net/sfc/sfc.c                  | 11 ++++++++++-
 drivers/net/sfc/sfc_dp_rx.h            |  2 ++
 drivers/net/sfc/sfc_dp_tx.h            |  2 ++
 drivers/net/sfc/sfc_ef10_rx.c          |  2 +-
 drivers/net/sfc/sfc_ef10_tx.c          |  2 +-
 drivers/net/sfc/sfc_ethdev.c           |  9 +++++++++
 drivers/net/sfc/sfc_port.c             | 12 ++++++++++++
 drivers/net/sfc/sfc_rx.c               |  1 +
 drivers/net/sfc/sfc_tx.c               |  1 +
 12 files changed, 56 insertions(+), 14 deletions(-)

-- 
2.7.4

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

* [PATCH 1/3] net/sfc: support link speeds up to 100G
  2018-03-21 13:51 [PATCH 0/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
@ 2018-03-21 13:51 ` Andrew Rybchenko
  2018-03-21 13:51 ` [PATCH 2/3] net/sfc: support runtime VI window size Andrew Rybchenko
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-03-21 13:51 UTC (permalink / raw)
  To: dev

Add 25G, 50G and 100G.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/sfc.c        | 11 ++++++++++-
 drivers/net/sfc/sfc_ethdev.c |  6 ++++++
 drivers/net/sfc/sfc_port.c   | 12 ++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 7eb9305..30117ec 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -81,14 +81,23 @@ sfc_phy_cap_from_link_speeds(uint32_t speeds)
 			phy_caps |=
 				(1 << EFX_PHY_CAP_1000FDX) |
 				(1 << EFX_PHY_CAP_10000FDX) |
-				(1 << EFX_PHY_CAP_40000FDX);
+				(1 << EFX_PHY_CAP_25000FDX) |
+				(1 << EFX_PHY_CAP_40000FDX) |
+				(1 << EFX_PHY_CAP_50000FDX) |
+				(1 << EFX_PHY_CAP_100000FDX);
 	}
 	if (speeds & ETH_LINK_SPEED_1G)
 		phy_caps |= (1 << EFX_PHY_CAP_1000FDX);
 	if (speeds & ETH_LINK_SPEED_10G)
 		phy_caps |= (1 << EFX_PHY_CAP_10000FDX);
+	if (speeds & ETH_LINK_SPEED_25G)
+		phy_caps |= (1 << EFX_PHY_CAP_25000FDX);
 	if (speeds & ETH_LINK_SPEED_40G)
 		phy_caps |= (1 << EFX_PHY_CAP_40000FDX);
+	if (speeds & ETH_LINK_SPEED_50G)
+		phy_caps |= (1 << EFX_PHY_CAP_50000FDX);
+	if (speeds & ETH_LINK_SPEED_100G)
+		phy_caps |= (1 << EFX_PHY_CAP_100000FDX);
 
 	return phy_caps;
 }
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 7d51db9..e114d63 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -96,8 +96,14 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		dev_info->speed_capa |= ETH_LINK_SPEED_1G;
 	if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_10000FDX)
 		dev_info->speed_capa |= ETH_LINK_SPEED_10G;
+	if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_25000FDX)
+		dev_info->speed_capa |= ETH_LINK_SPEED_25G;
 	if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_40000FDX)
 		dev_info->speed_capa |= ETH_LINK_SPEED_40G;
+	if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_50000FDX)
+		dev_info->speed_capa |= ETH_LINK_SPEED_50G;
+	if (sa->port.phy_adv_cap_mask & EFX_PHY_CAP_100000FDX)
+		dev_info->speed_capa |= ETH_LINK_SPEED_100G;
 
 	dev_info->max_rx_queues = sa->rxq_max;
 	dev_info->max_tx_queues = sa->txq_max;
diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c
index 0272b55..fd267e1 100644
--- a/drivers/net/sfc/sfc_port.c
+++ b/drivers/net/sfc/sfc_port.c
@@ -474,10 +474,22 @@ sfc_port_link_mode_to_info(efx_link_mode_t link_mode,
 		link_info->link_speed  = ETH_SPEED_NUM_10G;
 		link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
 		break;
+	case EFX_LINK_25000FDX:
+		link_info->link_speed  = ETH_SPEED_NUM_25G;
+		link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
+		break;
 	case EFX_LINK_40000FDX:
 		link_info->link_speed  = ETH_SPEED_NUM_40G;
 		link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
 		break;
+	case EFX_LINK_50000FDX:
+		link_info->link_speed  = ETH_SPEED_NUM_50G;
+		link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
+		break;
+	case EFX_LINK_100000FDX:
+		link_info->link_speed  = ETH_SPEED_NUM_100G;
+		link_info->link_duplex = ETH_LINK_FULL_DUPLEX;
+		break;
 	default:
 		SFC_ASSERT(B_FALSE);
 		/* FALLTHROUGH */
-- 
2.7.4

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

* [PATCH 2/3] net/sfc: support runtime VI window size
  2018-03-21 13:51 [PATCH 0/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
  2018-03-21 13:51 ` [PATCH 1/3] net/sfc: support link speeds up to 100G Andrew Rybchenko
@ 2018-03-21 13:51 ` Andrew Rybchenko
  2018-03-21 13:51 ` [PATCH 3/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
  2018-03-30 10:33 ` [PATCH 0/3] " Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-03-21 13:51 UTC (permalink / raw)
  To: dev

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.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/sfc_dp_rx.h   | 2 ++
 drivers/net/sfc/sfc_dp_tx.h   | 2 ++
 drivers/net/sfc/sfc_ef10_rx.c | 2 +-
 drivers/net/sfc/sfc_ef10_tx.c | 2 +-
 drivers/net/sfc/sfc_rx.c      | 1 +
 drivers/net/sfc/sfc_tx.c      | 1 +
 6 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index be725dc..cc9e7c4 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -78,6 +78,8 @@ struct sfc_dp_rx_qcreate_info {
 	 * doorbell
 	 */
 	volatile void		*mem_bar;
+	/** VI window size shift */
+	unsigned int		vi_window_shift;
 };
 
 /**
diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index 0c1aad9..a075612 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -57,6 +57,8 @@ struct sfc_dp_tx_qcreate_info {
 	unsigned int		hw_index;
 	/** Virtual address of the memory-mapped BAR to push Tx doorbell */
 	volatile void		*mem_bar;
+	/** VI window size shift */
+	unsigned int		vi_window_shift;
 };
 
 /**
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f31a7e0..0c74926 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -726,7 +726,7 @@ sfc_ef10_rx_qcreate(uint16_t port_id, uint16_t queue_id,
 	rxq->rxq_hw_ring = info->rxq_hw_ring;
 	rxq->doorbell = (volatile uint8_t *)info->mem_bar +
 			ER_DZ_RX_DESC_UPD_REG_OFST +
-			info->hw_index * ER_DZ_RX_DESC_UPD_REG_STEP;
+			(info->hw_index << info->vi_window_shift);
 
 	*dp_rxqp = &rxq->dp;
 	return 0;
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index 1238797..d0daa3b 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -531,7 +531,7 @@ sfc_ef10_tx_qcreate(uint16_t port_id, uint16_t queue_id,
 	txq->txq_hw_ring = info->txq_hw_ring;
 	txq->doorbell = (volatile uint8_t *)info->mem_bar +
 			ER_DZ_TX_DESC_UPD_REG_OFST +
-			info->hw_index * ER_DZ_TX_DESC_UPD_REG_STEP;
+			(info->hw_index << info->vi_window_shift);
 	txq->evq_hw_ring = info->evq_hw_ring;
 
 	*dp_txqp = &txq->dp;
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index abc53fb..9e030e2 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1079,6 +1079,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
 	info.evq_hw_ring = evq->mem.esm_base;
 	info.hw_index = rxq->hw_index;
 	info.mem_bar = sa->mem_bar.esb_base;
+	info.vi_window_shift = encp->enc_vi_window_shift;
 
 	rc = sa->dp_rx->qcreate(sa->eth_dev->data->port_id, sw_index,
 				&RTE_ETH_DEV_TO_PCI(sa->eth_dev)->addr,
diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 757b03b..4dc1590 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -229,6 +229,7 @@ sfc_tx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
 	info.evq_hw_ring = evq->mem.esm_base;
 	info.hw_index = txq->hw_index;
 	info.mem_bar = sa->mem_bar.esb_base;
+	info.vi_window_shift = encp->enc_vi_window_shift;
 
 	rc = sa->dp_tx->qcreate(sa->eth_dev->data->port_id, sw_index,
 				&RTE_ETH_DEV_TO_PCI(sa->eth_dev)->addr,
-- 
2.7.4

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

* [PATCH 3/3] net/sfc: support Medford2 family adapters
  2018-03-21 13:51 [PATCH 0/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
  2018-03-21 13:51 ` [PATCH 1/3] net/sfc: support link speeds up to 100G Andrew Rybchenko
  2018-03-21 13:51 ` [PATCH 2/3] net/sfc: support runtime VI window size Andrew Rybchenko
@ 2018-03-21 13:51 ` Andrew Rybchenko
  2018-03-30 10:33 ` [PATCH 0/3] " Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-03-21 13:51 UTC (permalink / raw)
  To: dev

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 doc/guides/nics/sfc_efx.rst            | 23 ++++++++++++++---------
 doc/guides/rel_notes/release_18_05.rst |  1 +
 drivers/net/sfc/efsys.h                |  4 ++--
 drivers/net/sfc/sfc_ethdev.c           |  3 +++
 4 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst
index 36e98d3..38fa1ef 100644
--- a/doc/guides/nics/sfc_efx.rst
+++ b/doc/guides/nics/sfc_efx.rst
@@ -30,7 +30,8 @@ Solarflare libefx-based Poll Mode Driver
 ========================================
 
 The SFC EFX PMD (**librte_pmd_sfc_efx**) provides poll mode driver support
-for **Solarflare SFN7xxx and SFN8xxx** family of 10/40 Gbps adapters.
+for **Solarflare SFN7xxx and SFN8xxx** family of 10/40 Gbps adapters and
+**Solarflare XtremeScale X2xxx** family of 10/25/40/50/100 Gbps adapters.
 SFC EFX PMD has support for the latest Linux and FreeBSD operating systems.
 
 More information can be found at `Solarflare Communications website
@@ -123,19 +124,19 @@ It should be taken into account when mbuf pool for receive is created.
 Tunnels support
 ---------------
 
-NVGRE, VXLAN and GENEVE tunnels are supported on SFN8xxx family adapters
-with full-feature firmware variant running.
+NVGRE, VXLAN and GENEVE tunnels are supported on SFN8xxx and X2xxx family
+adapters with full-feature firmware variant running.
 **sfboot** should be used to configure NIC to run full-feature firmware variant.
 See Solarflare Server Adapter User's Guide for details.
 
-SFN8xxx family adapters provide either inner or outer packet classes.
+SFN8xxx and X2xxx family adapters provide either inner or outer packet classes.
 If adapter firmware advertises support for tunnels then the PMD
 configures the hardware to report inner classes, and outer classes are
 not reported in received packets.
 However, for VXLAN and GENEVE tunnels the PMD does report UDP as the
 outer layer 4 packet type.
 
-SFN8xxx family adapters report GENEVE packets as VXLAN.
+SFN8xxx and X2xxx family adapters report GENEVE packets as VXLAN.
 If UDP ports are configured for only one tunnel type then it is safe to
 treat VXLAN packet type indication as the corresponding UDP tunnel type.
 
@@ -216,6 +217,10 @@ conditions is met:
 Supported NICs
 --------------
 
+- Solarflare XtremeScale Adapters:
+
+   - Solarflare X2522 Dual Port SFP28 10/25GbE Adapter
+
 - Solarflare Flareon [Ultra] Server Adapters:
 
    - Solarflare SFN8522 Dual Port SFP+ Server Adapter
@@ -292,7 +297,7 @@ boolean parameters value.
   **auto** allows the driver itself to make a choice based on firmware
   features available and required by the datapath implementation.
   **efx** chooses libefx-based datapath which supports Rx scatter.
-  **ef10** chooses EF10 (SFN7xxx, SFN8xxx) native datapath which is
+  **ef10** chooses EF10 (SFN7xxx, SFN8xxx, X2xxx) native datapath which is
   more efficient than libefx-based and provides richer packet type
   classification, but lacks Rx scatter support.
 
@@ -305,12 +310,12 @@ boolean parameters value.
   (full-feature firmware variant only), TSO and multi-segment mbufs.
   Mbuf segments may come from different mempools, and mbuf reference
   counters are treated responsibly.
-  **ef10** chooses EF10 (SFN7xxx, SFN8xxx) native datapath which is
+  **ef10** chooses EF10 (SFN7xxx, SFN8xxx, X2xxx) native datapath which is
   more efficient than libefx-based but has no VLAN insertion and TSO
   support yet.
   Mbuf segments may come from different mempools, and mbuf reference
   counters are treated responsibly.
-  **ef10_simple** chooses EF10 (SFN7xxx, SFN8xxx) native datapath which
+  **ef10_simple** chooses EF10 (SFN7xxx, SFN8xxx, X2xxx) native datapath which
   is even more faster then **ef10** but does not support multi-segment
   mbufs, disallows multiple mempools and neglects mbuf reference counters.
 
@@ -336,6 +341,6 @@ boolean parameters value.
   Adjust period in milliseconds to update port hardware statistics.
   The accepted range is 0 to 65535. The value of **0** may be used
   to disable periodic statistics update. One should note that it's
-  only possible to set an arbitrary value on SFN8xxx provided that
+  only possible to set an arbitrary value on SFN8xxx and X2xxx provided that
   firmware version is 6.2.1.1033 or higher, otherwise any positive
   value will select a fixed update period of **1000** milliseconds
diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst
index f2525bb..dcb27b3 100644
--- a/doc/guides/rel_notes/release_18_05.rst
+++ b/doc/guides/rel_notes/release_18_05.rst
@@ -49,6 +49,7 @@ New Features
 
   Updated the sfc_efx driver including the following changes:
 
+  * Added support for Solarflare XtremeScale X2xxx family adapters.
   * Added support for NVGRE, VXLAN and GENEVE filters in flow API.
   * Added support for DROP action in flow API.
 
diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h
index f20b667..a8b3370 100644
--- a/drivers/net/sfc/efsys.h
+++ b/drivers/net/sfc/efsys.h
@@ -150,8 +150,8 @@ prefetch_read_once(const volatile void *addr)
 #define EFSYS_OPT_HUNTINGTON 1
 /* Enable SFN8xxx support */
 #define EFSYS_OPT_MEDFORD 1
-/* Disable SFN2xxx support (not supported yet) */
-#define EFSYS_OPT_MEDFORD2 0
+/* Enable SFN2xxx support */
+#define EFSYS_OPT_MEDFORD2 1
 #ifdef RTE_LIBRTE_SFC_EFX_DEBUG
 #define EFSYS_OPT_CHECK_REG 1
 #else
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index e114d63..3996f78 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1700,6 +1700,7 @@ sfc_eth_dev_set_ops(struct rte_eth_dev *dev)
 	switch (sa->family) {
 	case EFX_FAMILY_HUNTINGTON:
 	case EFX_FAMILY_MEDFORD:
+	case EFX_FAMILY_MEDFORD2:
 		avail_caps |= SFC_DP_HW_FW_CAP_EF10;
 		break;
 	default:
@@ -2040,6 +2041,8 @@ static const struct rte_pci_id pci_id_sfc_efx_map[] = {
 	{ RTE_PCI_DEVICE(EFX_PCI_VENID_SFC, EFX_PCI_DEVID_GREENPORT_VF) },
 	{ RTE_PCI_DEVICE(EFX_PCI_VENID_SFC, EFX_PCI_DEVID_MEDFORD) },
 	{ RTE_PCI_DEVICE(EFX_PCI_VENID_SFC, EFX_PCI_DEVID_MEDFORD_VF) },
+	{ RTE_PCI_DEVICE(EFX_PCI_VENID_SFC, EFX_PCI_DEVID_MEDFORD2) },
+	{ RTE_PCI_DEVICE(EFX_PCI_VENID_SFC, EFX_PCI_DEVID_MEDFORD2_VF) },
 	{ .vendor_id = 0 /* sentinel */ }
 };
 
-- 
2.7.4

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

* Re: [PATCH 0/3] net/sfc: support Medford2 family adapters
  2018-03-21 13:51 [PATCH 0/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
                   ` (2 preceding siblings ...)
  2018-03-21 13:51 ` [PATCH 3/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
@ 2018-03-30 10:33 ` Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2018-03-30 10:33 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

On 3/21/2018 1:51 PM, Andrew Rybchenko wrote:
> dpdk-web patch will follow.

Thanks.

> Andrew Rybchenko (3):
>   net/sfc: support link speeds up to 100G
>   net/sfc: support runtime VI window size
>   net/sfc: support Medford2 family adapters

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-03-30 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 13:51 [PATCH 0/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
2018-03-21 13:51 ` [PATCH 1/3] net/sfc: support link speeds up to 100G Andrew Rybchenko
2018-03-21 13:51 ` [PATCH 2/3] net/sfc: support runtime VI window size Andrew Rybchenko
2018-03-21 13:51 ` [PATCH 3/3] net/sfc: support Medford2 family adapters Andrew Rybchenko
2018-03-30 10:33 ` [PATCH 0/3] " 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.