Hardware supports FDIR flex field base setting from start of MAC header,
IP header, L4 header, L4 payload. So for IP packet which has no L4 header,
it cannot match the raw bytes with relative offset start from L3 payload.
And FDIR flex bytes rule cannot match L2 packets.

Therefore, we will declare that the relative offset is only used for
matching the L4 packets.

Fixes: aa4974765499 ("net/txgbe: fix raw pattern match for FDIR rule")
Cc: [email protected]
Signed-off-by: Jiawen Wu <[email protected]>
---
 drivers/net/txgbe/txgbe_fdir.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index 77d0cc4c30..8d181db33f 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -258,10 +258,7 @@ txgbe_fdir_get_flex_base(struct txgbe_fdir_rule *rule)
        if (rule->input.flow_type & TXGBE_ATR_L4TYPE_MASK)
                return TXGBE_FDIRFLEXCFG_BASE_PAY;
 
-       if (rule->input.flow_type & TXGBE_ATR_L3TYPE_MASK)
-               return TXGBE_FDIRFLEXCFG_BASE_L3;
-
-       return TXGBE_FDIRFLEXCFG_BASE_L2;
+       return TXGBE_FDIRFLEXCFG_BASE_L3;
 }
 
 int
-- 
2.48.1

Reply via email to