Skip to contentSkip to conversation

net/ixgbe: fix IPv6 mask in fdir

PATCH Applied Kaiwen Deng 3 participants 3 messages Mar 3, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ixgbe: fix IPv6 mask in fdir

Rules without addr mask cannot be created together in ixgbe when setting IPv6 addr mask to default value as 0.

This commit is to change the default value of IPv6 addr mask as '0xFF'.

Fixes cba954b7beda ("net/ixgbe: enable IPv6 mask in flow rules")
Fixes 7d629cacedee ("net/ixgbe: enable IPv6 for consistent API")
---
 drivers/net/ixgbe/ixgbe_flow.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/net/ixgbe/ixgbe_flow.c +6 -10
index 79c84044af..eac81ee489 100644
@@ -1645,10 +1645,6 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 	memset(&rule->mask, 0xFF, sizeof(struct ixgbe_hw_fdir_mask));
 	rule->mask.vlan_tci_mask = 0;
 	rule->mask.flex_bytes_mask = 0;
-	rule->mask.dst_port_mask = 0;
-	rule->mask.src_port_mask = 0;
-	rule->mask.src_ipv6_mask = 0;
-	rule->mask.dst_ipv6_mask = 0;
 
 	/**
 	 * The first not void item should be
@@ -1922,9 +1918,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 
 		/* check src addr mask */
 		for (j = 0; j < 16; j++) {
-			if (ipv6_mask->hdr.src_addr[j] == UINT8_MAX) {
-				rule->mask.src_ipv6_mask |= 1 << j;
-			} else if (ipv6_mask->hdr.src_addr[j] != 0) {
+			if (ipv6_mask->hdr.src_addr[j] == 0) {
+				rule->mask.src_ipv6_mask &= ~(1 << j);
+			} else if (ipv6_mask->hdr.src_addr[j] != UINT8_MAX) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1935,9 +1931,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 
 		/* check dst addr mask */
 		for (j = 0; j < 16; j++) {
-			if (ipv6_mask->hdr.dst_addr[j] == UINT8_MAX) {
-				rule->mask.dst_ipv6_mask |= 1 << j;
-			} else if (ipv6_mask->hdr.dst_addr[j] != 0) {
+			if (ipv6_mask->hdr.dst_addr[j] == 0) {
+				rule->mask.dst_ipv6_mask &= ~(1 << j);
+			} else if (ipv6_mask->hdr.dst_addr[j] != UINT8_MAX) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Kaiwen Deng <[email protected]>
Sent: Friday, March 3, 2023 12:52 PM
To: [email protected]
Cc: [email protected]; Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Deng, KaiwenX <[email protected]>; Wu, Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>
Subject: [PATCH] net/ixgbe: fix IPv6 mask in fdir

Rules without addr mask cannot be created together in ixgbe when setting IPv6 addr mask to default value as 0.

Quoted 8 lines

This commit is to change the default value of IPv6 addr mask as '0xFF'.

Fixes cba954b7beda ("net/ixgbe: enable IPv6 mask in flow rules")
Fixes 7d629cacedee ("net/ixgbe: enable IPv6 for consistent API")

---

Applied
#2 lore raw
Quoted 29 lines

-----Original Message-----
From: Jiale, SongX <[email protected]>
Sent: Friday, March 3, 2023 3:50 PM
To: Deng, KaiwenX <[email protected]>; [email protected]
Cc: [email protected]; Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Deng, KaiwenX <[email protected]>; Wu, Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>
Subject: RE: [PATCH] net/ixgbe: fix IPv6 mask in fdir

Quoted 17 lines

-----Original Message-----
From: Kaiwen Deng <[email protected]>
Sent: Friday, March 3, 2023 12:52 PM
To: [email protected]
Cc: [email protected]; Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Deng, KaiwenX <[email protected]>; Wu,
Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>; Lu, Wenzhuo <[email protected]>
Subject: [PATCH] net/ixgbe: fix IPv6 mask in fdir

Rules without addr mask cannot be created together in ixgbe when setting
IPv6 addr mask to default value as 0.

This commit is to change the default value of IPv6 addr mask as '0xFF'.

Quoted 7 lines
Quoted 6 lines
Fixes cba954b7beda ("net/ixgbe: enable IPv6 mask in flow rules")
Fixes 7d629cacedee ("net/ixgbe: enable IPv6 for consistent API")

---

Applied to dpdk-next-net-intel.

Thanks
Qi