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 75C554319F for ; Thu, 19 Oct 2023 01:59:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A5E44029E; Thu, 19 Oct 2023 01:59:39 +0200 (CEST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mails.dpdk.org (Postfix) with ESMTP id 247F040291 for ; Thu, 19 Oct 2023 01:59:38 +0200 (CEST) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-313e742a787so112691f8f.1 for ; Wed, 18 Oct 2023 16:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697673578; x=1698278378; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UH/Pbqro5DkpV21HkEfEGoq3ODQYCqzoOCvcxU1nzIk=; b=k8/+qmKYz1cjowNHSgWY+dmPcZN/2wv+iMKRXWwavd7nsYRwCHpVgKkIONup1UYwB8 J37uwhNTAaa0qELaJxaCBtz3hi/tZ/mlCn3v0CrENPKZm6R0Cfc/9EUs+3BKT1cKeGwv CLgeL2LvVrO89koViZs0Tln4n5m2/G2RKbznQw+2+g+ii5qgTgOP/LQSglVHL8VCZAKT /yIhX0URUExOKtwXHLzBu1RFnC7c2s3GpCgJzy2k/W1OoGg5Jlq8nIGSfKYg/vf4dGL7 jV1IOoUF4vnat8fRsMtuzXbVRX6sUzYk7d00BqN0RyaZCeZcaVIucsRgpKzDZIgjedL4 SEMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697673578; x=1698278378; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UH/Pbqro5DkpV21HkEfEGoq3ODQYCqzoOCvcxU1nzIk=; b=vs4xubcZWc6dfBi/GvcZO99rJj9XUn5JkocqTVZc5bNmB8Yw8qyrzqdOPzDpdihppL tQBI8jWxnafQLb5fYPcmB8nhE8CCfywMhPmELmw32PfIehPPgn0La098/Xr2eFND1ikI cW2t6tHma6kTUdxuhmLOOipMBTsd2EuekaXXwl7AxgHuUd6+G0xa+4wwCfjpxuHS9MHI BnwUeonvRy0zYIW35a42Ichms5HB2rlyZVjtOK0OqonBc7qLk66GFI9FIRkQp7XeBwwU rqRluG9u1SB8cnUKlXUlNeAyUjkKq+z+1Ssq27K3P1It+OsLkdDY9txZFG/nKMny4dYN PAiQ== X-Gm-Message-State: AOJu0YwaIV3Qodkcv/Jn6KpWbGZ2iwEJzv2LnoqTgfTuE6oxz+ESt4yg M99t7IJNZ3CA4qcNR6e5GwQ= X-Google-Smtp-Source: AGHT+IEtzZc6xaErGnASJImlCeRig50qv2LZgK28l/LTfON4F34Q9FPkBEBFhJaV8bskwnBSpCsQwg== X-Received: by 2002:adf:8b13:0:b0:32d:8113:eda3 with SMTP id n19-20020adf8b13000000b0032d8113eda3mr317421wra.10.1697673577397; Wed, 18 Oct 2023 16:59:37 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id i11-20020a5d630b000000b00327bf4f2f14sm3140164wru.88.2023.10.18.16.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 16:59:36 -0700 (PDT) From: luca.boccassi@gmail.com 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 20.11.10 Date: Thu, 19 Oct 2023 00:58:50 +0100 Message-Id: <20231018235930.3144-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 20.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/21/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f44ac41596ce087096ab14e5e8fa17822e71de6b Thanks. Luca Boccassi --- >From f44ac41596ce087096ab14e5e8fa17822e71de6b 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 [ 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/librte_mempool/rte_mempool.c | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index afb1239c8d..86029b5bec 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -883,6 +883,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 & MEMPOOL_F_SP_PUT) && (flags & MEMPOOL_F_SC_GET)) + ret = rte_mempool_set_ops_byname(mp, "ring_sp_sc", NULL); + else if (flags & MEMPOOL_F_SP_PUT) + ret = rte_mempool_set_ops_byname(mp, "ring_sp_mc", NULL); + else if (flags & 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. @@ -923,7 +939,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, @@ -931,22 +946,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 & MEMPOOL_F_SP_PUT) && (flags & MEMPOOL_F_SC_GET)) - ret = rte_mempool_set_ops_byname(mp, "ring_sp_sc", NULL); - else if (flags & MEMPOOL_F_SP_PUT) - ret = rte_mempool_set_ops_byname(mp, "ring_sp_mc", NULL); - else if (flags & 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.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-10-19 00:28:56.350449806 +0100 +++ 0001-mempool-fix-default-ops-for-an-empty-mempool.patch 2023-10-19 00:28:56.173803358 +0100 @@ -1 +1 @@ -From c2c6b2f413051b022488518d040508b9ea6e0130 Mon Sep 17 00:00:00 2001 +From f44ac41596ce087096ab14e5e8fa17822e71de6b Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit c2c6b2f413051b022488518d040508b9ea6e0130 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ - lib/mempool/rte_mempool.c | 33 ++++++++++++++++----------------- + lib/librte_mempool/rte_mempool.c | 33 ++++++++++++++++---------------- @@ -24,5 +25,5 @@ -diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c -index 4d337fca8d..7a7a9bf6db 100644 ---- a/lib/mempool/rte_mempool.c -+++ b/lib/mempool/rte_mempool.c -@@ -914,6 +914,22 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size, +diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c +index afb1239c8d..86029b5bec 100644 +--- a/lib/librte_mempool/rte_mempool.c ++++ b/lib/librte_mempool/rte_mempool.c +@@ -883,6 +883,22 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size, @@ -36 +37 @@ -+ if ((flags & RTE_MEMPOOL_F_SP_PUT) && (flags & RTE_MEMPOOL_F_SC_GET)) ++ if ((flags & MEMPOOL_F_SP_PUT) && (flags & MEMPOOL_F_SC_GET)) @@ -38 +39 @@ -+ else if (flags & RTE_MEMPOOL_F_SP_PUT) ++ else if (flags & MEMPOOL_F_SP_PUT) @@ -40 +41 @@ -+ else if (flags & RTE_MEMPOOL_F_SC_GET) ++ else if (flags & MEMPOOL_F_SC_GET) @@ -51 +52 @@ -@@ -954,7 +970,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, +@@ -923,7 +939,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, @@ -59 +60 @@ -@@ -962,22 +977,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, +@@ -931,22 +946,6 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, @@ -67 +68 @@ -- if ((flags & RTE_MEMPOOL_F_SP_PUT) && (flags & RTE_MEMPOOL_F_SC_GET)) +- if ((flags & MEMPOOL_F_SP_PUT) && (flags & MEMPOOL_F_SC_GET)) @@ -69 +70 @@ -- else if (flags & RTE_MEMPOOL_F_SP_PUT) +- else if (flags & MEMPOOL_F_SP_PUT) @@ -71 +72 @@ -- else if (flags & RTE_MEMPOOL_F_SC_GET) +- else if (flags & MEMPOOL_F_SC_GET)