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 EEF0F48AEF for ; Wed, 12 Nov 2025 17:54:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8B5B402A0; Wed, 12 Nov 2025 17:54:25 +0100 (CET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mails.dpdk.org (Postfix) with ESMTP id 110E140DCB for ; Wed, 12 Nov 2025 17:54:24 +0100 (CET) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-47775fb6cb4so7841365e9.0 for ; Wed, 12 Nov 2025 08:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762966464; x=1763571264; 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=cekOZKIbekOfVZU7VEmig4npy+17Z5DNYWVqjfgEozA=; b=QUM8R/YYhaF9Wj3mlpfPkAgXUvp9fRh4IggaK8eyTxbD2L8TKAElX6pzSj7TyvyuW7 0DwV4wFUVtrD5R6EDO0e5TiNO8dLueps6iroIUAKhrCXhwde8qQGD7HlPbNjrG4TH1CH StKudwBL0UGoHRbQiRtzuBvJOHxvUoCt+Z+E5FjrPtNaBBif3xzmB4meGewCKTNhWVbb LwuBwITxlj5L/67sIz1KUbxuPvvTld+F1gpcxBDzNPIhhccsoRK1M8vtrJb/f6/Gxthm MoNiVp9mihjoErWvWVKnpqbjmHOxN4yQ2VA3t3NMQs/XO3M4T3zMnUWsVQwftcZtXGCA cK2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762966464; x=1763571264; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cekOZKIbekOfVZU7VEmig4npy+17Z5DNYWVqjfgEozA=; b=S4DKV5GcHnPgPrMcTzqlEhyLF2njQOD++b9W18JYpbyYYMh4J4klcJJm0S9ZM7XQD3 uGk1GJ2eL7ljRhSyx52yQP3DmD5Bzl80BRmDs1Yo6CTHxKcLRApyapcAXLJJ5G6W0T1P /Y92AzUjHEUyyLVa8LymDa8e/EdfyWd4HLJ3QZJ2ixDZhqZoHAxHReb9H9RdJxzRWedZ bpaYyUh41+hv9V2TVRyicyTH/2z98Ya1HNKdZBpXia86WfzMnPjIInSpS2pcmXEeJTCG po2g2UqJ2v1+PQOJnrkD+9Lo1Pi7inF7GMZ0Gl6OKfKy9J+q21ZGJYc8u30ji7Utvrvk ifkA== X-Gm-Message-State: AOJu0YydcRsK4Q+oINSTNwnAtArOynMjoKKaCdUiCpvY4esBrqapaRO7 SPdlzCbItY8WZM9MFWYE5Aj9AuDSx46KrluhE7aOY1lVfGhDy44pB49ygxD5QQ== X-Gm-Gg: ASbGncsl8tR3xHKQZ1G2zkvZ9dhNkNNGoqXGegD3c/7KAErSfKhO7jJ236D2GmqZaV3 IucGY8WyAr/ps71Sk42zhus+kwyZaQVyjryX8B7lcyjswiReNpIe4keU1qzqdXYOHpsaCOSLNVH JxjKk/ukZiiTAPY6zw/fKxYl+yQL+bF3T50OFPtIAr7TxVl3fI5anp6zxx+Tovu2qFn9rkoLNdh xv4s/Iiayi+kIjWdLFHopMGzxxcVDww2jVxI4zeOkdkDG4dH5qhrUzMOwBBwHgoLSLaqRsL1nuA Loj7aDwBAz0e9UZc21DIFoXSPqOZlGpHJeeZypqT7AhhDlVTqKhTrIUXnOJawwudjTB4QhfVPb2 SNTAD03SvX9QH+4IXgz5yCAkOdXiRoMfC1ci+mEhhUUwj3S7eKGqTS8DKhibH/Fxc3MEmKePHHA 6+HYrhow== X-Google-Smtp-Source: AGHT+IEWTTB4kNxcY3ybqLbPuJxnMVPa97Rm1qs4RmbpL2MultO3le0csZXf7doFgFrpxzWn1sASaQ== X-Received: by 2002:a05:600c:4694:b0:477:7f4a:44ae with SMTP id 5b1f17b1804b1-477870bf2fdmr35247135e9.39.1762966463533; Wed, 12 Nov 2025 08:54:23 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:a397:14bc:5982:5745]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-47787e953e3sm44054805e9.14.2025.11.12.08.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Nov 2025 08:54:22 -0800 (PST) From: luca.boccassi@gmail.com To: Jiawen Wu Cc: dpdk stable Subject: patch 'net/txgbe: filter FDIR match flex bytes for tunnel' has been queued to stable release 22.11.11 Date: Wed, 12 Nov 2025 16:52:39 +0000 Message-ID: <20251112165308.1618107-25-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251112165308.1618107-1-luca.boccassi@gmail.com> References: <20251027162001.3710450-79-luca.boccassi@gmail.com> <20251112165308.1618107-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.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 11/14/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f85c7c529548fa29017c3b46d93ce4820c634822 Thanks. Luca Boccassi --- >From f85c7c529548fa29017c3b46d93ce4820c634822 Mon Sep 17 00:00:00 2001 From: Jiawen Wu Date: Mon, 27 Oct 2025 11:15:36 +0800 Subject: [PATCH] net/txgbe: filter FDIR match flex bytes for tunnel [ upstream commit 02c9cc101281ebf75148de8324455cdc8cbc3baa ] For tunnel packets, pattern RAW is also supported to match in FDIR rules. Fix to process this field. Fixes: a1851465f825 ("net/txgbe: fix to create FDIR filter for tunnel packet") Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_flow.c | 125 ++++++++++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 2 deletions(-) diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c index 8472360103..81eb8f111c 100644 --- a/drivers/net/txgbe/txgbe_flow.c +++ b/drivers/net/txgbe/txgbe_flow.c @@ -2222,6 +2222,8 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, const struct rte_flow_item_udp *udp_mask; const struct rte_flow_item_sctp *sctp_spec; const struct rte_flow_item_sctp *sctp_mask; + const struct rte_flow_item_raw *raw_mask; + const struct rte_flow_item_raw *raw_spec; u8 ptid = 0; uint32_t j; @@ -2548,7 +2550,8 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, if (item->type != RTE_FLOW_ITEM_TYPE_TCP && item->type != RTE_FLOW_ITEM_TYPE_UDP && item->type != RTE_FLOW_ITEM_TYPE_SCTP && - item->type != RTE_FLOW_ITEM_TYPE_END) { + item->type != RTE_FLOW_ITEM_TYPE_END && + item->type != RTE_FLOW_ITEM_TYPE_RAW) { memset(rule, 0, sizeof(struct txgbe_fdir_rule)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -2637,7 +2640,8 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, if (item->type != RTE_FLOW_ITEM_TYPE_TCP && item->type != RTE_FLOW_ITEM_TYPE_UDP && item->type != RTE_FLOW_ITEM_TYPE_SCTP && - item->type != RTE_FLOW_ITEM_TYPE_END) { + item->type != RTE_FLOW_ITEM_TYPE_END && + item->type != RTE_FLOW_ITEM_TYPE_RAW) { memset(rule, 0, sizeof(struct txgbe_fdir_rule)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -2699,6 +2703,16 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, rule->input.dst_port = tcp_spec->hdr.dst_port; } + + item = next_no_fuzzy_pattern(pattern, item); + if (item->type != RTE_FLOW_ITEM_TYPE_RAW && + item->type != RTE_FLOW_ITEM_TYPE_END) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by fdir filter"); + return -rte_errno; + } } /* Get the UDP info */ @@ -2748,6 +2762,16 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, rule->input.dst_port = udp_spec->hdr.dst_port; } + + item = next_no_fuzzy_pattern(pattern, item); + if (item->type != RTE_FLOW_ITEM_TYPE_RAW && + item->type != RTE_FLOW_ITEM_TYPE_END) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by fdir filter"); + return -rte_errno; + } } /* Get the SCTP info */ @@ -2798,6 +2822,103 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, rule->input.dst_port = sctp_spec->hdr.dst_port; } + + item = next_no_fuzzy_pattern(pattern, item); + if (item->type != RTE_FLOW_ITEM_TYPE_RAW && + item->type != RTE_FLOW_ITEM_TYPE_END) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by fdir filter"); + return -rte_errno; + } + } + + /* Get the flex byte info */ + if (item->type == RTE_FLOW_ITEM_TYPE_RAW) { + uint16_t pattern = 0; + + /* Not supported last point for range*/ + if (item->last) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + item, "Not supported last point for range"); + return -rte_errno; + } + /* mask should not be null */ + if (!item->mask || !item->spec) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by fdir filter"); + return -rte_errno; + } + + rule->b_mask = TRUE; + raw_mask = item->mask; + + /* check mask */ + if (raw_mask->relative != 0x1 || + raw_mask->search != 0x1 || + raw_mask->reserved != 0x0 || + (uint32_t)raw_mask->offset != 0xffffffff || + raw_mask->limit != 0xffff || + raw_mask->length != 0xffff) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by fdir filter"); + return -rte_errno; + } + + rule->b_spec = TRUE; + raw_spec = item->spec; + + /* check spec */ + if (raw_spec->search != 0 || + raw_spec->reserved != 0 || + raw_spec->offset > TXGBE_MAX_FLX_SOURCE_OFF || + raw_spec->offset % 2 || + raw_spec->limit != 0 || + raw_spec->length != 4 || + /* pattern can't be 0xffff */ + (raw_spec->pattern[0] == 0xff && + raw_spec->pattern[1] == 0xff && + raw_spec->pattern[2] == 0xff && + raw_spec->pattern[3] == 0xff)) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by fdir filter"); + return -rte_errno; + } + + /* check pattern mask */ + if (raw_mask->pattern[0] != 0xff || + raw_mask->pattern[1] != 0xff || + raw_mask->pattern[2] != 0xff || + raw_mask->pattern[3] != 0xff) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Not supported by fdir filter"); + return -rte_errno; + } + + rule->mask.flex_bytes_mask = 0xffff; + /* Convert pattern string to hex bytes */ + if (sscanf((const char *)raw_spec->pattern, "%hx", &pattern) != 1) { + memset(rule, 0, sizeof(struct txgbe_fdir_rule)); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Failed to parse raw pattern"); + return -rte_errno; + } + rule->input.flex_bytes = (pattern & 0x00FF) << 8; + rule->input.flex_bytes |= (pattern & 0xFF00) >> 8; + + rule->flex_bytes_offset = raw_spec->offset; + rule->flex_relative = raw_spec->relative; } if (item->type != RTE_FLOW_ITEM_TYPE_END) { -- 2.47.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-11-12 16:20:41.904906177 +0000 +++ 0025-net-txgbe-filter-FDIR-match-flex-bytes-for-tunnel.patch 2025-11-12 16:20:40.919716748 +0000 @@ -1 +1 @@ -From 02c9cc101281ebf75148de8324455cdc8cbc3baa Mon Sep 17 00:00:00 2001 +From f85c7c529548fa29017c3b46d93ce4820c634822 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 02c9cc101281ebf75148de8324455cdc8cbc3baa ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -18 +19 @@ -index 5b03a35949..095c84823f 100644 +index 8472360103..81eb8f111c 100644