net/ice: fix flow validation for void item type
authorYing A Wang <ying.a.wang@intel.com>
Thu, 18 Jul 2019 01:38:41 +0000 (09:38 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
ice_get_flow_field should not set error if item->type is
RTE_FLOW_ITEM_TYPE_VOID.
This patch fixes this issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_generic_flow.c

index c2931a1..464f6ec 100644 (file)
@@ -465,7 +465,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[],
                case RTE_FLOW_ITEM_TYPE_NVGRE:
                        nvgre_spec = item->spec;
                        nvgre_mask = item->mask;
-                       /* Check if VXLAN item is used to describe protocol.
+                       /* Check if NVGRE item is used to describe protocol.
                         * If yes, both spec and mask should be NULL.
                         * If no, both spec and mask shouldn't be NULL.
                         */
@@ -479,6 +479,8 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[],
                        }
                        is_tunnel = 1;
 
+                       break;
+               case RTE_FLOW_ITEM_TYPE_VOID:
                        break;
                default:
                        rte_flow_error_set(error, EINVAL,