patch 'common/sfc_efx/base: convert EFX PCIe INTF to MCDI value' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Thu Jun 9 13:36:31 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/240030005bd8259119d06d88726ae7b525879eeb

Thanks.

Kevin

---
>From 240030005bd8259119d06d88726ae7b525879eeb Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov at oktetlabs.ru>
Date: Thu, 26 May 2022 11:45:48 +0300
Subject: [PATCH] common/sfc_efx/base: convert EFX PCIe INTF to MCDI value

[ upstream commit b85f50487eed8f94c85952587890fffd4de9a0d9 ]

When the driver queries its PCIe interface type via MCDI,
the value from the response is translated to an EFX enum.

When the driver passes this enum value back to any other
MCDI helper, the inverse translation has to be conducted.

Fixes: 1bf9ff57ccb3 ("common/sfc_efx/base: allow getting VNIC MCDI client handles")

Signed-off-by: Ivan Malov <ivan.malov at oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton at xilinx.com>
---
 drivers/common/sfc_efx/base/efx_impl.h |  6 ++++
 drivers/common/sfc_efx/base/efx_mcdi.c | 44 +++++++++++++++++++++++---
 2 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h
index e2802e6672..ba00eeeb47 100644
--- a/drivers/common/sfc_efx/base/efx_impl.h
+++ b/drivers/common/sfc_efx/base/efx_impl.h
@@ -1556,4 +1556,10 @@ efx_mcdi_intf_from_pcie(
 	__out			efx_pcie_interface_t *efx_intf);
 
+LIBEFX_INTERNAL
+extern	__checkReturn		efx_rc_t
+efx_mcdi_intf_to_pcie(
+	__in			efx_pcie_interface_t efx_intf,
+	__out			uint32_t *pcie_intf);
+
 LIBEFX_INTERNAL
 extern	__checkReturn	efx_rc_t
diff --git a/drivers/common/sfc_efx/base/efx_mcdi.c b/drivers/common/sfc_efx/base/efx_mcdi.c
index 9189a7a8b3..404ca23d58 100644
--- a/drivers/common/sfc_efx/base/efx_mcdi.c
+++ b/drivers/common/sfc_efx/base/efx_mcdi.c
@@ -660,4 +660,5 @@ efx_mcdi_get_client_handle(
 	    MC_CMD_GET_CLIENT_HANDLE_IN_LEN,
 	    MC_CMD_GET_CLIENT_HANDLE_OUT_LEN);
+	uint32_t pcie_intf;
 	efx_rc_t rc;
 
@@ -667,4 +668,8 @@ efx_mcdi_get_client_handle(
 	}
 
+	rc = efx_mcdi_intf_to_pcie(intf, &pcie_intf);
+	if (rc != 0)
+		goto fail2;
+
 	req.emr_cmd = MC_CMD_GET_CLIENT_HANDLE;
 	req.emr_in_buf = payload;
@@ -677,5 +682,5 @@ efx_mcdi_get_client_handle(
 	MCDI_IN_SET_WORD(req, GET_CLIENT_HANDLE_IN_FUNC_PF, pf);
 	MCDI_IN_SET_WORD(req, GET_CLIENT_HANDLE_IN_FUNC_VF, vf);
-	MCDI_IN_SET_DWORD(req, GET_CLIENT_HANDLE_IN_FUNC_INTF, intf);
+	MCDI_IN_SET_DWORD(req, GET_CLIENT_HANDLE_IN_FUNC_INTF, pcie_intf);
 
 	efx_mcdi_execute(enp, &req);
@@ -683,10 +688,10 @@ efx_mcdi_get_client_handle(
 	if (req.emr_rc != 0) {
 		rc = req.emr_rc;
-		goto fail2;
+		goto fail3;
 	}
 
 	if (req.emr_out_length_used < MC_CMD_GET_CLIENT_HANDLE_OUT_LEN) {
 		rc = EMSGSIZE;
-		goto fail3;
+		goto fail4;
 	}
 
@@ -694,4 +699,6 @@ efx_mcdi_get_client_handle(
 
 	return 0;
+fail4:
+	EFSYS_PROBE(fail4);
 fail3:
 	EFSYS_PROBE(fail3);
@@ -710,5 +717,5 @@ efx_mcdi_get_own_client_handle(
 	efx_rc_t rc;
 
-	rc = efx_mcdi_get_client_handle(enp, PCIE_INTERFACE_CALLER,
+	rc = efx_mcdi_get_client_handle(enp, EFX_PCIE_INTERFACE_CALLER,
 	    PCIE_FUNCTION_PF_NULL, PCIE_FUNCTION_VF_NULL, handle);
 	if (rc != 0)
@@ -2234,4 +2241,33 @@ fail1:
 }
 
+	__checkReturn		efx_rc_t
+efx_mcdi_intf_to_pcie(
+	__in			efx_pcie_interface_t efx_intf,
+	__out			uint32_t *pcie_intf)
+{
+	efx_rc_t rc;
+
+	switch (efx_intf) {
+	case EFX_PCIE_INTERFACE_CALLER:
+		*pcie_intf = PCIE_INTERFACE_CALLER;
+		break;
+	case EFX_PCIE_INTERFACE_HOST_PRIMARY:
+		*pcie_intf = PCIE_INTERFACE_HOST_PRIMARY;
+		break;
+	case EFX_PCIE_INTERFACE_NIC_EMBEDDED:
+		*pcie_intf = PCIE_INTERFACE_NIC_EMBEDDED;
+		break;
+	default:
+		rc = EINVAL;
+		goto fail1;
+	}
+
+	return (0);
+
+fail1:
+	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+	return (rc);
+}
+
 /*
  * This function returns the pf and vf number of a function.  If it is a pf the
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-09 12:34:30.793309055 +0100
+++ 0044-common-sfc_efx-base-convert-EFX-PCIe-INTF-to-MCDI-va.patch	2022-06-09 12:34:29.753980654 +0100
@@ -1 +1 @@
-From b85f50487eed8f94c85952587890fffd4de9a0d9 Mon Sep 17 00:00:00 2001
+From 240030005bd8259119d06d88726ae7b525879eeb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b85f50487eed8f94c85952587890fffd4de9a0d9 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index 7dfe30b695..9a5d465fa0 100644
+index e2802e6672..ba00eeeb47 100644
@@ -27 +28 @@
-@@ -1557,4 +1557,10 @@ efx_mcdi_intf_from_pcie(
+@@ -1556,4 +1556,10 @@ efx_mcdi_intf_from_pcie(



More information about the stable mailing list