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 87BCB48B69 for ; Fri, 21 Nov 2025 12:23:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82E194026F; Fri, 21 Nov 2025 12:23:03 +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 B0DB6402E0 for ; Fri, 21 Nov 2025 12:23:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763724181; 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=3UhyHB+IeooJrPnIiB3L81/asgTpP7kop0gqnSJOp7g=; b=BH8RWP1027lKEaGfx3GbLur7xHMI26b5USGmzkZ7JYLQiQba7RHyJLLi59pzYf21wMTL3L SHtF0LqBgGrJLvOjstx78dPMzD55daOAR0Pm705QmTbs61nceFMm/sZDOrZ1EzwXC5+h5A elpRwwEEJL5CviV6FslHXumZ8QoKPB4= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-VGkSjNTyNFKBJ4BYINvNkw-1; Fri, 21 Nov 2025 06:22:59 -0500 X-MC-Unique: VGkSjNTyNFKBJ4BYINvNkw-1 X-Mimecast-MFC-AGG-ID: VGkSjNTyNFKBJ4BYINvNkw_1763724179 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1EC0E1800447; Fri, 21 Nov 2025 11:22:59 +0000 (UTC) Received: from rh.redhat.com (unknown [10.42.28.165]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0D60C30044DB; Fri, 21 Nov 2025 11:22:57 +0000 (UTC) From: Kevin Traynor To: Jiawen Wu Cc: dpdk stable Subject: patch 'net/txgbe: fix FDIR input mask' has been queued to stable release 24.11.4 Date: Fri, 21 Nov 2025 11:20:19 +0000 Message-ID: <20251121112128.485623-35-ktraynor@redhat.com> In-Reply-To: <20251121112128.485623-1-ktraynor@redhat.com> References: <20251121112128.485623-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Llu17gofQoJ6sIywQfTSuBmQHlrSVLBlhQM1-Rk-a08_1763724179 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/26/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/e00d3be49ba945ff2b74bf983a08a8a5dc5c5deb Thanks. Kevin --- >From e00d3be49ba945ff2b74bf983a08a8a5dc5c5deb Mon Sep 17 00:00:00 2001 From: Jiawen Wu Date: Mon, 27 Oct 2025 11:15:38 +0800 Subject: [PATCH] net/txgbe: fix FDIR input mask [ upstream commit a2d4de27109033d5061da44aed919bf46cfd7ca9 ] Fix FDIR mask settings to comply with the hardware configuration. And mask out the spec field instead of manually setting it to 0. There are some requirements of mask in hardware: 1) IPv4 mask should be little-endian. 2) Ipv6 source address mask has only 16 bits, one bit of mask corresponds to one byte of spec. 3) IPv6 dest address is only supported to perfect match the low 8 bits, so it is not taken into account for support in the driver. Fixes: ea230dda16ad ("net/txgbe: configure flow director filter") Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_fdir.c | 49 +++++++++++++++++++++++++++++----- drivers/net/txgbe/txgbe_flow.c | 8 ++---- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c index 8d181db33f..6b83a7379d 100644 --- a/drivers/net/txgbe/txgbe_fdir.c +++ b/drivers/net/txgbe/txgbe_fdir.c @@ -166,4 +166,13 @@ configure_fdir_flags(const struct rte_eth_fdir_conf *conf, } +static inline uint16_t +txgbe_reverse_fdir_bitmasks(uint16_t mask) +{ + mask = ((mask & 0x5555) << 1) | ((mask & 0xAAAA) >> 1); + mask = ((mask & 0x3333) << 2) | ((mask & 0xCCCC) >> 2); + mask = ((mask & 0x0F0F) << 4) | ((mask & 0xF0F0) >> 4); + return ((mask & 0x00FF) << 8) | ((mask & 0xFF00) >> 8); +} + int txgbe_fdir_set_input_mask(struct rte_eth_dev *dev) @@ -207,13 +216,13 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev) wr32(hw, TXGBE_FDIRSCTPMSK, ~fdirtcpm); - /* Store source and destination IPv4 masks (big-endian) */ - wr32(hw, TXGBE_FDIRSIP4MSK, ~info->mask.src_ipv4_mask); - wr32(hw, TXGBE_FDIRDIP4MSK, ~info->mask.dst_ipv4_mask); + /* Store source and destination IPv4 masks (little-endian) */ + wr32(hw, TXGBE_FDIRSIP4MSK, rte_be_to_cpu_32(~info->mask.src_ipv4_mask)); + wr32(hw, TXGBE_FDIRDIP4MSK, rte_be_to_cpu_32(~info->mask.dst_ipv4_mask)); /* * Store source and destination IPv6 masks (bit reversed) */ - fdiripv6m = TXGBE_FDIRIP6MSK_DST(info->mask.dst_ipv6_mask) | - TXGBE_FDIRIP6MSK_SRC(info->mask.src_ipv6_mask); + fdiripv6m = txgbe_reverse_fdir_bitmasks(info->mask.dst_ipv6_mask) << 16; + fdiripv6m |= txgbe_reverse_fdir_bitmasks(info->mask.src_ipv6_mask); wr32(hw, TXGBE_FDIRIP6MSK, ~fdiripv6m); @@ -637,6 +646,12 @@ fdir_write_perfect_filter(struct txgbe_hw *hw, fdircmd |= TXGBE_FDIRPICMD_POOL(input->vm_pool); - if (input->flow_type & TXGBE_ATR_L3TYPE_IPV6) + if (input->flow_type & TXGBE_ATR_L3TYPE_IPV6) { + /* use SIP4 to store LS Dword of the Source iPv6 address */ + wr32(hw, TXGBE_FDIRPISIP4, be_to_le32(input->src_ip[3])); + wr32(hw, TXGBE_FDIRPISIP6(0), be_to_le32(input->src_ip[2])); + wr32(hw, TXGBE_FDIRPISIP6(1), be_to_le32(input->src_ip[1])); + wr32(hw, TXGBE_FDIRPISIP6(2), be_to_le32(input->src_ip[0])); fdircmd |= TXGBE_FDIRPICMD_IP6; + } wr32(hw, TXGBE_FDIRPICMD, fdircmd); @@ -784,4 +799,24 @@ txgbe_remove_fdir_filter(struct txgbe_hw_fdir_info *fdir_info, } +static void +txgbe_fdir_mask_input(struct txgbe_hw_fdir_mask *mask, + struct txgbe_atr_input *input) +{ + int i; + + if (input->flow_type & TXGBE_ATR_L3TYPE_IPV6) { + for (i = 0; i < 16; i++) { + if (!(mask->src_ipv6_mask & (1 << i))) + input->src_ip[i / 4] &= ~(0xFF << ((i % 4) * 8)); + } + } else { + input->src_ip[0] &= mask->src_ipv4_mask; + input->dst_ip[0] &= mask->dst_ipv4_mask; + } + + input->src_port &= mask->src_port_mask; + input->dst_port &= mask->dst_port_mask; +} + int txgbe_fdir_filter_program(struct rte_eth_dev *dev, @@ -806,4 +841,6 @@ txgbe_fdir_filter_program(struct rte_eth_dev *dev, is_perfect = TRUE; + txgbe_fdir_mask_input(&info->mask, &rule->input); + if (is_perfect) { fdirhash = atr_compute_perfect_hash(&rule->input, diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c index a820081dce..cb8004e48c 100644 --- a/drivers/net/txgbe/txgbe_flow.c +++ b/drivers/net/txgbe/txgbe_flow.c @@ -1850,7 +1850,5 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused, /* check dst addr mask */ for (j = 0; j < 16; j++) { - if (ipv6_mask->hdr.dst_addr.a[j] == UINT8_MAX) { - rule->mask.dst_ipv6_mask |= 1 << j; - } else if (ipv6_mask->hdr.dst_addr.a[j] != 0) { + if (ipv6_mask->hdr.dst_addr.a[j] != 0) { memset(rule, 0, sizeof(struct txgbe_fdir_rule)); rte_flow_error_set(error, EINVAL, @@ -2613,7 +2611,5 @@ txgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, /* check dst addr mask */ for (j = 0; j < 16; j++) { - if (ipv6_mask->hdr.dst_addr.a[j] == UINT8_MAX) { - rule->mask.dst_ipv6_mask |= 1 << j; - } else if (ipv6_mask->hdr.dst_addr.a[j] != 0) { + if (ipv6_mask->hdr.dst_addr.a[j] != 0) { memset(rule, 0, sizeof(struct txgbe_fdir_rule)); rte_flow_error_set(error, EINVAL, -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-11-21 11:05:10.689113764 +0000 +++ 0035-net-txgbe-fix-FDIR-input-mask.patch 2025-11-21 11:05:09.427201016 +0000 @@ -1 +1 @@ -From a2d4de27109033d5061da44aed919bf46cfd7ca9 Mon Sep 17 00:00:00 2001 +From e00d3be49ba945ff2b74bf983a08a8a5dc5c5deb Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a2d4de27109033d5061da44aed919bf46cfd7ca9 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -109 +110 @@ -index 095c84823f..d3113b6fc8 100644 +index a820081dce..cb8004e48c 100644