Skip to contentSkip to conversation

net/ixgbe: remove a useless item type check

PATCH Superseded Wei Zhao 3 participants 11 messages Apr 20, 2017 – Apr 27, 2017 Network drivers

lore
Share & tools
lore

Wei Zhao

author
#0 lore raw

PATCH 1/2 net/ixgbe: remove a useless item type check

Remove a useless item type check for fdir flow rule.

Fixes 11777435c72 ("net/ixgbe: parse flow director filter")
---
 drivers/net/ixgbe/ixgbe_flow.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/net/ixgbe/ixgbe_flow.c +1 -8
index 7ce740e..11d8cc9 100644
@@ -2346,16 +2346,9 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 				RTE_FLOW_ERROR_TYPE_ITEM,
 				item, "Not supported by fdir filter");
 			return -rte_errno;
-		} else if (item->type != RTE_FLOW_ITEM_TYPE_END) {
-			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
-			rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ITEM,
-				item, "Not supported by fdir filter");
-			return -rte_errno;
 		}
+
 		/* check if the next not void item is END */
-		index++;
-		NEXT_ITEM_OF_PATTERN(item, pattern, index);
 		if (item->type != RTE_FLOW_ITEM_TYPE_END) {
 			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 			rte_flow_error_set(error, EINVAL,
Signature · 1 line
2.9.3
author
#1 lore raw

PATCH 2/2 net/ixgbe: fix a error type check for flow type

The type check for flow_type should be IXGBE_ATR_FLOW_TYPE_IPV4 in special card not RTE_ETH_FLOW_NONFRAG_IPV4_OTHER.

Fixes dc0c16105d2 ("ixgbe: fix X550 flow director check")
---
 drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_fdir.c +1 -1
index 3b9d60c..6f19b91 100644
@@ -1241,7 +1241,7 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
 	     hw->mac.type == ixgbe_mac_X550EM_x ||
 	     hw->mac.type == ixgbe_mac_X550EM_a) &&
 	    (rule->ixgbe_fdir.formatted.flow_type ==
-	     RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) &&
+	     IXGBE_ATR_FLOW_TYPE_IPV4) &&
 	    (info->mask.src_port_mask != 0 ||
 	     info->mask.dst_port_mask != 0)) {
 		PMD_DRV_LOG(ERR, "By this device,"
Signature · 1 line
2.9.3
#4 lore raw
In reply to Wei Zhao

Hi Wei,

Quoted 22 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Thursday, April 20, 2017 11:28 AM
To: [email protected]
Cc: Zhao1, Wei
Subject: [dpdk-dev] [PATCH 1/2] net/ixgbe: remove a useless item type check

Remove a useless item type check for fdir flow rule.

Fixes 11777435c72 ("net/ixgbe: parse flow director filter")
---
 drivers/net/ixgbe/ixgbe_flow.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/net/ixgbe/ixgbe_flow.c +0 -0
index 7ce740e..11d8cc9 100644
@@ -2346,16 +2346,9 @@ ixgbe_parse_fdir_filter_tunnel(const struct
 rte_flow_attr *attr,

drivers/net/ixgbe/ixgbe_flow.c ixgbe_parse_fdir_filter_tunnel(const struct · line 2350

Quoted 10 lines
drivers/net/ixgbe/ixgbe_flow.c +0 -6
 				RTE_FLOW_ERROR_TYPE_ITEM,
 				item, "Not supported by fdir filter");
 			return -rte_errno;
-		} else if (item->type != RTE_FLOW_ITEM_TYPE_END) {
-			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
-			rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ITEM,
-				item, "Not supported by fdir filter");
-			return -rte_errno;
 		}

Seems the item type only can be END. Why not remove the VLAN check either?

Quoted 9 lines
drivers/net/ixgbe/ixgbe_flow.c +1 -2
+
 		/* check if the next not void item is END */
-		index++;
-		NEXT_ITEM_OF_PATTERN(item, pattern, index);
 		if (item->type != RTE_FLOW_ITEM_TYPE_END) {
 			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));

rte_flow_error_set(error, EINVAL,
--
2.9.3

#2 lore raw

Re: [PATCH 2/2] net/ixgbe: fix a error type check for flow type

In reply to Wei Zhao

Hi Wei,

Quoted 32 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Thursday, April 20, 2017 11:28 AM
To: [email protected]
Cc: Zhao1, Wei
Subject: [dpdk-dev] [PATCH 2/2] net/ixgbe: fix a error type check for flow type

The type check for flow_type should be IXGBE_ATR_FLOW_TYPE_IPV4 in special card not RTE_ETH_FLOW_NONFRAG_IPV4_OTHER.

Fixes dc0c16105d2 ("ixgbe: fix X550 flow director check")
---
 drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_fdir.c +1 -2
index 3b9d60c..6f19b91 100644
@@ -1241,7 +1241,7 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
 	     hw->mac.type == ixgbe_mac_X550EM_x ||
 	     hw->mac.type == ixgbe_mac_X550EM_a) &&
 	    (rule->ixgbe_fdir.formatted.flow_type ==
-	     RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) &&
+	     IXGBE_ATR_FLOW_TYPE_IPV4) &&
 	    (info->mask.src_port_mask != 0 ||
 	     info->mask.dst_port_mask != 0)) {
 		PMD_DRV_LOG(ERR, "By this device,"
--
Quoted 1 line

2.9.3

It's a good fix. But please change the comments and error log accordingly.

author
#3 lore raw

Re: [PATCH 2/2] net/ixgbe: fix a error type check for flow type

Hi, Wenzhuo

Quoted 34 lines

-----Original Message-----
From: Lu, Wenzhuo
Sent: Friday, April 21, 2017 10:49 AM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: Zhao1, Wei <[email protected]>
Subject: RE: [dpdk-dev] [PATCH 2/2] net/ixgbe: fix a error type check for flow type

Hi Wei,

drivers/net/ixgbe/ixgbe_fdir.c ixgbe_fdir_filter_program(struct rte_eth_dev

Quoted 23 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Thursday, April 20, 2017 11:28 AM
To: [email protected]
Cc: Zhao1, Wei
Subject: [dpdk-dev] [PATCH 2/2] net/ixgbe: fix a error type check for flow type

The type check for flow_type should be IXGBE_ATR_FLOW_TYPE_IPV4 in special card not RTE_ETH_FLOW_NONFRAG_IPV4_OTHER.

Fixes dc0c16105d2 ("ixgbe: fix X550 flow director check")
---
 drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_fdir.c index 3b9d60c..6f19b91 100644

drivers/net/ixgbe/ixgbe_fdir.c +0 -0
@@ -1241,7 +1241,7 @@ ixgbe_fdir_filter_program(struct rte_eth_dev

*dev,

Quoted 11 lines
Quoted 10 lines
drivers/net/ixgbe/ixgbe_fdir.c +1 -2
 	     hw->mac.type == ixgbe_mac_X550EM_x ||
 	     hw->mac.type == ixgbe_mac_X550EM_a) &&
 	    (rule->ixgbe_fdir.formatted.flow_type ==
-	     RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) &&
+	     IXGBE_ATR_FLOW_TYPE_IPV4) &&
 	    (info->mask.src_port_mask != 0 ||
 	     info->mask.dst_port_mask != 0)) {
 		PMD_DRV_LOG(ERR, "By this device,"
--

2.9.3

It’s a good fix. But please change the comments and error log accordingly.

I will commit a new v2 for this patch as your suggestion.

author
#5 lore raw
In reply to Lu, Wenzhuo

Hi, wenzhuo

Quoted 37 lines

-----Original Message-----
From: Lu, Wenzhuo
Sent: Friday, April 21, 2017 10:35 AM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: Zhao1, Wei <[email protected]>
Subject: RE: [dpdk-dev] [PATCH 1/2] net/ixgbe: remove a useless item type check

Hi Wei,

Quoted 27 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Thursday, April 20, 2017 11:28 AM
To: [email protected]
Cc: Zhao1, Wei
Subject: [dpdk-dev] [PATCH 1/2] net/ixgbe: remove a useless item type check

Remove a useless item type check for fdir flow rule.

Fixes 11777435c72 ("net/ixgbe: parse flow director filter")
---
 drivers/net/ixgbe/ixgbe_flow.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_flow.c index 7ce740e..11d8cc9 100644

drivers/net/ixgbe/ixgbe_flow.c +0 -1
@@ -2346,16 +2346,9 @@ ixgbe_parse_fdir_filter_tunnel(const struct
 rte_flow_attr *attr,
 				RTE_FLOW_ERROR_TYPE_ITEM,
 				item, "Not supported by fdir filter");
 			return -rte_errno;
-		} else if (item->type != RTE_FLOW_ITEM_TYPE_END) {
Quoted 8 lines

drivers/net/ixgbe/ixgbe_flow.c ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr, · line 2349

Quoted 6 lines
drivers/net/ixgbe/ixgbe_flow.c +0 -5
-			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
-			rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ITEM,
-				item, "Not supported by fdir filter");
-			return -rte_errno;
 		}

Seems the item type only can be END. Why not remove the VLAN check either?

Ok, I will commit a new v2 for this.

Quoted 10 lines
Quoted 10 lines
drivers/net/ixgbe/ixgbe_flow.c +1 -2
+
 		/* check if the next not void item is END */
-		index++;
-		NEXT_ITEM_OF_PATTERN(item, pattern, index);
 		if (item->type != RTE_FLOW_ITEM_TYPE_END) {
 			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));

rte_flow_error_set(error, EINVAL,
--
2.9.3

author
#6 lore raw

PATCH v2 1/2 net/ixgbe: remove a useless item type check

In reply to Wei Zhao

Remove a useless item type check for fdir flow rule.

v2:
-delete item type check of vlan

aFixes: 11777435c72 ("net/ixgbe: parse flow director filter")

---
 drivers/net/ixgbe/ixgbe_flow.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_flow.c +1 -18
index 98e414a..59ddba6 100644
@@ -2305,27 +2305,10 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 		rule->mask.vlan_tci_mask &= rte_cpu_to_be_16(0xEFFF);
 		/* More than one tags are not supported. */
 
-		/**
-		 * Check if the next not void item is not vlan.
-		 */
-		index++;
-		NEXT_ITEM_OF_PATTERN(item, pattern, index);
-		if (item->type == RTE_FLOW_ITEM_TYPE_VLAN) {
-			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
-			rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ITEM,
-				item, "Not supported by fdir filter");
-			return -rte_errno;
-		} else if (item->type != RTE_FLOW_ITEM_TYPE_END) {
-			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
-			rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ITEM,
-				item, "Not supported by fdir filter");
-			return -rte_errno;
-		}
 		/* check if the next not void item is END */
 		index++;
 		NEXT_ITEM_OF_PATTERN(item, pattern, index);
+
 		if (item->type != RTE_FLOW_ITEM_TYPE_END) {
 			memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 			rte_flow_error_set(error, EINVAL,
Signature · 1 line
2.9.3
author
#7 lore raw

PATCH v2 2/2 net/ixgbe: fix a error type check for flow type

The type check for flow_type should be IXGBE_ATR_FLOW_TYPE_IPV4 in special card not RTE_ETH_FLOW_NONFRAG_IPV4_OTHER.

v2:
-change the comments and error log accordingly.

Fixes dc0c16105d2 ("ixgbe: fix X550 flow director check")
---
 drivers/net/ixgbe/ixgbe_fdir.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_fdir.c +3 -3
index 3b9d60c..d6e48e9 100644
@@ -1232,7 +1232,7 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
 
 	/*
 	 * Sanity check for x550.
-	 * When adding a new filter with flow type set to IPv4-other,
+	 * When adding a new filter with flow type set to IPv4,
 	 * the flow director mask should be configed before,
 	 * and the L4 protocol and ports are masked.
 	 */
@@ -1241,11 +1241,11 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
 	     hw->mac.type == ixgbe_mac_X550EM_x ||
 	     hw->mac.type == ixgbe_mac_X550EM_a) &&
 	    (rule->ixgbe_fdir.formatted.flow_type ==
-	     RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) &&
+	     IXGBE_ATR_FLOW_TYPE_IPV4) &&
 	    (info->mask.src_port_mask != 0 ||
 	     info->mask.dst_port_mask != 0)) {
 		PMD_DRV_LOG(ERR, "By this device,"
-			    " IPv4-other is not supported without"
+			    " IPv4 is not supported without"
 			    " L4 protocol and ports masked!");
 		return -ENOTSUP;
 	}
Signature · 1 line
2.9.3
Acked-by on v2 2/2
#8 lore raw

Re: [PATCH v2 2/2] net/ixgbe: fix a error type check for flow type

Hi,

Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Thursday, April 27, 2017 2:34 PM
To: [email protected]
Cc: Zhao1, Wei
Subject: [dpdk-dev] [PATCH v2 2/2] net/ixgbe: fix a error type check for flow type

The type check for flow_type should be IXGBE_ATR_FLOW_TYPE_IPV4 in special card not RTE_ETH_FLOW_NONFRAG_IPV4_OTHER.

Quoted 6 lines

v2:
-change the comments and error log accordingly.

Fixes dc0c16105d2 ("ixgbe: fix X550 flow director check")
Acked-by on v2 1/2
#9 lore raw
In reply to Wei Zhao

Hi,

Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Thursday, April 27, 2017 2:34 PM
To: [email protected]
Cc: Zhao1, Wei
Subject: [dpdk-dev] [PATCH v2 1/2] net/ixgbe: remove a useless item type check

Quoted 8 lines

Remove a useless item type check for fdir flow rule.

v2:
-delete item type check of vlan

aFixes: 11777435c72 ("net/ixgbe: parse flow director filter")

#10 lore raw
Quoted 13 lines · Wenzhuo

Hi,

Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Thursday, April 27, 2017 2:34 PM
To: [email protected]
Cc: Zhao1, Wei
Subject: [dpdk-dev] [PATCH v2 1/2] net/ixgbe: remove a useless item type check

Remove a useless item type check for fdir flow rule.

Quoted 7 lines
Quoted 6 lines

v2:
-delete item type check of vlan

aFixes: 11777435c72 ("net/ixgbe: parse flow director filter")

Series applied to dpdk-next-net/master, thanks.