patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 3/3] net/txgbe: fix L4 port mask in FDIR
Date: Thu, 12 Aug 2021 10:00:20 +0800	[thread overview]
Message-ID: <20210812020020.12656-4-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20210812020020.12656-1-jiawenwu@trustnetic.com>

Remove bit reverse for TCP/UDP port mask, since it causes the flows with
some TCP/UDP ports to disobey the flow director rules.

Fixes: ea230dda16ad ("net/txgbe: configure flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_fdir.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index c8ff4b142c..8abb862286 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -165,18 +165,6 @@ configure_fdir_flags(const struct rte_fdir_conf *conf,
 	return 0;
 }
 
-static inline uint32_t
-reverse_fdir_bmks(uint16_t hi_dword, uint16_t lo_dword)
-{
-	uint32_t mask = hi_dword << 16;
-
-	mask |= lo_dword;
-	mask = ((mask & 0x55555555) << 1) | ((mask & 0xAAAAAAAA) >> 1);
-	mask = ((mask & 0x33333333) << 2) | ((mask & 0xCCCCCCCC) >> 2);
-	mask = ((mask & 0x0F0F0F0F) << 4) | ((mask & 0xF0F0F0F0) >> 4);
-	return ((mask & 0x00FF00FF) << 8) | ((mask & 0xFF00FF00) >> 8);
-}
-
 int
 txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
 {
@@ -213,9 +201,9 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
 	/* TBD: don't support encapsulation yet */
 	wr32(hw, TXGBE_FDIRMSK, fdirm);
 
-	/* store the TCP/UDP port masks, bit reversed from port layout */
-	fdirtcpm = reverse_fdir_bmks(rte_be_to_cpu_16(info->mask.dst_port_mask),
-			rte_be_to_cpu_16(info->mask.src_port_mask));
+	/* store the TCP/UDP port masks */
+	fdirtcpm = rte_be_to_cpu_16(info->mask.dst_port_mask) << 16;
+	fdirtcpm |= rte_be_to_cpu_16(info->mask.src_port_mask);
 
 	/* write all the same so that UDP, TCP and SCTP use the same mask
 	 * (little-endian)
-- 
2.21.0.windows.1




      parent reply	other threads:[~2021-08-12  2:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210812020020.12656-1-jiawenwu@trustnetic.com>
2021-08-12  2:00 ` [dpdk-stable] [PATCH 1/3] net/txgbe: fix link status when device stopped Jiawen Wu
2021-08-12  2:00 ` [dpdk-stable] [PATCH 2/3] net/txgbe: fix to read SFP module's SFF-8472 data Jiawen Wu
2021-08-12  2:00 ` Jiawen Wu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210812020020.12656-4-jiawenwu@trustnetic.com \
    --to=jiawenwu@trustnetic.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).