[dpdk-dev] net/ixgbe: add tci mask check in fdir pasrer

Message ID 1486111437-32778-1-git-send-email-wei.zhao1@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Zhao1, Wei Feb. 3, 2017, 8:43 a.m. UTC
  Add more check on the tci mask of vlan and vxlan parser
in fdir filter rule pattern parser.If do not add such check,
it maybe cause error in fdir configuration set check.

Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit Feb. 3, 2017, 10:52 p.m. UTC | #1
On 2/3/2017 8:43 AM, Wei Zhao wrote:
> Add more check on the tci mask of vlan and vxlan parser
> in fdir filter rule pattern parser.If do not add such check,
> it maybe cause error in fdir configuration set check.
> 
> Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

Cc: stable@dpdk.org

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 82aceed..d64cfd1 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1400,7 +1400,7 @@  ixgbe_parse_fdir_act_attr(const struct rte_flow_attr *attr,
  * ETH		dst_addr
 		{0xAC, 0x7B, 0xA1,	{0xFF, 0xFF, 0xFF,
 		0x2C, 0x6D, 0x36}	0xFF, 0xFF, 0xFF}
- * MAC VLAN	tci	0x2016		0xFFFF
+ * MAC VLAN	tci	0x2016		0xEFFF
  *		tpid	0x8100		0xFFFF
  * END
  * Other members in mask and spec should set to 0x00.
@@ -1617,6 +1617,7 @@  ixgbe_parse_fdir_filter_normal(const struct rte_flow_attr *attr,
 			return -rte_errno;
 		}
 		rule->mask.vlan_tci_mask = vlan_mask->tci;
+		rule->mask.vlan_tci_mask &= 0xEFFF;
 		/* More than one tags are not supported. */
 
 		/**
@@ -2360,6 +2361,7 @@  ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 			return -rte_errno;
 		}
 		rule->mask.vlan_tci_mask = vlan_mask->tci;
+		rule->mask.vlan_tci_mask &= 0xEFFF;
 		/* More than one tags are not supported. */
 
 		/**