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 B2472A0A02 for ; Mon, 17 May 2021 18:17:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3FFE410EA; Mon, 17 May 2021 18:17:10 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id ADE5440041 for ; Mon, 17 May 2021 18:17:09 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lifvZ-0008UY-Go; Mon, 17 May 2021 16:17:09 +0000 From: Christian Ehrhardt To: Alvin Zhang Cc: Beilei Xing , dpdk stable Date: Mon, 17 May 2021 18:09:57 +0200 Message-Id: <20210517161039.3132619-168-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/iavf: fix VF to PF command failure handling' has been queued to stable release 19.11.9 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/19/21. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/fe55ed02153848c6cbbd3cebfff7db84cd68cd38 Thanks. Christian Ehrhardt --- >From fe55ed02153848c6cbbd3cebfff7db84cd68cd38 Mon Sep 17 00:00:00 2001 From: Alvin Zhang Date: Sun, 25 Apr 2021 15:39:34 +0800 Subject: [PATCH] net/iavf: fix VF to PF command failure handling [ upstream commit 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb ] When the command sent by VF to PF fails, iavf may need to run different code paths according to the specific reason of the failure (not supported or other reasons). This patch adds support of identifying PF return error type. Fixes: 22b123a36d07 ("net/avf: initialize PMD") Signed-off-by: Alvin Zhang Acked-by: Beilei Xing --- drivers/net/iavf/iavf.h | 4 ++-- drivers/net/iavf/iavf_vchnl.c | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 432e700d84..16480a76f6 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -96,7 +96,7 @@ struct iavf_info { struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */ volatile enum virtchnl_ops pend_cmd; /* pending command not finished */ - uint32_t cmd_retval; /* return value of the cmd response from PF */ + int cmd_retval; /* return value of the cmd response from PF */ uint8_t *aq_resp; /* buffer to store the adminq response from PF */ /* Event from pf */ @@ -182,7 +182,7 @@ struct iavf_cmd_info { * _atomic_set_cmd successfully. */ static inline void -_notify_cmd(struct iavf_info *vf, uint32_t msg_ret) +_notify_cmd(struct iavf_info *vf, int msg_ret) { vf->cmd_retval = msg_ret; rte_wmb(); diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 149c52e778..d855582358 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -121,13 +121,19 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) rte_delay_ms(ASQ_DELAY_MS); /* If don't read msg or read sys event, continue */ } while (i++ < MAX_TRY_TIMES); - /* If there's no response is received, clear command */ - if (i >= MAX_TRY_TIMES || - vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) { - err = -1; - PMD_DRV_LOG(ERR, "No response or return failure (%d)" - " for cmd %d", vf->cmd_retval, args->ops); + + if (i >= MAX_TRY_TIMES) { + PMD_DRV_LOG(ERR, "No response for cmd %d", args->ops); _clear_cmd(vf); + err = -EIO; + } else if (vf->cmd_retval == + VIRTCHNL_STATUS_ERR_NOT_SUPPORTED) { + PMD_DRV_LOG(ERR, "Cmd %d not supported", args->ops); + err = -ENOTSUP; + } else if (vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) { + PMD_DRV_LOG(ERR, "Return failure %d for cmd %d", + vf->cmd_retval, args->ops); + err = -EINVAL; } break; } -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:35.990776271 +0200 +++ 0168-net-iavf-fix-VF-to-PF-command-failure-handling.patch 2021-05-17 17:40:29.491811995 +0200 @@ -1 +1 @@ -From 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb Mon Sep 17 00:00:00 2001 +From fe55ed02153848c6cbbd3cebfff7db84cd68cd38 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 1e73f01211..4f5811ae87 100644 +index 432e700d84..16480a76f6 100644 @@ -26,3 +27,3 @@ -@@ -144,7 +144,7 @@ struct iavf_info { - uint64_t supported_rxdid; - uint8_t *proto_xtr; /* proto xtr type for all queues */ +@@ -96,7 +96,7 @@ struct iavf_info { + struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */ + @@ -35 +36 @@ -@@ -264,7 +264,7 @@ struct iavf_cmd_info { +@@ -182,7 +182,7 @@ struct iavf_cmd_info { @@ -45 +46 @@ -index b0fbe15677..0026120cf4 100644 +index 149c52e778..d855582358 100644 @@ -48 +49 @@ -@@ -228,13 +228,19 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) +@@ -121,13 +121,19 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)