[dpdk-dev,v3,1/3] net/ixgbe: remove reduandent code

Message ID 1496338605-7338-2-git-send-email-qi.z.zhang@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

Qi Zhang June 1, 2017, 5:36 p.m. UTC
  Remove reduandent code.
item->type != RTE_FLOW_ITEM_TYPE_END already cover
item->type == RTE_FLOW_ITEM_TYPE_VLAN.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---

v3:
-fix comments.

 drivers/net/ixgbe/ixgbe_flow.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
  

Comments

Wenzhuo Lu June 2, 2017, 1:19 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Friday, June 2, 2017 1:37 AM
> To: Lu, Wenzhuo; Zhang, Helin
> Cc: dev@dpdk.org; Zhang, Qi Z
> Subject: [PATCH v3 1/3] net/ixgbe: remove reduandent code
> 
> Remove reduandent code.
> item->type != RTE_FLOW_ITEM_TYPE_END already cover type ==
> item->RTE_FLOW_ITEM_TYPE_VLAN.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index da7b1cc..60ca8d8 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1544,18 +1544,10 @@  ixgbe_parse_fdir_filter_normal(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.
-		 */
+		/* Next not void item must be END */
 		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) {
+		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,