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 A2D9148A44 for ; Fri, 31 Oct 2025 15:38:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BDC240150; Fri, 31 Oct 2025 15:38:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id DF41540150 for ; Fri, 31 Oct 2025 15:38:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761921519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LQfOjuvEuljv7SIKhQYli3+KHrZIWWaSUZj1jtILCP4=; b=SuosmdMTb4gMXGajI+HyDyo88ueutmyTK3XQQ1eXBs/k8+6uaL0SRLxzxm+WA9RdrdZjjV VVUByw2WB0dGfJxKo5hZzBJq3+MrBL3UK+VEIUCFFYiaI4pW8yQBti7SdauyZQ+uip5Ets 3e9g00hMdoFWcjrAYDLVrsth1FFwnWs= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-235-O4tVrs6uPQ2OoJ1qeDnfFA-1; Fri, 31 Oct 2025 10:38:37 -0400 X-MC-Unique: O4tVrs6uPQ2OoJ1qeDnfFA-1 X-Mimecast-MFC-AGG-ID: O4tVrs6uPQ2OoJ1qeDnfFA_1761921517 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B7F3219539BE; Fri, 31 Oct 2025 14:38:33 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B39B8180044F; Fri, 31 Oct 2025 14:38:31 +0000 (UTC) From: Kevin Traynor To: Viacheslav Ovsiienko Cc: Matan Azrad , dpdk stable Subject: patch 'net/mlx5: fix ESP item validation to match on seqnum' has been queued to stable release 24.11.4 Date: Fri, 31 Oct 2025 14:33:26 +0000 Message-ID: <20251031143421.324432-84-ktraynor@redhat.com> In-Reply-To: <20251031143421.324432-1-ktraynor@redhat.com> References: <20251031143421.324432-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 9ZSj__C5bSeZbqjcj1ScZLKDx1-ooNxaktSHhzp3Eys_1761921517 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 24.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/05/25. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/aa27f7c19ccf8ed674aa82ccb2b2cba530118c40 Thanks. Kevin --- >From aa27f7c19ccf8ed674aa82ccb2b2cba530118c40 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Tue, 9 Sep 2025 09:28:52 +0300 Subject: [PATCH] net/mlx5: fix ESP item validation to match on seqnum [ upstream commit 96d73a947331cc146e09b06a6913cdf604ae52a7 ] The match on ESP sequence number is supported by hardware steering implementation but was rejected in validation routine shared by all steering engines. This patch allows validation to pass with requested match on ESP sequence number for hardware steering engine. Fixes: fb96caa56aab ("net/mlx5: support ESP item on Windows") Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_flow_os.c | 10 +++++++++- drivers/net/mlx5/linux/mlx5_flow_os.h | 3 +++ drivers/net/mlx5/mlx5_flow_dv.c | 6 ++---- drivers/net/mlx5/mlx5_flow_hw.c | 5 ++--- drivers/net/mlx5/mlx5_flow_verbs.c | 6 ++---- drivers/net/mlx5/windows/mlx5_flow_os.c | 10 +++++++++- drivers/net/mlx5/windows/mlx5_flow_os.h | 3 +++ 7 files changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_flow_os.c b/drivers/net/mlx5/linux/mlx5_flow_os.c index af8c02c38b..777125e9a8 100644 --- a/drivers/net/mlx5/linux/mlx5_flow_os.c +++ b/drivers/net/mlx5/linux/mlx5_flow_os.c @@ -19,4 +19,5 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, uint64_t item_flags, uint8_t target_protocol, + bool allow_seq, struct rte_flow_error *error) { @@ -27,4 +28,10 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, const uint64_t l4m = tunnel ? MLX5_FLOW_LAYER_INNER_L4 : MLX5_FLOW_LAYER_OUTER_L4; + static const struct rte_flow_item_esp mlx5_flow_item_esp_mask = { + .hdr = { + .spi = RTE_BE32(0xffffffff), + .seq = RTE_BE32(0xffffffff), + }, + }; int ret; @@ -48,5 +55,6 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, ret = mlx5_flow_item_acceptable (dev, item, (const uint8_t *)mask, - (const uint8_t *)&rte_flow_item_esp_mask, + allow_seq ? (const uint8_t *)&mlx5_flow_item_esp_mask : + (const uint8_t *)&rte_flow_item_esp_mask, sizeof(struct rte_flow_item_esp), MLX5_ITEM_RANGE_NOT_ACCEPTED, error); diff --git a/drivers/net/mlx5/linux/mlx5_flow_os.h b/drivers/net/mlx5/linux/mlx5_flow_os.h index 35b5871ab9..21a2ed5bec 100644 --- a/drivers/net/mlx5/linux/mlx5_flow_os.h +++ b/drivers/net/mlx5/linux/mlx5_flow_os.h @@ -515,4 +515,6 @@ mlx5_os_flow_dr_sync_domain(void *domain, uint32_t flags) * @param[in] target_protocol * The next protocol in the previous item. + * @param[in] allow_seq + * The match on sequence number is supported. * @param[out] error * Pointer to error structure. @@ -526,4 +528,5 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, uint64_t item_flags, uint8_t target_protocol, + bool allow_seq, struct rte_flow_error *error); diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index b9b1a34dab..c1ff6a2dae 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7860,8 +7860,6 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, break; case RTE_FLOW_ITEM_TYPE_ESP: - ret = mlx5_flow_os_validate_item_esp(dev, items, - item_flags, - next_protocol, - error); + ret = mlx5_flow_os_validate_item_esp(dev, items, item_flags, + next_protocol, false, error); if (ret < 0) return ret; diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index e8a3473241..74ee3c665f 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -8681,7 +8681,6 @@ __flow_hw_pattern_validate(struct rte_eth_dev *dev, break; case RTE_FLOW_ITEM_TYPE_ESP: - ret = mlx5_flow_os_validate_item_esp(dev, item, - *item_flags, 0xff, - error); + ret = mlx5_flow_os_validate_item_esp(dev, item, *item_flags, + 0xff, true, error); if (ret < 0) return ret; diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index 5b4a4eda3b..67d199ce15 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -1333,8 +1333,6 @@ flow_verbs_validate(struct rte_eth_dev *dev, #ifdef HAVE_IBV_FLOW_SPEC_ESP case RTE_FLOW_ITEM_TYPE_ESP: - ret = mlx5_flow_os_validate_item_esp(dev, items, - item_flags, - next_protocol, - error); + ret = mlx5_flow_os_validate_item_esp(dev, items, item_flags, + next_protocol, false, error); if (ret < 0) return ret; diff --git a/drivers/net/mlx5/windows/mlx5_flow_os.c b/drivers/net/mlx5/windows/mlx5_flow_os.c index bf93da9f1e..7a625fb880 100644 --- a/drivers/net/mlx5/windows/mlx5_flow_os.c +++ b/drivers/net/mlx5/windows/mlx5_flow_os.c @@ -429,4 +429,5 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, uint64_t item_flags, uint8_t target_protocol, + bool allow_seq, struct rte_flow_error *error) { @@ -438,4 +439,10 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, const uint64_t l4m = tunnel ? MLX5_FLOW_LAYER_INNER_L4 : MLX5_FLOW_LAYER_OUTER_L4; + static const struct rte_flow_item_esp mlx5_flow_item_esp_mask = { + .hdr = { + .spi = RTE_BE32(0xffffffff), + .seq = RTE_BE32(0xffffffff), + }, + }; int ret; @@ -462,5 +469,6 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, ret = mlx5_flow_item_acceptable (dev, item, (const uint8_t *)mask, - (const uint8_t *)&rte_flow_item_esp_mask, + allow_seq ? (const uint8_t *)&mlx5_flow_item_esp_mask : + (const uint8_t *)&rte_flow_item_esp_mask, sizeof(struct rte_flow_item_esp), MLX5_ITEM_RANGE_NOT_ACCEPTED, error); diff --git a/drivers/net/mlx5/windows/mlx5_flow_os.h b/drivers/net/mlx5/windows/mlx5_flow_os.h index 36edc3d532..2cd4e95325 100644 --- a/drivers/net/mlx5/windows/mlx5_flow_os.h +++ b/drivers/net/mlx5/windows/mlx5_flow_os.h @@ -462,4 +462,6 @@ int mlx5_flow_os_destroy_flow(void *drv_flow_ptr); * @param[in] target_protocol * The next protocol in the previous item. + * @param[in] allow_seq + * The match on sequence number is supported. * @param[out] error * Pointer to error structure. @@ -473,4 +475,5 @@ mlx5_flow_os_validate_item_esp(const struct rte_eth_dev *dev, uint64_t item_flags, uint8_t target_protocol, + bool allow_seq, struct rte_flow_error *error); -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-31 13:53:54.788052655 +0000 +++ 0084-net-mlx5-fix-ESP-item-validation-to-match-on-seqnum.patch 2025-10-31 13:53:52.205523896 +0000 @@ -1 +1 @@ -From 96d73a947331cc146e09b06a6913cdf604ae52a7 Mon Sep 17 00:00:00 2001 +From aa27f7c19ccf8ed674aa82ccb2b2cba530118c40 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 96d73a947331cc146e09b06a6913cdf604ae52a7 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -75 +76 @@ -index abfd54da1a..18d0d29377 100644 +index b9b1a34dab..c1ff6a2dae 100644 @@ -90 +91 @@ -index c84ae726a7..2ca40b4146 100644 +index e8a3473241..74ee3c665f 100644 @@ -93 +94 @@ -@@ -8819,7 +8819,6 @@ __flow_hw_pattern_validate(struct rte_eth_dev *dev, +@@ -8681,7 +8681,6 @@ __flow_hw_pattern_validate(struct rte_eth_dev *dev,