From: Ivan Malov <ivan.malov@arknetworks.am>
To: dev@dpdk.org
Cc: 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>,
stable@dpdk.org
Subject: [PATCH 3/9] common/sfc_efx/base: fix indication of requestable FEC flags
Date: Tue, 30 Dec 2025 01:35:21 +0400 [thread overview]
Message-ID: <20251229213527.37907-4-ivan.malov@arknetworks.am> (raw)
In-Reply-To: <20251229213527.37907-1-ivan.malov@arknetworks.am>
Without these, the client driver will not allow to change default FEC mode.
The existing code assumes that the FW supplies them in the 'FEC_REQ' field
of the 'GET_FIXED_PORT_PROPERTIES' MCDI, but that is not the case. Arrange
the code to reuse the snippet from pre-X4 EF10 attach path to set the bits.
Fixes: a90549f527eb ("common/sfc_efx/base: get netport fixed capabilities on probe")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <andy.moreton@amd.com>
---
drivers/common/sfc_efx/base/ef10_nic.c | 57 ++++++++++++++------------
drivers/common/sfc_efx/base/efx_np.c | 2 +-
2 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c
index 627144cfb0..9af4259d38 100644
--- a/drivers/common/sfc_efx/base/ef10_nic.c
+++ b/drivers/common/sfc_efx/base/ef10_nic.c
@@ -2220,35 +2220,23 @@ efx_mcdi_nic_board_cfg(
encp->enc_board_type = board_type;
- if (efx_np_supported(enp) != B_FALSE)
- goto skip_phy_props;
-
- /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */
- if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0)
- goto fail8;
+ if (efx_np_supported(enp) == B_FALSE) {
+ /*
+ * Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI
+ */
+ rc = efx_mcdi_get_phy_cfg(enp);
+ if (rc != 0)
+ goto fail8;
- /*
- * Firmware with support for *_FEC capability bits does not
- * report that the corresponding *_FEC_REQUESTED bits are supported.
- * Add them here so that drivers understand that they are supported.
- */
- if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_BASER_FEC))
- epp->ep_phy_cap_mask |=
- (1u << EFX_PHY_CAP_BASER_FEC_REQUESTED);
- if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_RS_FEC))
- epp->ep_phy_cap_mask |=
- (1u << EFX_PHY_CAP_RS_FEC_REQUESTED);
- if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_25G_BASER_FEC))
- epp->ep_phy_cap_mask |=
- (1u << EFX_PHY_CAP_25G_BASER_FEC_REQUESTED);
+ /* Obtain the default PHY advertised capabilities */
+ rc = ef10_phy_get_link(enp, &els);
+ if (rc != 0)
+ goto fail9;
- /* Obtain the default PHY advertised capabilities */
- if ((rc = ef10_phy_get_link(enp, &els)) != 0)
- goto fail9;
- epp->ep_default_adv_cap_mask = els.epls.epls_adv_cap_mask;
- epp->ep_adv_cap_mask = els.epls.epls_adv_cap_mask;
+ epp->ep_default_adv_cap_mask = els.epls.epls_adv_cap_mask;
+ epp->ep_adv_cap_mask = els.epls.epls_adv_cap_mask;
+ }
-skip_phy_props:
/* Check capabilities of running datapath firmware */
if ((rc = ef10_get_datapath_caps(enp)) != 0)
goto fail10;
@@ -2483,6 +2471,7 @@ ef10_nic_probe(
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_drv_cfg_t *edcp = &(enp->en_drv_cfg);
+ efx_port_t *epp = &(enp->en_port);
efx_rc_t rc;
EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
@@ -2506,6 +2495,22 @@ ef10_nic_probe(
if (rc != 0)
goto fail5;
+ /*
+ * Firmware with support for *_FEC capability bits does not
+ * report that the corresponding *_FEC_REQUESTED bits are supported.
+ * Add them here so that drivers understand that they are supported.
+ */
+
+ if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_BASER_FEC))
+ epp->ep_phy_cap_mask |=
+ (1u << EFX_PHY_CAP_BASER_FEC_REQUESTED);
+ if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_RS_FEC))
+ epp->ep_phy_cap_mask |=
+ (1u << EFX_PHY_CAP_RS_FEC_REQUESTED);
+ if (epp->ep_phy_cap_mask & (1u << EFX_PHY_CAP_25G_BASER_FEC))
+ epp->ep_phy_cap_mask |=
+ (1u << EFX_PHY_CAP_25G_BASER_FEC_REQUESTED);
+
/*
* Set default driver config limits (based on board config).
*
diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index ca0eb09b4a..45f3cd07ed 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -1392,7 +1392,7 @@ efx_np_link_ctrl(
* no 'FEC_REQUESTED' bits, use 'NONE' or 'AUTO' from above.
*/
EFX_NP_CAP_SW_MASK_TO_HW_ENUM(efx_np_cap_map_fec_req,
- ETH_AN_FIELDS_FEC_REQ, cap_data_raw, cap_mask_sw,
+ ETH_AN_FIELDS_FEC_MASK, cap_data_raw, cap_mask_sw,
NULL, NULL, &supported, &cap_enum_hw);
if ((cap_mask_sw & EFX_PHY_CAP_FEC_MASK) != 0
--
2.47.3
next prev parent reply other threads:[~2025-12-29 21:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-29 21:35 [PATCH 0/9] net/sfc: SFN7xxx deprecation and Medford fixes Ivan Malov
2025-12-29 21:35 ` [PATCH 1/9] doc: remove support for AMD Solarflare SFN7xxx family boards Ivan Malov
2025-12-29 21:35 ` [PATCH 2/9] common/sfc_efx/base: fix flow control setting on legacy MCDI Ivan Malov
2025-12-29 21:35 ` Ivan Malov [this message]
2025-12-29 21:35 ` [PATCH 4/9] common/sfc_efx/base: define mask for pause mode capabilities Ivan Malov
2025-12-29 21:35 ` [PATCH 5/9] common/sfc_efx/base: count Rx TRUNC ERR as CRC errors on X4 Ivan Malov
2025-12-29 21:35 ` [PATCH 6/9] net/sfc: avoid speed reset when setting FEC in started state Ivan Malov
2025-12-29 21:35 ` [PATCH 7/9] net/sfc: rework the capability check that is done on FEC set Ivan Malov
2025-12-29 21:35 ` [PATCH 8/9] net/sfc: drop AUTO from FEC capabilities and fix the comment Ivan Malov
2025-12-29 21:35 ` [PATCH 9/9] net/sfc: fix reporting status of autonegotiation to the user Ivan Malov
2025-12-31 19:13 ` [PATCH 0/9] net/sfc: SFN7xxx deprecation and Medford fixes Stephen Hemminger
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=20251229213527.37907-4-ivan.malov@arknetworks.am \
--to=ivan.malov@arknetworks.am \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=andy.moreton@amd.com \
--cc=dev@dpdk.org \
--cc=pieter.jansen-van-vuuren@amd.com \
--cc=stable@dpdk.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).