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 03409A034F for ; Wed, 10 Nov 2021 07:36:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC98B4068B; Wed, 10 Nov 2021 07:36:30 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2063.outbound.protection.outlook.com [40.107.220.63]) by mails.dpdk.org (Postfix) with ESMTP id 096AE40142 for ; Wed, 10 Nov 2021 07:36:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hHNpQnTTx6aed4BpOE3dtGBKG9xWKVqki4TFDUhrmziYrW/j9XF+1U5R9VOOBwVEYD4Ck8Qgi71cy1APSPdC/UOHGT3wcIuMkDuuiPoa6SNoHPDDAq4JWg+j9oQjollnV+1E/o8lM2Yud8oOwAmrd95LSKniBNW8mLabHxrYz52vYZcUTwe6VxIxrXQsNRjcLYWy5DGu2TOqWO8NEmDXdoGJCiAd4Xemd62Wu9EXPVF34FXejefpGt9+l9D/wRXKhN9HbeLhPhRjqsvqGqZr17jb4qQG23F+S0wPMp21HqoFSyf8D0Xvj5X9n48g9daORJ5uN7C3ASbezNhKnlni5g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ADO43yD3pqQllonpw5nG2Y6jqhh6vwBmsY06ct6G9Es=; b=QM4AoomivcjJSCR+Mkqc7b1YwLb4FsMzLWl+cEoGFWf+5BNnnTm8A12w6BCP5fCiF7A9cuffXrP2Zyj5jK/yQBOQ4cKI5NtB+sD88jqqFTy1nj6AwdeUslcPQaT7J4ahOS/0u8L1MeH5FSQV/OLTthtKANV5ONlLr3HmCPy1nIpF0cAt4B38JoNOY5BQULRSN8/V6rBysBLE9WxXHV/Kt9K2+x5kXEAdDreAIT39Y64LfhIYUSN7wVy8WxpYLboJZl5huGyLQrwhRPn3dQgFvuXNWiPzfHK0kkBe5r9GEfBNecS4zulkKku07yYiIj1PZlrFhpYQzzzf7Y/VeXBSCQ== 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=quarantine sp=quarantine 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=ADO43yD3pqQllonpw5nG2Y6jqhh6vwBmsY06ct6G9Es=; b=AOCsWPagCNkwgBICD+Q2k7dgPQcduO2Mop3M1o15shssxHbqX/YMNDhA1ZmUM5HuJF0UxvOdlOOrMB8nBOKQF1KhZF8bUJzCdSKKPCUmEZrIxJJWglKqEcmDuhlM7oFLDjgSFzA9e6bDme+nBOKzv05gZIMpPSuu8ha4wVFZuVIwBqJgPtLlvo448oGUWB2E05AkMR7O/12wCor31WNrefg3r0MBD5ulYUhC5gguSLTM/ivW6EFv46hXiRt2GnrfsMcwmjbOVUtoApBFDpZ6NKDatxIONXSiVhvrV7bSG1tdOjbxluerQBlnr4t1r4ts8rT7F49Ccs2FyUTUkyYwYA== Received: from DM6PR13CA0046.namprd13.prod.outlook.com (2603:10b6:5:134::23) by BL1PR12MB5364.namprd12.prod.outlook.com (2603:10b6:208:314::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Wed, 10 Nov 2021 06:36:27 +0000 Received: from DM6NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::bf) by DM6PR13CA0046.outlook.office365.com (2603:10b6:5:134::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.6 via Frontend Transport; Wed, 10 Nov 2021 06:36:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;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 DM6NAM11FT003.mail.protection.outlook.com (10.13.173.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:36:26 +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.18; Wed, 10 Nov 2021 06:36:22 +0000 From: Xueming Li To: Chengchang Tang CC: Luca Boccassi , Min Hu , dpdk stable Date: Wed, 10 Nov 2021 14:28:39 +0800 Message-ID: <20211110063216.2744012-36-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-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: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3df96694-de29-482a-54ea-08d9a4146c0a X-MS-TrafficTypeDiagnostic: BL1PR12MB5364: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RTPeUog+Qhs0toYWp4mmrVw2o8QhoWWBdp2TqafmiAXmUV96U5V94//gOhQVuk137NlfVH95fVbr2ogZNpZ23jZUr+lECh0Tql+h5c6oqeOk9MaiQdO1uGBTwrCEyteG4hdmwGt6T1EXtHx2N3ZzBsc1qdEcjW5DsEqn1B5qA3opQdF0P9Wg+WjEUHjukwtUAzvyiDdTRdbSy8TCfDIOk8WGinxpYYkAOwj2jtueyGxoCkgqUNf/xU4+eZsfJOEF9fVXvUTYgh3q65ji1Ao+wGUe1u0hz/TLWbgP4HRAY1PIKQe5Fyma/PLFC8c3DWq6DzI9xvIJgaPmnkzxc4i7cVTB3pLXFUUf/CZwo9GUgrYgk+V8mPm3HcHrVxV9CO66BxLQfPdN3aznRoTxmcIdR9zGCrIjBtuw3chq5F7qSWN/Xvzk1bIM1VLXAtH4EI3fPsWlIS5CglRy58sGTOdtVY7RR4LTokg0VOb9v1GF76PonpBI0QjHU2vxh3J5lDi4HUfZVIfk/ZwTWUdjXVAniY0ZhgjHdHSgRmi/fyrW7ZFosDkTMP4CqUDdfsmZuh/mq7qx16luJ/u5ICTggJ1kuOpDR35IwrBrBV4Y0U+WY6sacOvh4qtQpBeIg1gQRm7xch0AkO3fTr1rY7GYC73ftQ2jWVCPwxRmyabsfcN00gvE25inNWWPAz/3M1+hF98PgTSRMB+Svi9YVZgycZvXumz8fns0uTKf/QQCSxcCGALqREhGJrkIUjSDDkhGrT/s4BEgQ/UgsaTKWxXRKoor1GV9g6oCs3BtodstjK0gQREzvaWnCa9wTXWG9GLV5qfDeNeaOPGRkBs98Lx8lruOHg== 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)(4001150100001)(7696005)(47076005)(4326008)(83380400001)(336012)(70586007)(82310400003)(55016002)(966005)(36756003)(1076003)(426003)(2906002)(86362001)(2616005)(6286002)(356005)(8936002)(36906005)(508600001)(5660300002)(316002)(6666004)(26005)(70206006)(53546011)(6916009)(36860700001)(16526019)(8676002)(186003)(7636003)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:36:26.7294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3df96694-de29-482a-54ea-08d9a4146c0a 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: DM6NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5364 Subject: [dpdk-stable] patch 'net/hns3: fix queue flow action validation' has been queued to stable release 20.11.4 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/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/0c355fecc0a6662a3fb9e97e56186e9565dd678b Thanks. Xueming Li --- >From 0c355fecc0a6662a3fb9e97e56186e9565dd678b Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Mon, 30 Aug 2021 16:26:49 +0800 Subject: [PATCH] net/hns3: fix queue flow action validation Cc: Xueming Li [ upstream commit aa3497d4450a603ca18ae4971a96e3890824d887 ] The used_rx_queues only takes effect after device is started, and its value is incorrect before the device is started. Therefore, it is not suitable for flow action to use it to verify the queue index before the device is started. E.g. Enable dedicated queue in bonding device will configure a queue flow action before start its slave devices. The above problem will make this reasonable flow action configuration fail. This patch use the nb_rx_queues from the configuration phase to achieve verification. Fixes: a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues") Fixes: f8e7fcbfd0b8 ("net/hns3: support flow action of queue region") Signed-off-by: Chengchang Tang Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_flow.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 70c45f6bc5..7f8dd91d11 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -275,10 +275,10 @@ hns3_handle_action_queue(struct rte_eth_dev *dev, struct hns3_hw *hw = &hns->hw; queue = (const struct rte_flow_action_queue *)action->conf; - if (queue->index >= hw->used_rx_queues) { + if (queue->index >= hw->data->nb_rx_queues) { hns3_err(hw, "queue ID(%u) is greater than number of " "available queue (%u) in driver.", - queue->index, hw->used_rx_queues); + queue->index, hw->data->nb_rx_queues); return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF, action, "Invalid queue ID in PF"); @@ -308,8 +308,8 @@ hns3_handle_action_queue_region(struct rte_eth_dev *dev, if ((!rte_is_power_of_2(conf->queue_num)) || conf->queue_num > hw->rss_size_max || - conf->queue[0] >= hw->used_rx_queues || - conf->queue[0] + conf->queue_num > hw->used_rx_queues) { + conf->queue[0] >= hw->data->nb_rx_queues || + conf->queue[0] + conf->queue_num > hw->data->nb_rx_queues) { return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF, action, "Invalid start queue ID and queue num! the start queue " -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:03.677735225 +0800 +++ 0035-net-hns3-fix-queue-flow-action-validation.patch 2021-11-10 14:17:01.780746827 +0800 @@ -1 +1 @@ -From aa3497d4450a603ca18ae4971a96e3890824d887 Mon Sep 17 00:00:00 2001 +From 0c355fecc0a6662a3fb9e97e56186e9565dd678b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit aa3497d4450a603ca18ae4971a96e3890824d887 ] @@ -20 +22,0 @@ -Cc: stable@dpdk.org @@ -29 +31 @@ -index fc77979c5f..841e0b9da3 100644 +index 70c45f6bc5..7f8dd91d11 100644