DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/1] common/sfc_efx/base: revise legacy port controls on Medford4
@ 2025-08-13 12:36 Ivan Malov
  2025-08-13 15:20 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Malov @ 2025-08-13 12:36 UTC (permalink / raw)
  To: dev
  Cc: Andrew Rybchenko, Andy Moreton, Pieter Jansen Van Vuuren,
	Viacheslav Galaktionov, stable

Theoretically, adaptor firmware may not support new netport API. Currently,
efx_np_supported() assumes Medford4 always supports the API, however, this
can be improved in the future by checking some capability bit during probe.

If efx_np_supported() returns B_FALSE, then one should not invoke Medford4
PHY and MAC methods that are inherently dependent on new netport API. Pick
EF10-generic PHY and MAC methods in this case to maintain legacy behaviour.

Fixes: 8dac31d073af ("common/sfc_efx/base: introduce Medford4 stub for MAC methods")
Fixes: d65a7129c413 ("common/sfc_efx/base: introduce Medford4 stub for PHY methods")
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/efx_mac.c | 6 +++++-
 drivers/common/sfc_efx/base/efx_phy.c | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx_mac.c b/drivers/common/sfc_efx/base/efx_mac.c
index 69f053ce44..9dc1eb23b9 100644
--- a/drivers/common/sfc_efx/base/efx_mac.c
+++ b/drivers/common/sfc_efx/base/efx_mac.c
@@ -1000,7 +1000,11 @@ efx_mac_select(
 
 #if EFSYS_OPT_MEDFORD4
 	case EFX_FAMILY_MEDFORD4:
-		emop = &__efx_mac_medford4_ops;
+		if (efx_np_supported(enp) != B_FALSE)
+			emop = &__efx_mac_medford4_ops;
+		else
+			emop = &__efx_mac_ef10_ops;
+
 		type = EFX_MAC_MEDFORD4;
 		break;
 #endif /* EFSYS_OPT_MEDFORD4 */
diff --git a/drivers/common/sfc_efx/base/efx_phy.c b/drivers/common/sfc_efx/base/efx_phy.c
index 1f99c72e62..6e5521db20 100644
--- a/drivers/common/sfc_efx/base/efx_phy.c
+++ b/drivers/common/sfc_efx/base/efx_phy.c
@@ -136,7 +136,10 @@ efx_phy_probe(
 
 #if EFSYS_OPT_MEDFORD4
 	case EFX_FAMILY_MEDFORD4:
-		epop = &__efx_phy_medford4_ops;
+		if (efx_np_supported(enp) != B_FALSE)
+			epop = &__efx_phy_medford4_ops;
+		else
+			epop = &__efx_phy_ef10_ops;
 	break;
 #endif	/* EFSYS_OPT_MEDFORD4 */
 
-- 
2.17.1


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

* Re: [PATCH 1/1] common/sfc_efx/base: revise legacy port controls on Medford4
  2025-08-13 12:36 [PATCH 1/1] common/sfc_efx/base: revise legacy port controls on Medford4 Ivan Malov
@ 2025-08-13 15:20 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2025-08-13 15:20 UTC (permalink / raw)
  To: Ivan Malov
  Cc: dev, Andrew Rybchenko, Andy Moreton, Pieter Jansen Van Vuuren,
	Viacheslav Galaktionov, stable

On Wed, 13 Aug 2025 16:36:36 +0400
Ivan Malov <ivan.malov@arknetworks.am> wrote:

> Theoretically, adaptor firmware may not support new netport API. Currently,
> efx_np_supported() assumes Medford4 always supports the API, however, this
> can be improved in the future by checking some capability bit during probe.
> 
> If efx_np_supported() returns B_FALSE, then one should not invoke Medford4
> PHY and MAC methods that are inherently dependent on new netport API. Pick
> EF10-generic PHY and MAC methods in this case to maintain legacy behaviour.
> 
> Fixes: 8dac31d073af ("common/sfc_efx/base: introduce Medford4 stub for MAC methods")
> Fixes: d65a7129c413 ("common/sfc_efx/base: introduce Medford4 stub for PHY methods")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
> Reviewed-by: Andy Moreton <andy.moreton@amd.com>
> ---

Applied to next-net

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

end of thread, other threads:[~2025-08-13 15:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-13 12:36 [PATCH 1/1] common/sfc_efx/base: revise legacy port controls on Medford4 Ivan Malov
2025-08-13 15:20 ` Stephen Hemminger

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).