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 813C24569C for ; Wed, 24 Jul 2024 13:34:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B6F24339C; Wed, 24 Jul 2024 13:34:32 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id 718104339C for ; Wed, 24 Jul 2024 13:34:31 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-368526b1333so450101f8f.1 for ; Wed, 24 Jul 2024 04:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721820871; x=1722425671; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D6HW3uWZVp/ulVigv1wxn60l0GqThXRAE+FV+y/iEeg=; b=QczqpdSntGnHCsZeBHHVRXj3J0txRjEgdxAZNYXamI4GSeApEEvEatfHvtBIgp31b1 zCeomAyn6MKTiXR/rOYpFQApkJ/qL7kDJky1KlP6lo9BgrJDZXCNBpqGYM6lIkatgyYE 96yWP7qlLIvY3i9MAjKN/PP75vq++AluLQfV40pTPxeTHfCK5uPwzB8sU0xLS5WfC188 r4WFFRq++VD+eRLSH4GmJmOXv/sr2c7Cq5RxSVLub2Q+C2rbSEEovH+i5Aq/a0Lj9Pb6 j1IRykG8mK/aKBac716vxXVoE4/qphbbVGpfBf0bd+yLfDiIC0IivFk995kPx0w110H8 9eTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721820871; x=1722425671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D6HW3uWZVp/ulVigv1wxn60l0GqThXRAE+FV+y/iEeg=; b=m8+VmA8IO1scjDWUiJpl9/RiuKBBXyPHHPbdFAMsLcikmF8GLAt6lAhBWzdxSdSn5q HmnbL/myMq98hAomKpuzpICCSgaFholyBNy2lXlZReOWV74fOvibRyIiBJB8fi+kfFa8 Pk5WWoE79cn0cdXHBYsBF4V3kX1Dxj7gdYhfhtFsNyr7hL8Pvo9YOy0duxiK4fDLo2KT N42U4BeEwCf1ZezfJVxoyetr9ZUlc2w5llVkmbu8KgzESrCMSgqkyLxxzMVc3UBXPvVq /9ZA4DEXi59Rk214xVyr+ShG57cbGOCFbET6FevqabZ/2jL+EyymkYMdvtcFeV5+WTau fiAA== X-Forwarded-Encrypted: i=1; AJvYcCU8Aqm0mOSF0ZOMhBffoAnH0CGzEzA8nTOTZWHW7NuFlUv+I2wAv5WWwpwDcRXXG87jnC9G8QjkEb+WF+fqXRk= X-Gm-Message-State: AOJu0YzNPRaWZQVb3zxmRMIbQWl8sONe76/p2NDi/DDPg6NknP4yj2iZ /cOlBCZT7r3BbdbUNMoWJkUmBSMXy2CQC9C5MStE4EGRAXIe/FZXIPfnjORP X-Google-Smtp-Source: AGHT+IEfSnownptuc7cDGoDgzDcDf7LCZl0VijinFdqO61KtqrmtroTkpNAbUUGKlFjALeBK+ng69Q== X-Received: by 2002:a5d:44c6:0:b0:360:7856:fa62 with SMTP id ffacd0b85a97d-369f66bbc5emr1278857f8f.15.1721820870915; Wed, 24 Jul 2024 04:34:30 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f938da6fsm24640485e9.25.2024.07.24.04.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:34:30 -0700 (PDT) From: luca.boccassi@gmail.com To: Michael Baum Cc: Ferruh Yigit , dpdk stable Subject: patch 'ethdev: fix GENEVE option item conversion' has been queued to stable release 22.11.6 Date: Wed, 24 Jul 2024 12:33:00 +0100 Message-Id: <20240724113318.616754-22-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240724113318.616754-1-luca.boccassi@gmail.com> References: <20240715152704.2229503-86-luca.boccassi@gmail.com> <20240724113318.616754-1-luca.boccassi@gmail.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 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/24. 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/c4f3e79ac58b870825f0db4a386034311995ecde Thanks. Luca Boccassi --- >From c4f3e79ac58b870825f0db4a386034311995ecde Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Mon, 15 Jul 2024 15:13:16 +0300 Subject: [PATCH] ethdev: fix GENEVE option item conversion [ upstream commit 841a0445442de154441ac2b4700658a9eb83c986 ] The "rte_flow_conv()" function, enables, among other things, to copy item list. For GENEVE option item, the function copies it without considering deep copy. It copies the "data" pointer without copying the pointed values. This patch adds deep copy for after regular copy. Fixes: 2b4c72b4d10d ("ethdev: introduce GENEVE header TLV option item") Signed-off-by: Michael Baum Acked-by: Ferruh Yigit --- lib/ethdev/rte_flow.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 2aa51f99ee..aa43b8034d 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -547,6 +547,7 @@ rte_flow_conv_item_spec(void *buf, const size_t size, switch (item->type) { union { const struct rte_flow_item_raw *raw; + const struct rte_flow_item_geneve_opt *geneve_opt; } spec; union { const struct rte_flow_item_raw *raw; @@ -556,10 +557,13 @@ rte_flow_conv_item_spec(void *buf, const size_t size, } mask; union { const struct rte_flow_item_raw *raw; + const struct rte_flow_item_geneve_opt *geneve_opt; } src; union { struct rte_flow_item_raw *raw; + struct rte_flow_item_geneve_opt *geneve_opt; } dst; + void *deep_src; size_t tmp; case RTE_FLOW_ITEM_TYPE_RAW: @@ -588,13 +592,30 @@ rte_flow_conv_item_spec(void *buf, const size_t size, tmp = last.raw->length & mask.raw->length; if (tmp) { off = RTE_ALIGN_CEIL(off, sizeof(*dst.raw->pattern)); - if (size >= off + tmp) - dst.raw->pattern = rte_memcpy - ((void *)((uintptr_t)dst.raw + off), - src.raw->pattern, tmp); + if (size >= off + tmp) { + deep_src = (void *)((uintptr_t)dst.raw + off); + dst.raw->pattern = rte_memcpy(deep_src, + src.raw->pattern, + tmp); + } off += tmp; } break; + case RTE_FLOW_ITEM_TYPE_GENEVE_OPT: + off = rte_flow_conv_copy(buf, data, size, + rte_flow_desc_item, item->type); + spec.geneve_opt = item->spec; + src.geneve_opt = data; + dst.geneve_opt = buf; + tmp = spec.geneve_opt->option_len << 2; + if (size > 0 && src.geneve_opt->data) { + deep_src = (void *)((uintptr_t)(dst.geneve_opt + 1)); + dst.geneve_opt->data = rte_memcpy(deep_src, + src.geneve_opt->data, + tmp); + } + off += tmp; + break; default: off = rte_flow_conv_copy(buf, data, size, rte_flow_desc_item, item->type); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-24 12:29:22.464774480 +0100 +++ 0022-ethdev-fix-GENEVE-option-item-conversion.patch 2024-07-24 12:29:20.771026131 +0100 @@ -1 +1 @@ -From 841a0445442de154441ac2b4700658a9eb83c986 Mon Sep 17 00:00:00 2001 +From c4f3e79ac58b870825f0db4a386034311995ecde Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 841a0445442de154441ac2b4700658a9eb83c986 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index ca2f85c3fa..4076ae4ee1 100644 +index 2aa51f99ee..aa43b8034d 100644 @@ -27 +28 @@ -@@ -623,6 +623,7 @@ rte_flow_conv_item_spec(void *buf, const size_t size, +@@ -547,6 +547,7 @@ rte_flow_conv_item_spec(void *buf, const size_t size, @@ -35 +36 @@ -@@ -632,10 +633,13 @@ rte_flow_conv_item_spec(void *buf, const size_t size, +@@ -556,10 +557,13 @@ rte_flow_conv_item_spec(void *buf, const size_t size, @@ -49 +50 @@ -@@ -664,13 +668,30 @@ rte_flow_conv_item_spec(void *buf, const size_t size, +@@ -588,13 +592,30 @@ rte_flow_conv_item_spec(void *buf, const size_t size,