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 B84ECA0C3F for ; Sat, 12 Jun 2021 01:07:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1DE14003F; Sat, 12 Jun 2021 01:07:59 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2048.outbound.protection.outlook.com [40.107.93.48]) by mails.dpdk.org (Postfix) with ESMTP id 133C1406A2 for ; Sat, 12 Jun 2021 01:07:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQBS8pBYkYnXGMqNnN3czgG+0I4kloXPnB/ERlhwQzyfJD4vG8WyMTTt/igJY/ytN5v9gD7Ah5iUkLfeOMf1KYLTunzvk4nQxV2V2q3vDIMZ150vHB2NanCJqWXZNgJEznxxRgcMgqIFHMCRYOj2W/Qc8qP1RrfeJPUUK5icqpVytUj6msfekEnuEs7NXItqL5wYuOEJkwMNcB7OK6CyYvEvshhVD7MQmni/xHWWlSJrwk6JWDGleglO90XnmTeFBsVmMPYK6rCmKkrD1gyqLZ8OBHFcqoRz7IyEuN4v9Prl818ijmx+pBe0vrShEf9u5hyG2TvNb/QKUJu7NxCSrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W7NeotFORHIbFRCC5N6ZNwz1SC2BcIrK+qHwUfDTvC4=; b=H9teb30Fxo050C6RMedi7repOcY9spK3yIQ+sCeg+6y8dQN6WwYv/ZqcIQ0zDJt/ZauG3lzvhwen76a4SkQlkI1WgW3lBBSmxPOILWUxf2c7en2Kzfj8N0v0v/f94I0cEWWUdJfc/XUxQ86miXyf8jHEJWzEVEgzzC/ZZe26FHnRWJNqxuAfJrBmleJ3qxen5jR+M8gVWGcbs32f+Tr1G95JkZVYmQQJWifB426P87dgROQGkLL5FKTYSUIB2X9z0xAf2JWDCebBChtJjc4I+PEkvAKEbVg3HWDDKk/64PNy5q72SPLUYckXLZvyLhJ1RZWyUZbi0Vn6YslaOC4ZRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W7NeotFORHIbFRCC5N6ZNwz1SC2BcIrK+qHwUfDTvC4=; b=sjZVnlrilhKo5cG3Srn0rlE3yCx1FrloFRxIBELuhbWo/Fli69a7T+jd9fvJb2uyvJT65+Mt++uSGrgemr8R3Gl3zj/RuZ96UmmmPBk1G9Nl3GKO7TugvVZNbS6/3lXxZ921sZ3puyVacvxp/+d+r6FUd8RSml7/kehaZWDhAFHRQ9RaxG/XHBttIaUJqF7muwMUD98Z/acaeTf7QDBG/vAqpOcA1RzFP2HEV27Fzui+qG6aETd1k18KYisSluO0ISCOfpcmFVKrbkxocYXNVxYm7FDLZ/XUJX8P2aELAN/e/0vm4jAoqIHoafg3PIY1SKFLOkH+ndRJ263GCxaLCQ== Received: from MW4PR03CA0062.namprd03.prod.outlook.com (2603:10b6:303:b6::7) by DM5PR12MB1465.namprd12.prod.outlook.com (2603:10b6:4:7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Fri, 11 Jun 2021 23:07:56 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::90) by MW4PR03CA0062.outlook.office365.com (2603:10b6:303:b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Fri, 11 Jun 2021 23:07:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 23:07:56 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 11 Jun 2021 23:07:54 +0000 From: Xueming Li To: Alvin Zhang CC: Luca Boccassi , Beilei Xing , dpdk stable Date: Sat, 12 Jun 2021 07:02:07 +0800 Message-ID: <20210611230433.8208-33-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210611230433.8208-1-xuemingl@nvidia.com> References: <20210510160258.30982-229-xuemingl@nvidia.com> <20210611230433.8208-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6a0cac9-d36b-4234-2112-08d92d2dbfdc X-MS-TrafficTypeDiagnostic: DM5PR12MB1465: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iOS6NqHveA4lgXqu+0JrQ4pGWwI0sBpQZqpfXD+FdwLYT1fmX1Ctl/dH86JuqxEPOsFzD5J79ZeZ9K4sTVE+fyrVcv6jUd4ZDCiHlK4B1q3ApXvuDMvGgVXaGPQHh24nETzIArjhv2oAbE8zhBNhFxUAU5X5p29HLCMKOiq9L3sn1k/JadkWR3x1x76HWfywAn848/leL92J9Ua6fTWV9CQk3IXfiv+VIx4+NUOQkvDZlfg8VhpxlwnKekLpfR2Wr5FeiHLEoGlI579n6MH0rIOXtpl90Jqo9djYKuH9ikGN78hPYGQq3sr4qOUeBNnGBRwhy4xX4642NmUVhhuYHajfgcrbfVJ0yLmIcwd121D6cD8Wlrho9WUF/fsQQ0MDqGnNW7vo6mop13jjRtOecLxZJaclm8noghiLBjv5jyU0vWxIYiiZlmvHAQ2qn5gPPsVKa+ZjVoY4qc1PrYosQCMXARmNC/EwsSGEH4+gO4bS9AhazQED1f7vVGtYP2lKrWaCBhDcWcO473Ne2+gDS1L51ptexL/kMqgYFeSo0O2eL6+tNBALPSGepJayMkEEam4A+pFGgDaNjSFZgKIZHqCjbwf0bOQE+VaBG17YYCWOes0EOCVreABLxMziWSVtfNGgf6ygyPmd0z8tdz2NysQkcZFhcD6/XpuM1vwa8BEqhP9JG0mtQ/z4TXbp5tNQGyX5DSEYRS7zMEA0n3VNO5rriyMMtXFl7cZDXvnzcxFJ1d1gBLtuyUbbriKGKA8nE046anUqhVsjouQf7Bi6NFEWKKjw+CE+bllvdl2bKa8dLZ6FL1R6fCeggyhYUvF3 X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(376002)(39860400002)(396003)(136003)(46966006)(36840700001)(6666004)(5660300002)(186003)(47076005)(7696005)(2616005)(53546011)(86362001)(1076003)(356005)(8936002)(6916009)(8676002)(36860700001)(16526019)(82310400003)(26005)(2906002)(36756003)(478600001)(55016002)(70586007)(966005)(7636003)(54906003)(316002)(82740400003)(83380400001)(426003)(36906005)(4326008)(70206006)(336012)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 23:07:56.3809 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6a0cac9-d36b-4234-2112-08d92d2dbfdc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1465 Subject: [dpdk-stable] patch 'net/iavf: fix VF to PF command failure handling' has been queued to stable release 20.11.2 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 20.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/14/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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/dc22d3cfab65c82159712bcd60268600acb9c0e8 Thanks. Xueming Li --- >From dc22d3cfab65c82159712bcd60268600acb9c0e8 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 Cc: Luca Boccassi [ 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 0196f74721..a8b0649745 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -136,7 +136,7 @@ struct iavf_info { uint64_t supported_rxdid; uint8_t *proto_xtr; /* proto xtr type for all queues */ 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 */ @@ -255,7 +255,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 3d52a8c402..ed00521898 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -227,13 +227,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.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-06-12 06:53:57.542965100 +0800 +++ 0033-net-iavf-fix-VF-to-PF-command-failure-handling.patch 2021-06-12 06:53:56.170000000 +0800 @@ -1 +1 @@ -From 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb Mon Sep 17 00:00:00 2001 +From dc22d3cfab65c82159712bcd60268600acb9c0e8 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 0c35eecfe8b54bbdf59c30a803404acfdcc4f7eb ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index 1e73f01211..4f5811ae87 100644 +index 0196f74721..a8b0649745 100644 @@ -26 +28 @@ -@@ -144,7 +144,7 @@ struct iavf_info { +@@ -136,7 +136,7 @@ struct iavf_info { @@ -35 +37 @@ -@@ -264,7 +264,7 @@ struct iavf_cmd_info { +@@ -255,7 +255,7 @@ struct iavf_cmd_info { @@ -45 +47 @@ -index b0fbe15677..0026120cf4 100644 +index 3d52a8c402..ed00521898 100644 @@ -48 +50 @@ -@@ -228,13 +228,19 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) +@@ -227,13 +227,19 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)