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 04ADAA0C4D; Thu, 12 Aug 2021 04:00:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24F324120B; Thu, 12 Aug 2021 04:00:43 +0200 (CEST) Received: from smtpproxy21.qq.com (smtpbg702.qq.com [203.205.195.102]) by mails.dpdk.org (Postfix) with ESMTP id C8260411C0 for ; Thu, 12 Aug 2021 04:00:39 +0200 (CEST) X-QQ-mid: bizesmtp31t1628733631t27o1180 Received: from jiawenwu.trustnetic.com (unknown [183.129.236.74]) by esmtp6.qq.com (ESMTP) with id ; Thu, 12 Aug 2021 10:00:31 +0800 (CST) X-QQ-SSF: 01400000002000E0F000B00A0000000 X-QQ-FEAT: a7KvnLxF6FfzKUbV6o6Mzc1p6Aq9WqcxVTh/y3z6rVrOqfN6UIdTl58ROL0tG YXZdss9nIias0qDo7D+BOxQ1fe11q+kFBr4vfxyb4TiNlZZhtKDWZQKVFn1q3KTZlLUDodD Ogc3leY+0x2J0VGczYIVKB9507+Ggavkyf3Jh8iep+qNl3AoSuyPPk40ibxI1lVmS9vH854 Z5tB5mI9ITFsEdrHvK4rkPxCz/WO/SV688/EnVxcDlNBhZxq6Qc0KmvkbptDerdZjI17u7F t0ZzwtYQmUX5PxsDQ8YqDpsK1o4NqBgS3cY16RnNdfvPQhBH+mZ0NiOAIPBu+qDXb8gSC38 7Dzt5fYPbHr6afKJJQ= X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Date: Thu, 12 Aug 2021 10:00:20 +0800 Message-Id: <20210812020020.12656-4-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210812020020.12656-1-jiawenwu@trustnetic.com> References: <20210812020020.12656-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH 3/3] net/txgbe: fix L4 port mask in FDIR X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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