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 2CAB7431D5 for ; Sun, 22 Oct 2023 16:23:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09D6F402C1; Sun, 22 Oct 2023 16:23:28 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2058.outbound.protection.outlook.com [40.107.223.58]) by mails.dpdk.org (Postfix) with ESMTP id 81B884027E for ; Sun, 22 Oct 2023 16:23:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=chYSngFCRSQrMaokeyxLFWLzDOvIj4ck5aAZLSGknSgxYeCqKUAwYumX881hfrdt4fbbePgC63AP3pUKLxA1gUU3hLqivkZW8DU6wDr90R29G6N5B0WO+Yjj9N8kEJUCoJxMKnqT9pICqQ94G7gywzvnhJfBCgwLyyL4t5aKLwpPV6jFqeNfWi4Q7l0TdcpX82MoCeHk11Z+xTLjFB+F16lWSVOOepmnAtTQuY3bdtZTyb4bObDM3uWzozR1utqBANZhka5YcGHrOTTuAoWHC2YxAVJ7+e6l13F1GaT+N7YCZkB4D/SpaJpGJLF/ew12chxfYuhPFXNkmpSSJJidcA== 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=ut09zTl1I9wJ1w4O10E05OG8rdMn6fJeGceZq3QI/jM=; b=K5r639qgiQAJkPBORwLwlmY9iOlg6uYuQAI2HowSqKjPpr7+eN6mXdAA/8DK6nKGOflC2r94/qBJBIxbzpe+fKyKVTAd1+OK0H6z+l3df3njEjWyvuydHA4MTkzEu2tQ8xAzQohHo+bT4PxiKlN18HpnH9UUShUCIj8Uxldix7mNE5Y6ROvSxffWKiaqpDNkohwpxLS0MWnjYoSZPLTF0GKGe1OlGbpQYCzgk46wephkaWT8wd4mrGyBi4uY86z+ZI/gXEmvf5a2GtWbLKB/kUafNB7LR4NlYi6/lJ3kZgJxfhts78RjuG0059B/is144JVqNUnfQy3bXMGquZ+Kpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.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=ut09zTl1I9wJ1w4O10E05OG8rdMn6fJeGceZq3QI/jM=; b=Zchnotq4wKXEWztv5vJ3o/26wf2MRt81Dkd3IV1oBFRYVtj8AjN2TAOaWf/Hz/9rhJx0KYe8fTtz3s/juDCo3a6FLVWGS9y5xDnmmwd9tGAO5x1cHNk9mdEoYaGNSBl5zlzaPYVrA0MoTTF+Jg5FaM10JSMmZC0W0JLXo/uGbUlzmqidfHaCD1tGKPPOgJjuBZsYRlRkWlDFHwhTK0mbPU2oBrJC0lQqqGZD9aTL3JtVQjt+wOwgVdqjKIqqj5XJvZipej2re2e4WTgfimeKkfNuCvwTragT4HInL/WB9P73DmeqEgiKtFY3hUHNqVW251I7GYIq4fDV7rrUh7koCg== Received: from MW2PR16CA0055.namprd16.prod.outlook.com (2603:10b6:907:1::32) by CH0PR12MB5372.namprd12.prod.outlook.com (2603:10b6:610:d7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sun, 22 Oct 2023 14:23:23 +0000 Received: from CO1PEPF000044F5.namprd05.prod.outlook.com (2603:10b6:907:1:cafe::77) by MW2PR16CA0055.outlook.office365.com (2603:10b6:907:1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31 via Frontend Transport; Sun, 22 Oct 2023 14:23:22 +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 CO1PEPF000044F5.mail.protection.outlook.com (10.167.241.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Sun, 22 Oct 2023 14:23:22 +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.41; Sun, 22 Oct 2023 07:23:12 -0700 Received: from nvidia.com (10.126.231.35) 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.41; Sun, 22 Oct 2023 07:23:10 -0700 From: Xueming Li To: David Marchand CC: Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Subject: patch 'mempool: fix default ops for an empty mempool' has been queued to stable release 22.11.4 Date: Sun, 22 Oct 2023 22:20:31 +0800 Message-ID: <20231022142250.10324-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231022142250.10324-1-xuemingl@nvidia.com> References: <20231022142250.10324-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F5:EE_|CH0PR12MB5372:EE_ X-MS-Office365-Filtering-Correlation-Id: f3d44de3-7745-4fb9-c4d8-08dbd30a7285 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yrBgpxenQnS9Tt93GCk3frh+ebF2+HX3ufz5jmESvMhBYD+7Ug1W6HGX2q5IXsKsrjkh268Fh4UYhdHTXPp6oeqlYNqfeZUy+qxvXVXzjMJyR27SF55wdiZIXBSRiewNFrFmuXnAFUFoopGa1/dr1Q/HPcnamhQdIfYULd8c3vgIBpe4Jdl9B0fh5MhgV4TPe2EaTxg86Cu7AG/O/S87s3qhBfRYexEwhb7bvpYDCQxg4LGHDhw4j9Ne5k1d3UaMpXidJjG6Aqq68qf7TRGznHfcGY+aHebPeuQQGSoYpCjdqSq1JA7gd4ffgyR6lpnlQQGpgGIZnnjwuHtkK9tW2yuxXNcSA8dYpR6t9dKphmgp7wU46+TQgHVETUFcSgfDcsEJMojPK3eq706YF2xuKNw3s7+WdE4ZwiVdqmKUWepGory92QPSTAxayxK0d2cTF84AkW3DlAgkK+ytKdgs2BXIYke3C8iH4rJGp/TL59wus9rs2ix8b6StNOM77R2KcxbL3kq2DyIm9SWONACRd2BPr5+8pLWa/EOfe5jVcCbc3n37f7cfiA0ncY3oSPG5o2AZ1HY3JJlp/zSnrdBo1OWTmCXXQG9ibV3bPx8QQ31GInNQCF4auuv/sq1QdkEFLP3XnGIVaUclNgr9OtD0xRPajtaO5FncU2kaQm9LHR7MF8LUTJbd+l6r/O7gzEPp2h5JUNiC6q+d1ClWhOwY4H2JgBCJ95rbrXwt7ZqsRlMMdGJQKIZNt4cY22UmQz1KH5V6XKn2zLljanfEZ1xd4Qfege+ZjRBUeww0IT8U8Cs= 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:(13230031)(4636009)(346002)(136003)(396003)(39860400002)(376002)(230922051799003)(451199024)(64100799003)(82310400011)(186009)(1800799009)(36840700001)(46966006)(40470700004)(55016003)(40460700003)(2906002)(4001150100001)(8936002)(1076003)(53546011)(2616005)(6666004)(316002)(7696005)(70586007)(6916009)(70206006)(478600001)(54906003)(966005)(86362001)(36860700001)(83380400001)(47076005)(336012)(7636003)(26005)(82740400003)(356005)(426003)(16526019)(6286002)(66574015)(40480700001)(41300700001)(8676002)(36756003)(5660300002)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2023 14:23:22.6155 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3d44de3-7745-4fb9-c4d8-08dbd30a7285 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: CO1PEPF000044F5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5372 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.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/15/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/commit/?h=22.11-staging&id=36c07ef565121a9f2b6650ff804ec21c4d507a52 Thanks. Xueming Li --- >From 36c07ef565121a9f2b6650ff804ec21c4d507a52 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 16 Aug 2023 16:34:29 +0100 Subject: [PATCH] mempool: fix default ops for an empty mempool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit c2c6b2f413051b022488518d040508b9ea6e0130 ] An empty mempool's ops were not initialised to a default value wrt to what the application requested via the flags parameter. As rte_mempool_create() relies on rte_mempool_create_empty(), simply move this ops initialisation to rte_mempool_create_empty(). Fixes: aa10457eb4c2 ("mempool: make mempool populate and free api public") Signed-off-by: David Marchand Reviewed-by: Bruce Richardson Reviewed-by: Morten Brørup --- lib/mempool/rte_mempool.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index 950d01ffac..3de857abf5 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -915,6 +915,22 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size, STAILQ_INIT(&mp->elt_list); STAILQ_INIT(&mp->mem_list); + /* + * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to + * set the correct index into the table of ops structs. + */ + if ((flags & RTE_MEMPOOL_F_SP_PUT) && (flags & RTE_MEMPOOL_F_SC_GET)) + ret = rte_mempool_set_ops_byname(mp, "ring_sp_sc", NULL); + else if (flags & RTE_MEMPOOL_F_SP_PUT) + ret = rte_mempool_set_ops_byname(mp, "ring_sp_mc", NULL); + else if (flags & RTE_MEMPOOL_F_SC_GET) + ret = rte_mempool_set_ops_byname(mp, "ring_mp_sc", NULL); + else + ret = rte_mempool_set_ops_byname(mp, "ring_mp_mc", NULL); + + if (ret) + goto exit_unlock; + /* * local_cache pointer is set even if cache_size is zero. * The local_cache points to just past the elt_pa[] array. @@ -955,7 +971,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, rte_mempool_obj_cb_t *obj_init, void *obj_init_arg, int socket_id, unsigned flags) { - int ret; struct rte_mempool *mp; mp = rte_mempool_create_empty(name, n, elt_size, cache_size, @@ -963,22 +978,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, if (mp == NULL) return NULL; - /* - * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to - * set the correct index into the table of ops structs. - */ - if ((flags & RTE_MEMPOOL_F_SP_PUT) && (flags & RTE_MEMPOOL_F_SC_GET)) - ret = rte_mempool_set_ops_byname(mp, "ring_sp_sc", NULL); - else if (flags & RTE_MEMPOOL_F_SP_PUT) - ret = rte_mempool_set_ops_byname(mp, "ring_sp_mc", NULL); - else if (flags & RTE_MEMPOOL_F_SC_GET) - ret = rte_mempool_set_ops_byname(mp, "ring_mp_sc", NULL); - else - ret = rte_mempool_set_ops_byname(mp, "ring_mp_mc", NULL); - - if (ret) - goto fail; - /* call the mempool priv initializer */ if (mp_init) mp_init(mp, mp_init_arg); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-10-22 22:17:34.556367800 +0800 +++ 0002-mempool-fix-default-ops-for-an-empty-mempool.patch 2023-10-22 22:17:34.126723700 +0800 @@ -1 +1 @@ -From c2c6b2f413051b022488518d040508b9ea6e0130 Mon Sep 17 00:00:00 2001 +From 36c07ef565121a9f2b6650ff804ec21c4d507a52 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit c2c6b2f413051b022488518d040508b9ea6e0130 ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 4d337fca8d..7a7a9bf6db 100644 +index 950d01ffac..3de857abf5 100644 @@ -28 +30 @@ -@@ -914,6 +914,22 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size, +@@ -915,6 +915,22 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size, @@ -51 +53 @@ -@@ -954,7 +970,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, +@@ -955,7 +971,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, @@ -59 +61 @@ -@@ -962,22 +977,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, +@@ -963,22 +978,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,