patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/ixgbe: fix IPv6 mask in fdir
@ 2023-03-03  4:52 Kaiwen Deng
  2023-03-03  7:49 ` Jiale, SongX
  0 siblings, 1 reply; 3+ messages in thread
From: Kaiwen Deng @ 2023-03-03  4:52 UTC (permalink / raw)
  To: dev
  Cc: stable, qiming.yang, yidingx.zhou, Kaiwen Deng, Wenjun Wu,
	Qi Zhang, Wenzhuo Lu

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")
Cc: stable@dpdk.org

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 79c84044af..eac81ee489 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -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,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-03  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03  4:52 [PATCH] net/ixgbe: fix IPv6 mask in fdir Kaiwen Deng
2023-03-03  7:49 ` Jiale, SongX
2023-03-03  9:24   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).