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 2D421A034F for ; Wed, 10 Nov 2021 07:46:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27DFD4014D; Wed, 10 Nov 2021 07:46:41 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by mails.dpdk.org (Postfix) with ESMTP id 99AFC40E28 for ; Wed, 10 Nov 2021 07:46:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WHUWbuFCFKIhdRd0Xte8zxx7Uq2ofmskipqsBi603oy+p3u8JMRZpsC6dEAsv8wsTXshgPevD73ALEx/273jGlXzTp2fLMGf5ErJR7eO4bYQiQgOhER/tV5/PXKfqTvk91gFfH06sPIQ7Yrhi/kX8ngoiKponLPafp5bcDrq1gmV6PGj3cwm2mfwq7B8Z3AuETQ1VuMIaB1xLqw/CZc3XQHHq8hXovrcpeNFLoL1wnbBxlytUVNbGmHngKEBcdq3tJf2uw4jOO/oYPjlYdF7A8RDKn6EMcT1vYgHUiLK2pWOmbH+bqSFyCkZJXRScgjE/e1XE+1Bm98URZKpJcSFkw== 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=Dp9fQ1RpGIastPBCV/6iIubaa25nwFU+e2wtmjX1uXA=; b=cExLSA+/6r8FxELTL0vqiqLoFS4X/K+MOj1piGitdMtbCJAoSlxkbNFzKE0qWSl32vfh/6ifgyCSXiDfGlycxuxH6VM2p92KOAkW88b2JWcrFSbU667mAnU1Q1yg32mcI5r9aVye2ZqQjz+YUe/lYX0LlgpJiUvfE86oMu45/ELHZc6tsp3iCAp3kuTliOLpktL2TiZtWG/tEaXnWNy8tsQ+wnkkviINrcMVHi06vAk9wbFjg62VoQHvOAQk9zDHweLp4d9N7kQS8K6E9bl0s1H++QAFghXG70BAlxwlvGK/OxI17JjLL8NxepWnWWtJcYeGyWLTfov2JwYI9to/oQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=oktetlabs.ru 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=Dp9fQ1RpGIastPBCV/6iIubaa25nwFU+e2wtmjX1uXA=; b=N37XqNp6KxOaXTR9/LPHe957aShrwpMTNMb+UkIrb0BuF3DMm/5hlx0shI3fBriECAHm+ZdPmjbySArXNaZYL2Ai4GFm1+SRYjSvZGaTbEAKJGPul90url7bKqJIFHZLQJZI6NF+p+CzG7wq6/FSYvVfKzUutKwcFVx+cixX28i1j9Br+BSJdrFsWM0Xqh/MYdfRNPYyo3xxLiVZIbjrs/OcCoionhEIxIeuGt7/cCHG5SZBmqUP5CbBeLRYdVvl8b7gc2b8px35JyiM102ru4mpmRTPBncW8M698LrZ+pQ8BdTnxL39NDbmZoW78OjETd1Tgedl8wyCaLv9XKHDmw== Received: from BN9PR03CA0634.namprd03.prod.outlook.com (2603:10b6:408:13b::9) by CY4PR12MB1304.namprd12.prod.outlook.com (2603:10b6:903:41::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:46:38 +0000 Received: from BN8NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13b:cafe::40) by BN9PR03CA0634.outlook.office365.com (2603:10b6:408:13b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:46:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; 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 BN8NAM11FT036.mail.protection.outlook.com (10.13.177.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:46:37 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:46:35 +0000 From: Xueming Li To: David Marchand CC: Luca Boccassi , Stephen Hemminger , Andrew Rybchenko , Ray Kinsella , dpdk stable Date: Wed, 10 Nov 2021 14:30:11 +0800 Message-ID: <20211110063216.2744012-128-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.6] 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: f2d28e95-4eb8-4b3f-5db8-08d9a415d7e8 X-MS-TrafficTypeDiagnostic: CY4PR12MB1304: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kJll6bcV5U27UwrZGwi+r5cAmmdjJryUfUAWuOwUG282Zw/TflMJV58C9rN13/itkVOBJNgkjwIFWc/gkOS7OL6X6tcugsbaVXgq5ncPGrtQOJYpiVUrRsrqa/1cAz397HoRc9wY4KPoYIZ2ohE1RxYqsejpMDTuJlCDvSkWMR9C9WWepKlr0C5+JucPWP+yUmuRJx3dDEulWsbMcNGXCelab4b1dXcPPL0c4zGWh95El+jJ+P4rOLOQenj8vo6yi9LpvyEIZH/JGqGMAqpQDHdixsp2X762tMJCMsnbBL+zdXEcdsr/0MiILzecuYX2d/Z61bAn3zquh4QiY3KngkKV7G6kPjlHg2qsW2wmedDy+dMn2kSm4aXIVPQ/KT13frIoQVgDZFuhhW51zK3LU+0ClGfQUAGjOwmQRE96AJDPVUvaf08OsXr1ryTlaF5KrL+eWWnvF33uet511LjQDMjGs8zIoWmnEwVNraxmR1aM/gacAGojs6YeOYZWULOT/YgBbGAcp9Bq4L1eu3ck173Pi02lEIc1kCjAzc0jL+4ccAChoEF+tH8sVO43o8m+axsweMPxZExeT+5MarSJcWy0JgEfEiHA3hAotUqcruEAS4U+PwUQaOK7kbAc8gkUPf+BJ5IN5BfFhm/rds5scJF18WO75aK3QIJ+oj/yQ8Qzu8Rhg62BXHB106hBR9mQ6nz5Z2kDfo9vNbnfVNTXwmUSKCOXKd9vCnlqCVxmkEL0ZmKZb3PFckkEQ6WWADgYKdCLtCDCsE61bnlooeEAQn90BRbztty2piFiuMNjvOCbm7SAnmSuHvQmOFWd8sDFlJt3xXx6p9OR2AYRGd+eTw== 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)(186003)(6916009)(6666004)(6286002)(7636003)(16526019)(55016002)(4326008)(336012)(86362001)(1076003)(4001150100001)(36860700001)(8936002)(47076005)(53546011)(316002)(8676002)(508600001)(7696005)(70586007)(36756003)(70206006)(54906003)(2906002)(5660300002)(356005)(966005)(2616005)(426003)(82310400003)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:46:37.1585 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2d28e95-4eb8-4b3f-5db8-08d9a415d7e8 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: BN8NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1304 Subject: [dpdk-stable] patch 'mbuf: enforce no option for dynamic fields and flags' 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/c24b889037a2852b55fb03e90797afa7c2f5bafa Thanks. Xueming Li --- >From c24b889037a2852b55fb03e90797afa7c2f5bafa Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 12 Oct 2021 21:39:57 +0200 Subject: [PATCH] mbuf: enforce no option for dynamic fields and flags Cc: Xueming Li [ upstream commit e9123c467dbb471a2d41ea896423a81886ef89d7 ] As stated in the API, dynamic field and flags should be created with no additional flag (simply in the API for future changes). Fix the dynamic flag register helper which was not enforcing it and add unit tests. Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags") Signed-off-by: David Marchand Acked-by: Stephen Hemminger Acked-by: Andrew Rybchenko Acked-by: Ray Kinsella --- app/test/test_mbuf.c | 18 ++++++++++++++++++ lib/librte_mbuf/rte_mbuf_dyn.c | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 5bb4786e5a..2bccaa03b1 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -2577,6 +2577,16 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) .align = 3, .flags = 0, }; + const struct rte_mbuf_dynfield dynfield_fail_flag = { + .name = "test-dynfield", + .size = sizeof(uint8_t), + .align = __alignof__(uint8_t), + .flags = 1, + }; + const struct rte_mbuf_dynflag dynflag_fail_flag = { + .name = "test-dynflag", + .flags = 1, + }; const struct rte_mbuf_dynflag dynflag = { .name = "test-dynflag", .flags = 0, @@ -2638,6 +2648,14 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) if (ret != -1) GOTO_FAIL("dynamic field creation should fail (not avail)"); + ret = rte_mbuf_dynfield_register(&dynfield_fail_flag); + if (ret != -1) + GOTO_FAIL("dynamic field creation should fail (invalid flag)"); + + ret = rte_mbuf_dynflag_register(&dynflag_fail_flag); + if (ret != -1) + GOTO_FAIL("dynamic flag creation should fail (invalid flag)"); + flag = rte_mbuf_dynflag_register(&dynflag); if (flag == -1) GOTO_FAIL("failed to register dynamic flag, flag=%d: %s", diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c index ca46eb279e..d55e162a68 100644 --- a/lib/librte_mbuf/rte_mbuf_dyn.c +++ b/lib/librte_mbuf/rte_mbuf_dyn.c @@ -498,6 +498,10 @@ rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params, { int ret; + if (params->flags != 0) { + rte_errno = EINVAL; + return -1; + } if (req >= RTE_SIZEOF_FIELD(struct rte_mbuf, ol_flags) * CHAR_BIT && req != UINT_MAX) { rte_errno = EINVAL; -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:07.594619788 +0800 +++ 0127-mbuf-enforce-no-option-for-dynamic-fields-and-flags.patch 2021-11-10 14:17:01.887412621 +0800 @@ -1 +1 @@ -From e9123c467dbb471a2d41ea896423a81886ef89d7 Mon Sep 17 00:00:00 2001 +From c24b889037a2852b55fb03e90797afa7c2f5bafa Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit e9123c467dbb471a2d41ea896423a81886ef89d7 ] @@ -19,2 +22,2 @@ - app/test/test_mbuf.c | 18 ++++++++++++++++++ - lib/mbuf/rte_mbuf_dyn.c | 4 ++++ + app/test/test_mbuf.c | 18 ++++++++++++++++++ + lib/librte_mbuf/rte_mbuf_dyn.c | 4 ++++ @@ -24 +27 @@ -index 9a248dfaea..82777109dc 100644 +index 5bb4786e5a..2bccaa03b1 100644 @@ -59 +62 @@ -diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c +diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c @@ -61,2 +64,2 @@ ---- a/lib/mbuf/rte_mbuf_dyn.c -+++ b/lib/mbuf/rte_mbuf_dyn.c +--- a/lib/librte_mbuf/rte_mbuf_dyn.c ++++ b/lib/librte_mbuf/rte_mbuf_dyn.c