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 BDB71A0C41 for ; Tue, 30 Nov 2021 17:39:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B823D410F7; Tue, 30 Nov 2021 17:39:41 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id D036E410F7 for ; Tue, 30 Nov 2021 17:39:40 +0100 (CET) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B17B040039 for ; Tue, 30 Nov 2021 16:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290380; bh=p4Y4g3zoRLGfcA1/DjgejxfhNruMseqLVmw2hsfh2qc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZcU2uHCVKrr3WZFOpemc0dKuqx1HQTQt3KmBBxjU8dwX95e1jyg+89WzP1XTW+lCJ 28MSfVQoWCBiiG3SPzF6+ubLEtEPDYOQFcbD7r0ptHGRaMUvWsk67uIcaiXd9/IVMs n9EFbk5TEcA/Cjpj27ywDugluhNN9v/gqOnwwtFC27+TD+urLsreeMgoeCcF6AZyYS Eo9dWYVtsAPFc3zTS+xWHh50JQ/ioNCV5iGKQHZfMk4yPowY/tr31DLkzvtjvIEze5 D7qV3zfVzhk6tjStK6hmXsK51Ya5kshkOvJYMg/SLDAU8NRIERGav6SXuEtASA8EgC +tRYardd+vDSg== Received: by mail-ed1-f70.google.com with SMTP id l15-20020a056402124f00b003e57269ab87so17428627edw.6 for ; Tue, 30 Nov 2021 08:39:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p4Y4g3zoRLGfcA1/DjgejxfhNruMseqLVmw2hsfh2qc=; b=0crqcjr0IxzVZd6cu4jpBWe2VysIJ9jnDGcGatxNOhjyJp9e9ZmkPTO7FiIWs+RpJF tG7d0CjdNm8ZHSZdvZXMqrDBrMb1UhpRmT3FUnUtXZf7RLGSp5PF5cdY8fU+jAhtijwa /mcUhI/wu4q0HpFji6VpQ75VIbnwOQw5oFc0aid1vxrOEenlLyiLk/7cNMsPreCuW1+K r5sB9fqiaHs0GPHhEj/SUMwquNnkKKLIrPXDUkfqN15ooJ9+o4tA3gWswg2k+PF4VD7D ymTSAtNVFE7HhrM3Rrbwba/c8RCEnUphWQE2mz4xWJkoV6QzLWByJH3+Du15jH76jF7q JEYQ== X-Gm-Message-State: AOAM531yK3uh3p1cXrgriycFhIbhs7upbvOKxE6ksB9ZlKqVUJ7b0waT eYWDGScfcSxVtb3Bel7p570PnRjr8JndU8IR6ZvFTr2GAn3YlvcNtdz33CcQfK3ZjBaxstl8DYr zgH/fzKYdQgvYUt0Z00+J+QOZ X-Received: by 2002:aa7:cd9a:: with SMTP id x26mr42812edv.159.1638290378968; Tue, 30 Nov 2021 08:39:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiw1npZrGSGUwHcOkEKNDyIlkJ9MEjuIfhVSBfXbEKCeKxGMShvJ4KWRj7QpkjpJx9P9hxJA== X-Received: by 2002:aa7:cd9a:: with SMTP id x26mr42788edv.159.1638290378816; Tue, 30 Nov 2021 08:39:38 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id cs12sm9456701ejc.15.2021.11.30.08.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:39:38 -0800 (PST) From: christian.ehrhardt@canonical.com To: David Marchand Cc: Stephen Hemminger , Andrew Rybchenko , Ray Kinsella , dpdk stable Subject: patch 'mbuf: enforce no option for dynamic fields and flags' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:32 +0100 Message-Id: <20211130163605.2460997-68-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 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 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/2ff1b965f5bf8a73fe37c312c6a473313f3a10cb Thanks. Christian Ehrhardt --- >From 2ff1b965f5bf8a73fe37c312c6a473313f3a10cb 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 [ 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 3224272eaa..709a919682 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -2444,6 +2444,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, @@ -2505,6 +2515,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 a9a8834d4c..4ef50d3f82 100644 --- a/lib/librte_mbuf/rte_mbuf_dyn.c +++ b/lib/librte_mbuf/rte_mbuf_dyn.c @@ -497,6 +497,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.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:09.910533037 +0100 +++ 0068-mbuf-enforce-no-option-for-dynamic-fields-and-flags.patch 2021-11-30 16:50:05.742873178 +0100 @@ -1 +1 @@ -From e9123c467dbb471a2d41ea896423a81886ef89d7 Mon Sep 17 00:00:00 2001 +From 2ff1b965f5bf8a73fe37c312c6a473313f3a10cb Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e9123c467dbb471a2d41ea896423a81886ef89d7 ] + @@ -19,2 +21,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 +26 @@ -index 9a248dfaea..82777109dc 100644 +index 3224272eaa..709a919682 100644 @@ -27 +29 @@ -@@ -2577,6 +2577,16 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) +@@ -2444,6 +2444,16 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) @@ -44 +46 @@ -@@ -2638,6 +2648,14 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) +@@ -2505,6 +2515,14 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) @@ -59,5 +61,5 @@ -diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c -index ca46eb279e..d55e162a68 100644 ---- a/lib/mbuf/rte_mbuf_dyn.c -+++ b/lib/mbuf/rte_mbuf_dyn.c -@@ -498,6 +498,10 @@ rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params, +diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c +index a9a8834d4c..4ef50d3f82 100644 +--- a/lib/librte_mbuf/rte_mbuf_dyn.c ++++ b/lib/librte_mbuf/rte_mbuf_dyn.c +@@ -497,6 +497,10 @@ rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params,