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 02A21A0A0E for ; Mon, 10 May 2021 18:05:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0B81410FE; Mon, 10 May 2021 18:05:00 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2063.outbound.protection.outlook.com [40.107.223.63]) by mails.dpdk.org (Postfix) with ESMTP id DD34640140 for ; Mon, 10 May 2021 18:04:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gwK3zBoEbVomh5k5QYNG/ZRb0PjnJ5jb8bx4wXcGo37S+saaxzA44rN2EW/6PE/l75JrDDX5ShD77VyA2VUtpWKXkAXlJ21NF79Ou/wUpmRm1DQ+lPnR9jVYt74CmOEdHQfQrKH1e5s0bUQrpeqq+Z6ld0F7TmLs7veO3C+UnKBgIK380+WlDjM56OaaOqOlY5ocCgm9eiDLIgsD2gSGb3fXjHD1boHk8RR70nHXniGqefDMWj89HPuNQEUlQdFEEV5B8eSpLnpSsXQNtekdDPjofZWdCDEMYuB526aS3wxlfBg7m/+P/qr0hq52opyyWaKAz/InDKvROq1ZkTw4Gw== 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=in+rQUSEvVRjxBFIEYwVoO0isy1TOgNUIvth8My4zTw=; b=ZGX5i2nbRLkW0rwR622SIXaj50uqLTeRhqheLD1VACRfJv+pyyoKZ3aKNPM2PXoYkgpDD9d/MBGJRpOW+g32/9z57nR6ncFr5C2spSODmxUNqXjAVgYcagcRY945yJKvPbux1j5phBK6OroaP22XIuZqtGzDWWZuTHT9MzKTfLuGeEaMUdgeYn0bttjeky2wmSdcvucY6/3K4TOgoTzJvjX00KbewqVbdKCl+oXY672qhbCydy5dxVUIIwdDE8wlDQrWwnVNBhdktZQSVRL+f1DakR+9+VVpljWb6umwmkfHfiCc/riZGQYgPRyL8mRtcGkkd0T/gmu2MGM47oUA4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=xilinx.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=in+rQUSEvVRjxBFIEYwVoO0isy1TOgNUIvth8My4zTw=; b=rwft8xSQNabGECcwQQ+loPenHBn0xMLINVjRkA2SlyuZLKkZUKAIA2FZ56u2YszUGo3RJxb021Qc1f4zEDlAfSLN9i8gpQ2+vCibgC4DWUK7EuqABVECDNnyC+V/HoUiURjvL2OE8N7YcgskoLzLHNRHQpgd58g8dnefqSgp1L99pVJVSZX9ojJlWbb99r4QeXJHHlTLZmHrlKNO2VZ49Onls49mNo2CSRT05L8UOJYIwvVzL0l2K74g13FVapWwGHHwAmVSciOXhz0ejQW1zd2kBPX6HLKRr4qh8U1vYR/To8w6sCNy5LQuusBnXjv6ew2dAj6oSWOS96YwDJPUIw== Received: from BN8PR03CA0035.namprd03.prod.outlook.com (2603:10b6:408:94::48) by SA0PR12MB4496.namprd12.prod.outlook.com (2603:10b6:806:9b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Mon, 10 May 2021 16:04:58 +0000 Received: from BN8NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:408:94:cafe::bf) by BN8PR03CA0035.outlook.office365.com (2603:10b6:408:94::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:04:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; xilinx.com; dkim=none (message not signed) header.d=none;xilinx.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 BN8NAM11FT067.mail.protection.outlook.com (10.13.177.159) 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:04:58 +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:04:55 +0000 From: Xueming Li To: Ivan Malov CC: Luca Boccassi , Andrew Rybchenko , Andy Moreton , dpdk stable Date: Mon, 10 May 2021 23:59:26 +0800 Message-ID: <20210510160258.30982-17-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: 3fbcf6d3-a074-4f21-b1ac-08d913cd5c31 X-MS-TrafficTypeDiagnostic: SA0PR12MB4496: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: amu9zcpZmCl3z/iJ0jI4T4NKoJXsAvbisynCtfBuzyWvPr0ts2ZeuzaT08v7g6FvbGR9DpeAxWo+JJMS/uYDfh/K8Z7d02OZiSOMQCyGEEIDxNrFSz8qKtb7dTmFtDJqz0V5NoBv7W7gSbKG50pMNCFKCzN3OOd8DJBvzbeuXN/UJp6SB2M9mwH0LY+q1jecTrquK56KTsag1AKd2JgqStFM4rul78R7mNxTKv5DgiclUINmgviJdQKZ7use+KKZy5VhJsFVhBz/R/XiAAw4wYu52roW3fS6JLYcGRz8GZ2wPjE+62cdlnaxtjd3IvBD7UtG99AItCXr8OQUQCwWKylftwQzCop5JyjZYCLmCZ9D2vIBC+68ipibGbZJcCxuO/zE9tkhMpaYga/UJ7AK5YRZRcbS8spNitBhQdwrVM1pnjnwAA5cqSGPXXFGmC+LFIdCClDskeQutt909y1+LOKnw1NFeCAqvEsz7oXgNUzjBTNib0WF9poMTTfLWkSKWUrzcQSALmXcPfSq0tS8IocpCTO4178wqJPVGk6CAaqRs6Bz/3OWBbe7uDo7u7QxxptWYoS2MQ4lOL9ju3uwgb8dTKD9qTqYBxS8XCufXjUKRqoor1Ym5NAJztuFLnb570eK6hzjgiH9cREd2ji2ZAT3M0anH15O28fgr8dCGyMpVRibsuAmj7kOheNqQIZCvPmFiqCBJ9E78vk4IYH3Nz1kadlO/N//sjd9kZAMtaM= 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)(136003)(376002)(39860400002)(396003)(346002)(46966006)(36840700001)(54906003)(6666004)(70586007)(5660300002)(53546011)(47076005)(70206006)(2906002)(16526019)(83380400001)(186003)(478600001)(4326008)(316002)(8936002)(82310400003)(8676002)(86362001)(36756003)(26005)(55016002)(2616005)(82740400003)(426003)(7696005)(6916009)(7636003)(36860700001)(966005)(6286002)(36906005)(1076003)(356005)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:04:58.3790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3fbcf6d3-a074-4f21-b1ac-08d913cd5c31 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: BN8NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4496 Subject: [dpdk-stable] patch 'net/sfc: fix buffer size for flow parse' 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/32ae43ccb7f2fb0717cff7e741aadc9e2a9725ad Thanks. Xueming Li --- >From 32ae43ccb7f2fb0717cff7e741aadc9e2a9725ad Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Fri, 26 Feb 2021 17:10:23 +0300 Subject: [PATCH] net/sfc: fix buffer size for flow parse Cc: Luca Boccassi [ upstream commit 05cc6e33961b41df6cdc37fd429e06c28c78a84e ] Pass the size of the buffer where the item's mask is stored and not the indirection pointer size. Coverity issue: 363735 Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules") Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_mae.c | 20 +++++++++----------- drivers/net/sfc/sfc_mae.h | 3 ++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 4ddfef5563..15c5c39758 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -1395,7 +1395,6 @@ sfc_mae_rule_parse_item_tunnel(const struct rte_flow_item *item, uint8_t supp_mask[sizeof(uint64_t)]; const uint8_t *spec = NULL; const uint8_t *mask = NULL; - const void *def_mask; int rc; /* @@ -1417,12 +1416,11 @@ sfc_mae_rule_parse_item_tunnel(const struct rte_flow_item *item, * sfc_mae_rule_encap_parse_init(). Default mask * was also picked by that helper. Use it here. */ - def_mask = ctx_mae->tunnel_def_mask; - rc = sfc_flow_parse_init(item, (const void **)&spec, (const void **)&mask, - (const void *)&supp_mask, def_mask, - sizeof(def_mask), error); + (const void *)&supp_mask, + ctx_mae->tunnel_def_mask, + ctx_mae->tunnel_def_mask_size, error); if (rc != 0) return rc; @@ -1656,20 +1654,20 @@ sfc_mae_rule_encap_parse_init(struct sfc_adapter *sa, case RTE_FLOW_ITEM_TYPE_VXLAN: ctx->encap_type = EFX_TUNNEL_PROTOCOL_VXLAN; ctx->tunnel_def_mask = &rte_flow_item_vxlan_mask; - RTE_BUILD_BUG_ON(sizeof(ctx->tunnel_def_mask) != - sizeof(rte_flow_item_vxlan_mask)); + ctx->tunnel_def_mask_size = + sizeof(rte_flow_item_vxlan_mask); break; case RTE_FLOW_ITEM_TYPE_GENEVE: ctx->encap_type = EFX_TUNNEL_PROTOCOL_GENEVE; ctx->tunnel_def_mask = &rte_flow_item_geneve_mask; - RTE_BUILD_BUG_ON(sizeof(ctx->tunnel_def_mask) != - sizeof(rte_flow_item_geneve_mask)); + ctx->tunnel_def_mask_size = + sizeof(rte_flow_item_geneve_mask); break; case RTE_FLOW_ITEM_TYPE_NVGRE: ctx->encap_type = EFX_TUNNEL_PROTOCOL_NVGRE; ctx->tunnel_def_mask = &rte_flow_item_nvgre_mask; - RTE_BUILD_BUG_ON(sizeof(ctx->tunnel_def_mask) != - sizeof(rte_flow_item_nvgre_mask)); + ctx->tunnel_def_mask_size = + sizeof(rte_flow_item_nvgre_mask); break; case RTE_FLOW_ITEM_TYPE_END: break; diff --git a/drivers/net/sfc/sfc_mae.h b/drivers/net/sfc/sfc_mae.h index 53ddead979..bf432638c1 100644 --- a/drivers/net/sfc/sfc_mae.h +++ b/drivers/net/sfc/sfc_mae.h @@ -179,7 +179,8 @@ struct sfc_mae_parse_ctx { * which part of the pattern is being parsed. */ const efx_mae_field_id_t *field_ids_remap; - /* This points to a tunnel-specific default mask. */ + /* These two fields correspond to the tunnel-specific default mask. */ + size_t tunnel_def_mask_size; const void *tunnel_def_mask; bool match_mport_set; struct sfc_mae_pattern_data pattern_data; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:27.163305100 +0800 +++ 0018-net-sfc-fix-buffer-size-for-flow-parse.patch 2021-05-10 23:59:26.340000000 +0800 @@ -1 +1 @@ -From 05cc6e33961b41df6cdc37fd429e06c28c78a84e Mon Sep 17 00:00:00 2001 +From 32ae43ccb7f2fb0717cff7e741aadc9e2a9725ad Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 05cc6e33961b41df6cdc37fd429e06c28c78a84e ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org