From: Ivan Malov <ivan.malov@arknetworks.am>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Andy Moreton <andy.moreton@amd.com>,
Pieter Jansen Van Vuuren <pieter.jansen-van-vuuren@amd.com>,
Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,
Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>
Subject: [PATCH v2 03/45] common/sfc_efx/base: add Medford4 support to NIC module
Date: Wed, 23 Apr 2025 19:59:20 +0400 [thread overview]
Message-ID: <20250423160002.35706-4-ivan.malov@arknetworks.am> (raw)
In-Reply-To: <20250423160002.35706-1-ivan.malov@arknetworks.am>
From: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>
Implement NIC family discovery and minimum probe support.
Signed-off-by: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>
Signed-off-by: Andy Moreton <andy.moreton@amd.com>
---
drivers/common/sfc_efx/base/ef10_nic.c | 32 +++++++++++++++-
drivers/common/sfc_efx/base/efx.h | 1 +
drivers/common/sfc_efx/base/efx_impl.h | 7 +++-
drivers/common/sfc_efx/base/efx_nic.c | 52 ++++++++++++++++++++++++++
4 files changed, 90 insertions(+), 2 deletions(-)
diff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c
index 79d596b5ef..9bff68f054 100644
--- a/drivers/common/sfc_efx/base/ef10_nic.c
+++ b/drivers/common/sfc_efx/base/ef10_nic.c
@@ -1422,7 +1422,7 @@ ef10_get_datapath_caps(
/*
* Check if firmware reports the VI window mode.
- * Medford2 has a variable VI window size (8K, 16K or 64K).
+ * Medford2 and Medford4 have a variable VI window size (8K, 16K or 64K).
* Medford and Huntington have a fixed 8K VI window size.
*/
if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V3_OUT_LEN) {
@@ -1479,6 +1479,7 @@ ef10_get_datapath_caps(
switch (enp->en_family) {
case EFX_FAMILY_MEDFORD2:
+ case EFX_FAMILY_MEDFORD4:
encp->enc_rx_scale_hash_alg_mask =
(1U << EFX_RX_HASHALG_TOEPLITZ);
break;
@@ -1922,6 +1923,35 @@ static struct ef10_external_port_map_s {
(1U << TLV_PORT_MODE_1x1_1x1), /* mode 2 */
{ 0, 1, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA }
},
+ /*
+ * Modes that on Medford4 allocate 2 adjacent port numbers to cage 1
+ * and the rest to cage 2.
+ * port 0 -> cage 1
+ * port 1 -> cage 1
+ * port 2 -> cage 2
+ * port 3 -> cage 2
+ */
+ {
+ EFX_FAMILY_MEDFORD4,
+ (1U << TLV_PORT_MODE_2x1_2x1) | /* mode 5 */
+ (1U << TLV_PORT_MODE_2x1_1x4) | /* mode 7 */
+ (1U << TLV_PORT_MODE_2x2_NA) | /* mode 13 */
+ (1U << TLV_PORT_MODE_2x1_1x2), /* mode 18 */
+ { 0, 2, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA }
+ },
+ /*
+ * Modes that on Medford4 allocate up to 4 adjacent port numbers
+ * to cage 1.
+ * port 0 -> cage 1
+ * port 1 -> cage 1
+ * port 2 -> cage 1
+ * port 3 -> cage 1
+ */
+ {
+ EFX_FAMILY_MEDFORD4,
+ (1U << TLV_PORT_MODE_4x1_NA), /* mode 4 */
+ { 0, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA, EFX_EXT_PORT_NA }
+ },
};
static __checkReturn efx_rc_t
diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 635b44ab37..a9ed3f423f 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -196,6 +196,7 @@ efx_family_probe_bar(
/* FIXME Fix it when memory bar is fixed in FPGA image. It must be 0. */
#define EFX_MEM_BAR_RIVERHEAD 2
+#define EFX_MEM_BAR_MEDFORD4 2
/* Error codes */
diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h
index 662a21e90c..9d1f361c5d 100644
--- a/drivers/common/sfc_efx/base/efx_impl.h
+++ b/drivers/common/sfc_efx/base/efx_impl.h
@@ -972,7 +972,8 @@ struct efx_nic_s {
};
#define EFX_FAMILY_IS_EF10(_enp) \
- ((_enp)->en_family == EFX_FAMILY_MEDFORD2 || \
+ ((_enp)->en_family == EFX_FAMILY_MEDFORD4 || \
+ (_enp)->en_family == EFX_FAMILY_MEDFORD2 || \
(_enp)->en_family == EFX_FAMILY_MEDFORD || \
(_enp)->en_family == EFX_FAMILY_HUNTINGTON)
@@ -1128,6 +1129,10 @@ struct efx_txq_s {
rev = 'G'; \
break; \
\
+ case EFX_FAMILY_MEDFORD4: \
+ rev = 'H'; \
+ break; \
+ \
default: \
rev = '?'; \
break; \
diff --git a/drivers/common/sfc_efx/base/efx_nic.c b/drivers/common/sfc_efx/base/efx_nic.c
index 172488e083..1ec684da40 100644
--- a/drivers/common/sfc_efx/base/efx_nic.c
+++ b/drivers/common/sfc_efx/base/efx_nic.c
@@ -79,6 +79,21 @@ efx_family(
return (0);
#endif /* EFSYS_OPT_MEDFORD2 */
+#if EFSYS_OPT_MEDFORD4
+ case EFX_PCI_DEVID_MEDFORD4_PF_UNINIT:
+ /*
+ * Hardware default for PF0 of uninitialised Medford4.
+ * manftest must be able to cope with this device id.
+ */
+ case EFX_PCI_DEVID_MEDFORD4:
+ case EFX_PCI_DEVID_MEDFORD4_VF:
+ case EFX_PCI_DEVID_MEDFORD4_NO_LL:
+ case EFX_PCI_DEVID_MEDFORD4_NO_LL_VF:
+ *efp = EFX_FAMILY_MEDFORD4;
+ *membarp = EFX_MEM_BAR_MEDFORD4;
+ return (0);
+#endif /* EFSYS_OPT_MEDFORD4 */
+
case EFX_PCI_DEVID_FALCON: /* Obsolete, not supported */
default:
break;
@@ -251,6 +266,27 @@ static const efx_nic_ops_t __efx_nic_riverhead_ops = {
#endif /* EFSYS_OPT_RIVERHEAD */
+#if EFSYS_OPT_MEDFORD4
+
+static const efx_nic_ops_t __efx_nic_medford4_ops = {
+ ef10_nic_probe, /* eno_probe */
+ medford2_board_cfg, /* eno_board_cfg */
+ ef10_nic_set_drv_limits, /* eno_set_drv_limits */
+ ef10_nic_reset, /* eno_reset */
+ ef10_nic_init, /* eno_init */
+ ef10_nic_get_vi_pool, /* eno_get_vi_pool */
+ ef10_nic_get_bar_region, /* eno_get_bar_region */
+ ef10_nic_hw_unavailable, /* eno_hw_unavailable */
+ ef10_nic_set_hw_unavailable, /* eno_set_hw_unavailable */
+#if EFSYS_OPT_DIAG
+ ef10_nic_register_test, /* eno_register_test */
+#endif /* EFSYS_OPT_DIAG */
+ ef10_nic_fini, /* eno_fini */
+ ef10_nic_unprobe, /* eno_unprobe */
+};
+
+#endif /* EFSYS_OPT_MEDFORD4 */
+
__checkReturn efx_rc_t
efx_nic_create(
@@ -363,6 +399,22 @@ efx_nic_create(
break;
#endif /* EFSYS_OPT_RIVERHEAD */
+#if EFSYS_OPT_MEDFORD4
+ case EFX_FAMILY_MEDFORD4:
+ enp->en_enop = &__efx_nic_medford4_ops;
+ enp->en_features =
+ EFX_FEATURE_IPV6 |
+ EFX_FEATURE_LINK_EVENTS |
+ EFX_FEATURE_PERIODIC_MAC_STATS |
+ EFX_FEATURE_MCDI |
+ EFX_FEATURE_MAC_HEADER_FILTERS |
+ EFX_FEATURE_MCDI_DMA |
+ EFX_FEATURE_FW_ASSISTED_TSO_V2 |
+ EFX_FEATURE_PACKED_STREAM |
+ EFX_FEATURE_TXQ_CKSUM_OP_DESC;
+ break;
+#endif /* EFSYS_OPT_MEDFORD4 */
+
default:
rc = ENOTSUP;
goto fail2;
--
2.39.5
next prev parent reply other threads:[~2025-04-23 16:00 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 13:59 [PATCH 00/46] Support AMD Solarflare X45xx adaptors Ivan Malov
2025-04-16 13:59 ` [PATCH 01/46] common/sfc_efx/base: add Medford4 PCI IDs to common code Ivan Malov
2025-04-16 13:59 ` [PATCH 02/46] common/sfc_efx/base: add efsys option for Medford4 Ivan Malov
2025-04-17 7:08 ` Andrew Rybchenko
2025-04-17 15:07 ` Stephen Hemminger
2025-04-18 7:25 ` Andrew Rybchenko
2025-04-16 13:59 ` [PATCH 03/46] common/sfc_efx/base: add Medford4 support to NIC module Ivan Malov
2025-04-17 7:14 ` Andrew Rybchenko
2025-04-16 13:59 ` [PATCH 04/46] common/sfc_efx/base: add Medford4 support to EV module Ivan Malov
2025-04-16 13:59 ` [PATCH 05/46] common/sfc_efx/base: add Medford4 support to FILTER module Ivan Malov
2025-04-16 13:59 ` [PATCH 06/46] common/sfc_efx/base: add Medford4 support to INTR module Ivan Malov
2025-04-16 13:59 ` [PATCH 07/46] common/sfc_efx/base: add Medford4 support to MAC module Ivan Malov
2025-04-16 13:59 ` [PATCH 08/46] common/sfc_efx/base: add Medford4 support to PHY module Ivan Malov
2025-04-16 13:59 ` [PATCH 09/46] common/sfc_efx/base: add Medford4 support to TUNNEL module Ivan Malov
2025-04-16 13:59 ` [PATCH 10/46] common/sfc_efx/base: add Medford4 support to MCDI module Ivan Malov
2025-04-16 13:59 ` [PATCH 11/46] common/sfc_efx/base: add Medford4 support to Rx module Ivan Malov
2025-04-16 13:59 ` [PATCH 12/46] common/sfc_efx/base: add Medford4 support to Tx module Ivan Malov
2025-04-16 13:59 ` [PATCH 13/46] drivers: enable support for AMD Solarflare X4 adapter family Ivan Malov
2025-04-16 13:59 ` [PATCH 14/46] common/sfc_efx/base: update X4 BAR layout and PCI IDs Ivan Malov
2025-04-16 13:59 ` [PATCH 15/46] net/sfc: add Medford4 with only full feature datapath engine Ivan Malov
2025-04-16 13:59 ` [PATCH 16/46] common/sfc_efx/base: add port mode for 8 port hardware Ivan Malov
2025-04-16 13:59 ` [PATCH 17/46] common/sfc_efx/base: add new X4 port mode Ivan Malov
2025-04-16 13:59 ` [PATCH 18/46] common/sfc_efx/base: extend list of supported X4 port modes Ivan Malov
2025-04-16 13:59 ` [PATCH 19/46] common/sfc_efx/base: update MCDI headers Ivan Malov
2025-04-16 13:59 ` [PATCH 20/46] common/sfc_efx/base: provide a stub for basic netport attach Ivan Malov
2025-04-16 13:59 ` [PATCH 21/46] common/sfc_efx/base: provide defaults on netport attach path Ivan Malov
2025-04-16 13:59 ` [PATCH 22/46] common/sfc_efx/base: obtain assigned netport handle from NIC Ivan Malov
2025-04-16 13:59 ` [PATCH 23/46] common/sfc_efx/base: allow for const in MCDI struct accessor Ivan Malov
2025-04-16 13:59 ` [PATCH 24/46] common/sfc_efx/base: get netport fixed capabilities on probe Ivan Malov
2025-04-16 13:59 ` [PATCH 25/46] common/sfc_efx/base: decode netport link state on probe path Ivan Malov
2025-04-16 13:59 ` [PATCH 26/46] common/sfc_efx/base: fill in loopback modes on netport probe Ivan Malov
2025-04-16 13:59 ` [PATCH 27/46] common/sfc_efx/base: introduce Medford4 stub for PHY methods Ivan Malov
2025-04-16 13:59 ` [PATCH 28/46] common/sfc_efx/base: refactor EF10 link mode decoding helper Ivan Malov
2025-04-16 13:59 ` [PATCH 29/46] common/sfc_efx/base: provide PHY link get method on Medford4 Ivan Malov
2025-04-16 14:00 ` [PATCH 30/46] common/sfc_efx/base: implement PHY link control for Medford4 Ivan Malov
2025-04-17 7:31 ` Andrew Rybchenko
2025-04-16 14:00 ` [PATCH 31/46] common/sfc_efx/base: introduce Medford4 stub for MAC methods Ivan Malov
2025-04-16 14:00 ` [PATCH 32/46] common/sfc_efx/base: add MAC reconfigure method for Medford4 Ivan Malov
2025-04-17 7:34 ` Andrew Rybchenko
2025-04-16 14:00 ` [PATCH 33/46] common/sfc_efx/base: fill in software LUT for MAC statistics Ivan Malov
2025-04-16 14:00 ` [PATCH 34/46] common/sfc_efx/base: fill in MAC statistics mask on Medford4 Ivan Malov
2025-04-16 14:00 ` [PATCH 35/46] common/sfc_efx/base: support MAC statistics on Medford4 NICs Ivan Malov
2025-04-17 7:43 ` Andrew Rybchenko
2025-04-16 14:00 ` [PATCH 36/46] common/sfc_efx/base: implement MAC PDU controls for Medford4 Ivan Malov
2025-04-16 14:00 ` [PATCH 37/46] common/sfc_efx/base: correct MAC PDU calculation on Medford4 Ivan Malov
2025-04-16 14:00 ` [PATCH 38/46] net/sfc: make use of generic EFX MAC PDU calculation helpers Ivan Malov
2025-04-16 14:00 ` [PATCH 39/46] common/sfc_efx/base: ignore legacy link events on new boards Ivan Malov
2025-04-16 14:00 ` [PATCH 40/46] common/sfc_efx/base: add link event processing " Ivan Malov
2025-04-16 14:00 ` [PATCH 41/46] net/sfc: query link status on link change events on new NICs Ivan Malov
2025-04-16 14:00 ` [PATCH 42/46] common/sfc_efx/base: subscribe to netport link change events Ivan Malov
2025-04-16 14:00 ` [PATCH 43/46] net/sfc: offer support for 200G link ability on new adaptors Ivan Malov
2025-04-16 14:00 ` [PATCH 44/46] common/sfc_efx/base: support controls for netport lane count Ivan Malov
2025-04-17 7:57 ` Andrew Rybchenko
2025-04-16 14:00 ` [PATCH 45/46] net/sfc: add support for control of physical port " Ivan Malov
2025-04-16 14:00 ` [PATCH 46/46] doc: advertise support for AMD Solarflare X45xx adapters Ivan Malov
2025-04-16 15:14 ` [PATCH 00/46] Support AMD Solarflare X45xx adaptors Stephen Hemminger
2025-04-16 15:38 ` Ivan Malov
2025-04-16 16:31 ` Stephen Hemminger
2025-04-16 17:37 ` Ivan Malov
2025-04-16 21:44 ` Stephen Hemminger
2025-04-17 8:09 ` Andrew Rybchenko
2025-04-23 15:59 ` [PATCH v2 00/45] " Ivan Malov
2025-04-23 15:59 ` [PATCH v2 01/45] common/sfc_efx/base: add Medford4 PCI IDs to common code Ivan Malov
2025-04-23 15:59 ` [PATCH v2 02/45] common/sfc_efx/base: add efsys option for Medford4 Ivan Malov
2025-04-23 15:59 ` Ivan Malov [this message]
2025-04-23 15:59 ` [PATCH v2 04/45] common/sfc_efx/base: add Medford4 support to EV module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 05/45] common/sfc_efx/base: add Medford4 support to FILTER module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 06/45] common/sfc_efx/base: add Medford4 support to INTR module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 07/45] common/sfc_efx/base: add Medford4 support to MAC module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 08/45] common/sfc_efx/base: add Medford4 support to PHY module Ivan Malov
2025-04-23 19:15 ` Andrew Rybchenko
2025-04-23 15:59 ` [PATCH v2 09/45] common/sfc_efx/base: add Medford4 support to TUNNEL module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 10/45] common/sfc_efx/base: add Medford4 support to MCDI module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 11/45] common/sfc_efx/base: add Medford4 support to Rx module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 12/45] common/sfc_efx/base: add Medford4 support to Tx module Ivan Malov
2025-04-23 15:59 ` [PATCH v2 13/45] drivers: enable support for AMD Solarflare X4 adapter family Ivan Malov
2025-04-23 15:59 ` [PATCH v2 14/45] net/sfc: add Medford4 with only full feature datapath engine Ivan Malov
2025-04-23 15:59 ` [PATCH v2 15/45] common/sfc_efx/base: add port mode for 8 port hardware Ivan Malov
2025-04-23 15:59 ` [PATCH v2 16/45] common/sfc_efx/base: add new X4 port mode Ivan Malov
2025-04-23 15:59 ` [PATCH v2 17/45] common/sfc_efx/base: extend list of supported X4 port modes Ivan Malov
2025-04-23 15:59 ` [PATCH v2 18/45] common/sfc_efx/base: update MCDI headers Ivan Malov
2025-04-23 15:59 ` [PATCH v2 19/45] common/sfc_efx/base: provide a stub for basic netport attach Ivan Malov
2025-04-23 15:59 ` [PATCH v2 20/45] common/sfc_efx/base: provide defaults on netport attach path Ivan Malov
2025-04-23 15:59 ` [PATCH v2 21/45] common/sfc_efx/base: obtain assigned netport handle from NIC Ivan Malov
2025-04-23 15:59 ` [PATCH v2 22/45] common/sfc_efx/base: allow for const in MCDI struct accessor Ivan Malov
2025-04-23 15:59 ` [PATCH v2 23/45] common/sfc_efx/base: get netport fixed capabilities on probe Ivan Malov
2025-04-23 15:59 ` [PATCH v2 24/45] common/sfc_efx/base: decode netport link state on probe path Ivan Malov
2025-04-23 15:59 ` [PATCH v2 25/45] common/sfc_efx/base: fill in loopback modes on netport probe Ivan Malov
2025-04-23 15:59 ` [PATCH v2 26/45] common/sfc_efx/base: introduce Medford4 stub for PHY methods Ivan Malov
2025-04-23 15:59 ` [PATCH v2 27/45] common/sfc_efx/base: refactor EF10 link mode decoding helper Ivan Malov
2025-04-23 15:59 ` [PATCH v2 28/45] common/sfc_efx/base: provide PHY link get method on Medford4 Ivan Malov
2025-04-23 15:59 ` [PATCH v2 29/45] common/sfc_efx/base: implement PHY link control for Medford4 Ivan Malov
2025-04-23 15:59 ` [PATCH v2 30/45] common/sfc_efx/base: introduce Medford4 stub for MAC methods Ivan Malov
2025-04-23 15:59 ` [PATCH v2 31/45] common/sfc_efx/base: add MAC reconfigure method for Medford4 Ivan Malov
2025-04-23 15:59 ` [PATCH v2 32/45] common/sfc_efx/base: fill in software LUT for MAC statistics Ivan Malov
2025-04-23 15:59 ` [PATCH v2 33/45] common/sfc_efx/base: fill in MAC statistics mask on Medford4 Ivan Malov
2025-04-23 15:59 ` [PATCH v2 34/45] common/sfc_efx/base: support MAC statistics on Medford4 NICs Ivan Malov
2025-04-23 15:59 ` [PATCH v2 35/45] common/sfc_efx/base: implement MAC PDU controls for Medford4 Ivan Malov
2025-04-23 15:59 ` [PATCH v2 36/45] common/sfc_efx/base: correct MAC PDU calculation on Medford4 Ivan Malov
2025-04-23 15:59 ` [PATCH v2 37/45] net/sfc: make use of generic EFX MAC PDU calculation helpers Ivan Malov
2025-04-23 15:59 ` [PATCH v2 38/45] common/sfc_efx/base: ignore legacy link events on new boards Ivan Malov
2025-04-23 15:59 ` [PATCH v2 39/45] common/sfc_efx/base: add link event processing " Ivan Malov
2025-04-23 15:59 ` [PATCH v2 40/45] net/sfc: query link status on link change events on new NICs Ivan Malov
2025-04-23 15:59 ` [PATCH v2 41/45] common/sfc_efx/base: subscribe to netport link change events Ivan Malov
2025-04-23 15:59 ` [PATCH v2 42/45] net/sfc: offer support for 200G link ability on new adaptors Ivan Malov
2025-04-23 16:00 ` [PATCH v2 43/45] common/sfc_efx/base: support controls for netport lane count Ivan Malov
2025-04-23 16:00 ` [PATCH v2 44/45] net/sfc: add support for control of physical port " Ivan Malov
2025-04-23 16:00 ` [PATCH v2 45/45] doc: advertise support for AMD Solarflare X45xx adapters Ivan Malov
2025-04-23 19:15 ` Andrew Rybchenko
2025-04-23 19:19 ` [PATCH v2 00/45] Support AMD Solarflare X45xx adaptors 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=20250423160002.35706-4-ivan.malov@arknetworks.am \
--to=ivan.malov@arknetworks.am \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=andy.moreton@amd.com \
--cc=denis.pryazhennikov@arknetworks.am \
--cc=dev@dpdk.org \
--cc=pieter.jansen-van-vuuren@amd.com \
--cc=stephen@networkplumber.org \
--cc=viacheslav.galaktionov@arknetworks.am \
/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).