]> git.droids-corp.org - dpdk.git/commitdiff
net/ixgbe: fix drop action for signature match
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 17 Jul 2017 11:46:35 +0000 (19:46 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 19 Jul 2017 08:09:13 +0000 (11:09 +0300)
Drop action is not supported by signature match, should return
error when try to create a signature match flow with drop action.

Fixes: a948d33bc05a ("net/ixgbe: enable signature match for consistent API")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ixgbe/ixgbe_flow.c

index f70bdb0c9f4d1e8abd8892b99a3cfa09a0930df9..cb177f3232601a1776cc2c77d0ef1c8abbb4f0c3 100644 (file)
@@ -1233,6 +1233,14 @@ ixgbe_parse_fdir_act_attr(const struct rte_flow_attr *attr,
                act_q = (const struct rte_flow_action_queue *)act->conf;
                rule->queue = act_q->index;
        } else { /* drop */
+               /* signature mode does not support drop action. */
+               if (rule->mode == RTE_FDIR_MODE_SIGNATURE) {
+                       memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
+                       rte_flow_error_set(error, EINVAL,
+                               RTE_FLOW_ERROR_TYPE_ACTION,
+                               act, "Not supported action.");
+                       return -rte_errno;
+               }
                rule->fdirflags = IXGBE_FDIRCMD_DROP;
        }