net/mlx5: create relaxed ordering memory regions
[dpdk.git] / drivers / net / mlx5 / mlx5_flow_dv.c
index e7278f0..809833b 100644 (file)
@@ -2109,10 +2109,6 @@ flow_dv_validate_action_set_meta(struct rte_eth_dev *dev,
                return rte_flow_error_set(error, EINVAL,
                                          RTE_FLOW_ERROR_TYPE_ACTION, action,
                                          "meta data must be within reg C0");
-       if (!(conf->data & conf->mask))
-               return rte_flow_error_set(error, EINVAL,
-                                         RTE_FLOW_ERROR_TYPE_ACTION, action,
-                                         "zero value has no effect");
        return 0;
 }
 
@@ -3966,6 +3962,7 @@ flow_dv_create_counter_stat_mem_mng(struct rte_eth_dev *dev, int raws_n)
        mkey_attr.pg_access = 0;
        mkey_attr.klm_array = NULL;
        mkey_attr.klm_num = 0;
+       mkey_attr.relaxed_ordering = 1;
        mem_mng->dm = mlx5_devx_cmd_mkey_create(sh->ctx, &mkey_attr);
        if (!mem_mng->dm) {
                mlx5_glue->devx_umem_dereg(mem_mng->umem);
@@ -5468,6 +5465,13 @@ flow_dv_translate_item_ipv4(void *matcher, void *key,
        else
                MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0x4);
        MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 4);
+       /*
+        * On outer header (which must contains L2), or inner header with L2,
+        * set cvlan_tag mask bit to mark this packet as untagged.
+        * This should be done even if item->spec is empty.
+        */
+       if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
+               MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1);
        if (!ipv4_v)
                return;
        if (!ipv4_m)
@@ -5499,12 +5503,6 @@ flow_dv_translate_item_ipv4(void *matcher, void *key,
                 ipv4_m->hdr.time_to_live);
        MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit,
                 ipv4_v->hdr.time_to_live & ipv4_m->hdr.time_to_live);
-       /*
-        * On outer header (which must contains L2), or inner header with L2,
-        * set cvlan_tag mask bit to mark this packet as untagged.
-        */
-       if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
-               MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1);
 }
 
 /**
@@ -5569,6 +5567,13 @@ flow_dv_translate_item_ipv6(void *matcher, void *key,
        else
                MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0x6);
        MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 6);
+       /*
+        * On outer header (which must contains L2), or inner header with L2,
+        * set cvlan_tag mask bit to mark this packet as untagged.
+        * This should be done even if item->spec is empty.
+        */
+       if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
+               MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1);
        if (!ipv6_v)
                return;
        if (!ipv6_m)
@@ -5617,12 +5622,6 @@ flow_dv_translate_item_ipv6(void *matcher, void *key,
                 ipv6_m->hdr.hop_limits);
        MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit,
                 ipv6_v->hdr.hop_limits & ipv6_m->hdr.hop_limits);
-       /*
-        * On outer header (which must contains L2), or inner header with L2,
-        * set cvlan_tag mask bit to mark this packet as untagged.
-        */
-       if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2)
-               MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1);
 }
 
 /**