Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/ixgbe: fix fdirctrl register setting
From: Ferruh Yigit <hidden>
Date: 2021-01-05 12:10:03
On 12/22/2020 7:23 AM, Guo, Jia wrote:
Acked-by: Jeff Guo <redacted>quoted
-----Original Message----- From: Zhou, JunX W <redacted> Sent: Tuesday, December 22, 2020 2:51 PM To: Yu, DapengX <redacted>; Guo, Jia <redacted> Cc: dev@dpdk.org; Yu, DapengX <redacted>; stable@dpdk.org Subject: RE: [dpdk-dev] [PATCH v2] net/ixgbe: fix fdirctrl register setting Tested-by: Zhou, Jun <redacted> -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of dapengx.yu@intel.com Sent: Tuesday, December 15, 2020 6:11 PM To: Guo, Jia <redacted> Cc: dev@dpdk.org; Yu, DapengX <redacted>; stable@dpdk.org Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix fdirctrl register setting From: YU DAPENG <redacted> The function ixgbe_fdir_set_flexbytes_offset is used when create FDir rule for flexbytes. It set a register: FDIRCTRL.FLEX_OFFSET, which cause that even if the FDir flexbytes rule is destroyed, the rule still direct the packet and transfer it to the wrong place. It is because setting FDIRCTRL shall only be permitted on Flow Director initialization flow or clearing the Flow Director table according to intel datasheet, otherwise unexpected happens. In order to evade the limit, add code to set FDIRCMD.CLEARHT to 1b and then clear it back to 0b to make the setting act like the Flow Director initialization flow or clearing the Flow Director table. Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API") Cc: stable@dpdk.org Signed-off-by: YU DAPENG <redacted>
Updating the commit log as following:
net/ixgbe: fix flexbytes flow director rule
When a flexbytes flow director rule is created, the FDIRCTRL.FLEX_OFFSET
register is set, and it keeps its affect even after the flow director
flexbytes rule is destroyed, causing packets to be transferred to the
wrong place.
It is because setting FDIRCTRL shall only be permitted on Flow Director
initialization flow or clearing the Flow Director table according to the
datasheet, otherwise device may behave unexpectedly.
In order to evade this limitation, simulate the Flow Director
initialization flow or clearing the Flow Director table by setting
FDIRCMD.CLEARHT to 0x1B and then clear it back to 0x0B.
Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu [off-list ref]
Tested-by: Jun Zhou [off-list ref]
Acked-by: Jeff Guo [off-list ref]
Please prefer the "Dapeng Yu [off-list ref]" signature to be consistent.