From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9C11DA0555 for ; Thu, 9 Jun 2022 13:38:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 966FE4069C; Thu, 9 Jun 2022 13:38:14 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1845540220 for ; Thu, 9 Jun 2022 13:38:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654774692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f5qkVBi+Yk0KvS8UhLQOZFlDFQKl2O54VqEa24WSZyU=; b=MBKkVdZzXt+Smio8g8IieD4tyUC/RKpCDmo8jbAnrpKgmRjgumgKgZxKtH/8yKb5KUpn4p JnTJeqYOIASBhPxrIGJjkPNrmlfCBKvYbV9x3QVx3MwSJTzVpq5+M8XhdFmHB1tlD9fGuU EcXBsq1BT+D7OKl0J/5VtKVq/jCkNIk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-271-vm3VmPkzMX6lqgC9-JZviQ-1; Thu, 09 Jun 2022 07:38:11 -0400 X-MC-Unique: vm3VmPkzMX6lqgC9-JZviQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32B053C0CD45; Thu, 9 Jun 2022 11:38:11 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.195.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 232EC1730C; Thu, 9 Jun 2022 11:38:09 +0000 (UTC) From: Kevin Traynor To: Ivan Malov Cc: Andrew Rybchenko , Andy Moreton , dpdk stable Subject: patch 'common/sfc_efx/base: convert EFX PCIe INTF to MCDI value' has been queued to stable release 21.11.2 Date: Thu, 9 Jun 2022 12:36:31 +0100 Message-Id: <20220609113701.386938-44-ktraynor@redhat.com> In-Reply-To: <20220609113701.386938-1-ktraynor@redhat.com> References: <20220609113701.386938-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- 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@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(