net/mlx5: block pop VLAN action on Tx
[dpdk.git] / drivers / net / mlx5 / mlx5_flow_dv.c
index b0d5688..9dc08ce 100644 (file)
@@ -1634,6 +1634,12 @@ flow_dv_validate_action_pop_vlan(struct rte_eth_dev *dev,
                                          RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
                                          NULL,
                                          "pop vlan action is not supported");
+       if (attr->egress)
+               return rte_flow_error_set(error, ENOTSUP,
+                                         RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
+                                         NULL,
+                                         "pop vlan action not supported for "
+                                         "egress");
        /*
         * Check for inconsistencies:
         *  fail strip_vlan in a flow that matches packets without VLAN tags.
@@ -1741,6 +1747,12 @@ flow_dv_validate_action_push_vlan(uint64_t action_flags,
 {
        const struct rte_flow_action_of_push_vlan *push_vlan = action->conf;
 
+       if (attr->ingress)
+               return rte_flow_error_set(error, ENOTSUP,
+                                         RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,
+                                         NULL,
+                                         "push VLAN action not supported for "
+                                         "ingress");
        if (push_vlan->ethertype != RTE_BE16(RTE_ETHER_TYPE_VLAN) &&
            push_vlan->ethertype != RTE_BE16(RTE_ETHER_TYPE_QINQ))
                return rte_flow_error_set(error, EINVAL,