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 656C3A0A0E for ; Mon, 10 May 2021 18:22:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5FB304003E; Mon, 10 May 2021 18:22:27 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) by mails.dpdk.org (Postfix) with ESMTP id 60B624003E for ; Mon, 10 May 2021 18:22:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KqRGFrHvdSu1Qm3Hh9dSKRGFMKqdrRX2XXPbBhv4iSxvuA7iwTXyUmc30wTwjIx0uOlf4xRKu39trmdCor50uBmUMew3ghH3L+P//38xvgv1Wi3LB26DT3gBGgHBjcAIoGo2Io6LXVgKcbn28q5tEDo3QrC2sFHDWTpvzZvPyR+iX0cwc2kyuxf495OJDJ2ngnlFV+nJsndakxZLMKhPz9MsLDqPjkya+zTs17B3C9eDRZaMqzZDHJr5FH+Zy/S29m6QZqh3A1MBqsgCch4lNkJeZaItwrcBQj5fwIfAD9kjdUek6x1CcDh0gAlJUzqlbYrCkqmkbwelzkcfBetmlA== 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=cpJCRYMnxt0/rGPX2TewkVAwlpquAoOnOsPCG9AyRp4=; b=nlOuzcZJSQh3GwNSttumiUsnZoYUKx0fYIcD3cWVo3ixnv0cI46kn8ZY3mXWszsqUDrEVDQD45vjfVa/SNHCp5JJwCXdZPg5l8jVyzzzA0cZhbCnNZOH5QmBwTfvQruVukSFRVLz3N/zKN0m4BUxtbinRwSMy/Mnm84qrCvLg3PhFgepo5gErOxhRsTj37xTvoU12cOBxxuQChfPc+k1RD2bWDGlem6hCAmCqsCH0YCfrPdDMsyMhyRNlk+CVgAnPj5ULFiZxgeoXt745tBVsW2WDWq+N9XXjP6eEffE5Vpx3HWXyf4IWWnKW/nxe2UbUCbSGW3X/z6U7XeTKKFJtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=huawei.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=cpJCRYMnxt0/rGPX2TewkVAwlpquAoOnOsPCG9AyRp4=; b=Zq7SpMdVtELIl9aSvbtRBvI06uzuuOG+ds8HsYnLuU1yTMvCJvAt3W2SKLGz9bwDGvNLiSMgpGKlMnMGgrf+rLKuxDaAoTRaL6F958vvN2+zCYmQJgb/vXNigbDxq2h2APpmOy8gJ4HB047s7Mf/SMyvGfhs44p6ej6UKFP/KPC8qPPoKwJEiF4KOuBoEnbDwQd2V8p/CbDuwuf1CYMgdF7Vfrh/998qrDDdcCH7t7Uy3axCiSXQOZsRgdoHaaFB8p6E4PKhemxOmspDecjEzNQ09hLQUsQbKg8XsTDvdnQDALR2kSAb4LS7wEo3Pn3XoCDGais5uJstPbRNWiiXTQ== Received: from BN7PR02CA0009.namprd02.prod.outlook.com (2603:10b6:408:20::22) by BYAPR12MB2712.namprd12.prod.outlook.com (2603:10b6:a03:65::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Mon, 10 May 2021 16:22:25 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:20:cafe::57) by BN7PR02CA0009.outlook.office365.com (2603:10b6:408:20::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Mon, 10 May 2021 16:22:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; huawei.com; dkim=none (message not signed) header.d=none;huawei.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 BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:22:24 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:22:22 +0000 From: Xueming Li To: Chengchang Tang CC: Luca Boccassi , Min Hu , dpdk stable Date: Tue, 11 May 2021 00:02:22 +0800 Message-ID: <20210510160258.30982-193-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95443632-98a5-48a5-5d1d-08d913cfcbe6 X-MS-TrafficTypeDiagnostic: BYAPR12MB2712: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /H6tbu6nrNZO1HWrcUaDgi6cMa9f1vTAVfGfJ10+HiiQcGyiPpfh560k2Sud6Lk1D93tKCqXIjP8ld4DVJYXVWU6RMRBH7wFe/7KRwwsnmC2FagnjTMzuYLe3m/31Z2SiW6rphsdAlPX05107g3jvvDPKLgq21xWHjSiJBbbLR6VgvbskA9KVxzurfUUFFHS7TKf820FHNC/Q7hhAd0W0pCD8prIl5QorO7QbGYWujrI9nMCT2sR1qO1GSGTOCEWMJkq1lAWrLhHJgf74ahKiBOtlNB3eIKu9mzoF8VunYkzAH/z7vhUabL2ysJ3mgbTfyKiEWAbdnXBHVFXr1AGBEfe+VzSI7RJbrqtj/dz4I6clznyStr/IsKVpacGAmxF0vH5KKgckfCIKt4sMjoY9VtYzrYU6adxcI+e/IgDYdkOQNTeq8wEoW6jwhtzfjxi6BCNXKWPSzmpajKhiaD0UYI0flN+jUD/K47JYX7wYrEqJVlJ28MFRJAg1Abwc56QIEcB1BXeb8Ofb1PcYgXNyU2SKLIWg6c8g+6SNexM/EOGxvXzIFH1XlNMmBHlJ+KOMwpCOwmftcQjvp1pIE71ZEm/2QLprNGxIe9jrzSl92Qud6ZVYhlR2uLNUIWOiL+Xp0yqnlq2WKfmCMF6X+8PQ/caDw/b4TAzN4wPouvwiDaYg14aWcdOBAgZ8f8Z3raU7A7RP63x/kMIxkWEv6JbIJzsnCML60VMICtdslGddV0= 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)(36840700001)(46966006)(53546011)(6286002)(2906002)(36756003)(70586007)(16526019)(70206006)(186003)(966005)(8936002)(6916009)(47076005)(83380400001)(7696005)(36860700001)(336012)(5660300002)(86362001)(26005)(356005)(7636003)(1076003)(426003)(2616005)(82310400003)(498600001)(54906003)(36906005)(4326008)(8676002)(55016002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:22:24.7836 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95443632-98a5-48a5-5d1d-08d913cfcbe6 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: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2712 Subject: [dpdk-stable] patch 'net/hns3: fix use of command status enumeration' 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 05/12/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/f20ccda35a7230052cd5a959c1fb27d46c40fe3b Thanks. Xueming Li --- >From f20ccda35a7230052cd5a959c1fb27d46c40fe3b Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Tue, 13 Apr 2021 19:50:04 +0800 Subject: [PATCH] net/hns3: fix use of command status enumeration Cc: Luca Boccassi [ upstream commit a32eaf435a53b26b9697fcb483612af7de514414 ] The type of return value of hns3_cmd_send is int, some function declare the return value as hns3_cmd_status. This patch fix the incorrect use of the enum hns3_cmd_status. Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware") Fixes: 02a7b55657b2 ("net/hns3: support Rx interrupt") Signed-off-by: Chengchang Tang Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_cmd.c | 2 +- drivers/net/hns3/hns3_cmd.h | 9 +-------- drivers/net/hns3/hns3_ethdev.c | 12 ++++++------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index 8a48714a54..b45891a7ce 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -450,7 +450,7 @@ hns3_build_api_caps(void) return rte_cpu_to_le_32(api_caps); } -static enum hns3_cmd_status +static int hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw) { struct hns3_query_version_cmd *resp; diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index c6fc6c401a..37cb20a9f5 100644 --- a/drivers/net/hns3/hns3_cmd.h +++ b/drivers/net/hns3/hns3_cmd.h @@ -55,13 +55,6 @@ enum hns3_cmd_return_status { HNS3_CMD_INVALID = 11, }; -enum hns3_cmd_status { - HNS3_STATUS_SUCCESS = 0, - HNS3_ERR_CSQ_FULL = -1, - HNS3_ERR_CSQ_TIMEOUT = -2, - HNS3_ERR_CSQ_ERROR = -3, -}; - struct hns3_misc_vector { uint8_t *addr; int vector_irq; @@ -71,7 +64,7 @@ struct hns3_cmq { struct hns3_cmq_ring csq; struct hns3_cmq_ring crq; uint16_t tx_timeout; - enum hns3_cmd_status last_status; + enum hns3_cmd_return_status last_status; }; enum hns3_opcode_type { diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 023b7d6912..b4e666ebfb 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2223,11 +2223,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en, struct hns3_cmd_desc desc; struct hns3_ctrl_vector_chain_cmd *req = (struct hns3_ctrl_vector_chain_cmd *)desc.data; - enum hns3_cmd_status status; enum hns3_opcode_type op; uint16_t tqp_type_and_id = 0; uint16_t type; uint16_t gl; + int ret; op = en ? HNS3_OPC_ADD_RING_TO_VECTOR : HNS3_OPC_DEL_RING_TO_VECTOR; hns3_cmd_setup_basic_desc(&desc, op, false); @@ -2250,11 +2250,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en, gl); req->tqp_type_and_id[0] = rte_cpu_to_le_16(tqp_type_and_id); req->int_cause_num = 1; - status = hns3_cmd_send(hw, &desc, 1); - if (status) { - hns3_err(hw, "%s TQP %u fail, vector_id is %u, status is %d.", - en ? "Map" : "Unmap", queue_id, vector_id, status); - return status; + ret = hns3_cmd_send(hw, &desc, 1); + if (ret) { + hns3_err(hw, "%s TQP %u fail, vector_id = %u, ret = %d.", + en ? "Map" : "Unmap", queue_id, vector_id, ret); + return ret; } return 0; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:31.580683300 +0800 +++ 0194-net-hns3-fix-use-of-command-status-enumeration.patch 2021-05-10 23:59:26.650000000 +0800 @@ -1 +1 @@ -From a32eaf435a53b26b9697fcb483612af7de514414 Mon Sep 17 00:00:00 2001 +From f20ccda35a7230052cd5a959c1fb27d46c40fe3b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit a32eaf435a53b26b9697fcb483612af7de514414 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index 1d8ef7a812..df167f1da2 100644 +index 8a48714a54..b45891a7ce 100644 @@ -37 +39 @@ -index 9958fde128..e88bf4a6e5 100644 +index c6fc6c401a..37cb20a9f5 100644 @@ -40,2 +42,2 @@ -@@ -56,13 +56,6 @@ enum hns3_cmd_return_status { - HNS3_CMD_ROH_CHECK_FAIL = 12 +@@ -55,13 +55,6 @@ enum hns3_cmd_return_status { + HNS3_CMD_INVALID = 11, @@ -54 +56 @@ -@@ -72,7 +65,7 @@ struct hns3_cmq { +@@ -71,7 +64,7 @@ struct hns3_cmq { @@ -64 +66 @@ -index 846e5a27c2..05ccc2eeb4 100644 +index 023b7d6912..b4e666ebfb 100644 @@ -67 +69 @@ -@@ -2310,11 +2310,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en, +@@ -2223,11 +2223,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en, @@ -80 +82 @@ -@@ -2337,11 +2337,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en, +@@ -2250,11 +2250,11 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id, bool en,