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 8D01F428F8 for ; Sun, 9 Apr 2023 17:31:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87AB442C54; Sun, 9 Apr 2023 17:31:58 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) by mails.dpdk.org (Postfix) with ESMTP id 2305F41156 for ; Sun, 9 Apr 2023 17:31:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BE3pnSJU/Q40S6mZD2VdskxlKq3c9woEJRhQ2NbKIteuUJDZ0mf04pc4OoWx40MgNkytv/xBlfUkW55lvUZP1XquAZAQEkpLGMrFuMVv6+RwYBLQyLn570TOrlf2gkbR0vgQi1/6N6PNNDPw/OiEIDymK7bdouGJFpuhCoGLZGyB73CJlOhKHCowv6s3fB1N0rp/FbiJCSoqTY5DYTknT1IawdtTfcqRVL0MLS1Gk2Ya1eY164+mZLXYQb9Nx3Dvp5sOQvq9R3sQqabK9nj3XrjEK7JT1xYH3x4+wiaB7QnkQaMsnSd5msArf9X2UiroX/ndwreqiQT66WfYP1RLSA== 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=pcrJ7mNqx2TY5Twaji9zneqiAeWlL3ftE97b1K+AZD0=; b=GgmcHafCdInvtSRQ40+tPwxzdLcYZ6pcJ7OTMj4W0qkfnxaBcCB4r9F/0pj7hNAoPrnujeMYL5mAcvTZj0UlKHSh7I4b4X9haPa5QxdLRGYFTL3OGycAe0cxBL7WhJWgKQA9DSRoTJJ8unMismiYvRvoIntxYU5cdL+nSQKVNOvGfd9xo2q5OHJs1bPgO2NJjP590pgaX5xLMx4pzQVvQh7feL+cFbfs6f72zWYZqzxeP0t4AvEQEQV+QHHBo7pnmnnYtkaUIjYdHxjgCjuMp9h/5mw8sjG8bdI+gVsJ/Uag9TkPoH7EXGZFhmIvNojoHxkjCYHwlvA0Bw6lHJ1tCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=pcrJ7mNqx2TY5Twaji9zneqiAeWlL3ftE97b1K+AZD0=; b=nHjMXTsj0ckdK5CxZrHg7e/4SXxmzKbLrdvqccTBtzux9JLDEspYo21VjmfeFf8b121hfkSlcNmPvsAcZraLLMOwtIulJYXboo9gf/UsOj8oaPr/1XgDeMuoK87Z//sk/8evaSJUkYdZ4RzgmyaXFUvVhkkkCYnnPijUbphtvxV6oULrETNoNwhr9qcxQb13BqR+FEOsmMCfC4Zer8cX26joEf5MvN1xzIqYxyk9i0i0ZBkfsrGT6gB7IjXvF5P253PLIcO+qF95kn9eVcjPADQDAlfHxoLCqLhaBlI3l2nL7+q8/tbt7mYE6H10ZBJ5DckFYCm9iNrEuIvLhJ3LXA== Received: from BN9PR03CA0986.namprd03.prod.outlook.com (2603:10b6:408:109::31) by DM4PR12MB8557.namprd12.prod.outlook.com (2603:10b6:8:18b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Sun, 9 Apr 2023 15:31:54 +0000 Received: from BN8NAM11FT076.eop-nam11.prod.protection.outlook.com (2603:10b6:408:109:cafe::96) by BN9PR03CA0986.outlook.office365.com (2603:10b6:408:109::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Sun, 9 Apr 2023 15:31:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT076.mail.protection.outlook.com (10.13.176.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.25 via Frontend Transport; Sun, 9 Apr 2023 15:31:54 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:31:47 -0700 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 9 Apr 2023 08:31:45 -0700 From: Xueming Li To: Huisong Li CC: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: fix possible truncation of redirection table' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:24:21 +0800 Message-ID: <20230409152529.5308-74-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT076:EE_|DM4PR12MB8557:EE_ X-MS-Office365-Filtering-Correlation-Id: 57734096-c32c-47a4-9f47-08db390f8c6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TRswA4U1PZSiDJl8r514IDEns/MrTPpmz8iFo71NL8mmjvdJbpjIKYgLQTCLoW7A0hrNoNw/AGPLPHm6ukpDGZhJCSM0H7VMlK5Q+S92jdWUw/4OAlKN3YQrM/m588QNKQMEHtvlfNs0zE65nz+xZ/76GESIWjF3AXKpRBFqulc6MSwIxeIUb3cOkqfE+B8/ECyoWdkcwXB/KcYie1L0dkS/DaZGGow9/zTNR+YPacCZFnR7m+9K+774ik9pbdjPuyrWxw/XEikXFdSZRJ12oAkcjQLkD98mCzm3SsSy70NM8rmueV7ALWt0xdTlgLuaP67rKFQ1Lb2J6ON+wGpx8YmJgi+io3pRNN4435Ns7iCy2QBykovc3tEZzAaE8nJwXckxe8b9AKVtwbNJFf9z3EezOjGoB8ZAO4DN3uUlbwA/gF3wL6Ps1UPRvN85edUfmYUl4kMuXZfGqlJg+a3C62hv85jLpRyq2jnK0MJ+P7cSOJJAex1N/WGT5UOE4NmHKgfRtQ4RSFYEhbM2jijLJ4vaHhwSAbk7YUGo81ttfYUsz2vzLtyL8+aA3/3DqWktmik4dJo7Egyo6v+2ERznlPKDlK2oE4u/F2uFAb5FUy5XSFJhNyiTKfNVYs9CKEqklXbXqRaTAa9fZNdE0OreXOWJhNlBm2yZ9FfBXI5eNv6NquF2M37EGq7eIP4X058e6giHbjm8F/GgZcPfffcwXl8VnyRJ76lK8a5YsginKWByJz65Za+HYL4DO8R5/Cc9lCTQklw7WVrzVygw6t9V1FN0U6EphwG2rLBJEjOmiKtFL7OCzBc2JkZxm5XO1G/wv8qOUFB6UcUFEvFg/Y4RPQ== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199021)(36840700001)(40470700004)(46966006)(53546011)(70586007)(70206006)(86362001)(26005)(1076003)(316002)(6916009)(4326008)(6286002)(186003)(40460700003)(16526019)(36756003)(6666004)(966005)(7696005)(54906003)(82310400005)(40480700001)(55016003)(478600001)(36860700001)(8676002)(8936002)(2616005)(5660300002)(356005)(41300700001)(7636003)(47076005)(2906002)(83380400001)(336012)(426003)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:31:54.4156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57734096-c32c-47a4-9f47-08db390f8c6d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT076.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8557 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 22.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 04/11/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/5042fd84592f5d876da1b89df48b5a52670e9e3e Thanks. Xueming Li --- >From 5042fd84592f5d876da1b89df48b5a52670e9e3e Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 10 Mar 2023 17:35:04 +0800 Subject: [PATCH] net/hns3: fix possible truncation of redirection table Cc: Xueming Li [ upstream commit 4729376e555b58a739e6e231d403ca3b029ad92c ] The size of the redirection table is obtained from firmware. If the size isn't a multiple of HNS3_RSS_CFG_TBL_SIZE, the redirection table from user will be truncated. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_rss.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index 2011c18b9b..ed397587b5 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -329,6 +329,7 @@ int hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size) { struct hns3_rss_indirection_table_cmd *req; + uint16_t max_bd_num, cfg_tbl_size; struct hns3_cmd_desc desc; uint8_t qid_msb_off; uint8_t qid_msb_val; @@ -337,14 +338,20 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size) int ret; req = (struct hns3_rss_indirection_table_cmd *)desc.data; - - for (i = 0; i < size / HNS3_RSS_CFG_TBL_SIZE; i++) { + max_bd_num = DIV_ROUND_UP(size, HNS3_RSS_CFG_TBL_SIZE); + for (i = 0; i < max_bd_num; i++) { hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INDIR_TABLE, false); req->start_table_index = rte_cpu_to_le_16(i * HNS3_RSS_CFG_TBL_SIZE); req->rss_set_bitmap = rte_cpu_to_le_16(HNS3_RSS_SET_BITMAP_MSK); - for (j = 0; j < HNS3_RSS_CFG_TBL_SIZE; j++) { + + if (i == max_bd_num - 1 && (size % HNS3_RSS_CFG_TBL_SIZE) != 0) + cfg_tbl_size = size % HNS3_RSS_CFG_TBL_SIZE; + else + cfg_tbl_size = HNS3_RSS_CFG_TBL_SIZE; + + for (j = 0; j < cfg_tbl_size; j++) { q_id = indir[i * HNS3_RSS_CFG_TBL_SIZE + j]; req->rss_result_l[j] = q_id & 0xff; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:40.644186000 +0800 +++ 0073-net-hns3-fix-possible-truncation-of-redirection-tabl.patch 2023-04-09 21:45:38.689042200 +0800 @@ -1 +1 @@ -From 4729376e555b58a739e6e231d403ca3b029ad92c Mon Sep 17 00:00:00 2001 +From 5042fd84592f5d876da1b89df48b5a52670e9e3e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4729376e555b58a739e6e231d403ca3b029ad92c ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org