net/mlx5: fix meter policy with RSS action
[dpdk.git] / drivers / net / mlx5 / mlx5_flow.c
index e5e062d..c5d4a95 100644 (file)
@@ -2124,7 +2124,7 @@ mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item,
                                          RTE_FLOW_ERROR_TYPE_ITEM, item,
                                          "IPv4 cannot follow L2/VLAN layer "
                                          "which ether type is not IPv4");
-       if (item_flags & MLX5_FLOW_LAYER_IPIP) {
+       if (item_flags & MLX5_FLOW_LAYER_TUNNEL) {
                if (mask && spec)
                        next_proto = mask->hdr.next_proto_id &
                                     spec->hdr.next_proto_id;
@@ -2232,7 +2232,7 @@ mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item,
                                          "which ether type is not IPv6");
        if (mask && mask->hdr.proto == UINT8_MAX && spec)
                next_proto = spec->hdr.proto;
-       if (item_flags & MLX5_FLOW_LAYER_IPV6_ENCAP) {
+       if (item_flags & MLX5_FLOW_LAYER_TUNNEL) {
                if (next_proto == IPPROTO_IPIP || next_proto == IPPROTO_IPV6)
                        return rte_flow_error_set(error, EINVAL,
                                                  RTE_FLOW_ERROR_TYPE_ITEM,
@@ -4613,7 +4613,6 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
                        struct mlx5_flow dev_flow = {0};
                        struct mlx5_flow_handle dev_handle = { {0} };
 
-                       rss_desc_v[i] = wks->rss_desc;
                        if (policy->is_rss) {
                                const void *rss_act =
                                        policy->act_cnt[i].rss->conf;
@@ -4641,14 +4640,19 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
                                if (flow_drv_translate(dev, &dev_flow, attr,
                                                items, rss_actions, error))
                                        goto exit;
+                               rss_desc_v[i] = wks->rss_desc;
                                rss_desc_v[i].key_len = MLX5_RSS_HASH_KEY_LEN;
                                rss_desc_v[i].hash_fields =
                                                dev_flow.hash_fields;
                                rss_desc_v[i].queue_num =
                                                rss_desc_v[i].hash_fields ?
                                                rss_desc_v[i].queue_num : 1;
+                               rss_desc_v[i].tunnel =
+                                       !!(dev_flow.handle->layers &
+                                       MLX5_FLOW_LAYER_TUNNEL);
                        } else {
                                /* This is queue action. */
+                               rss_desc_v[i] = wks->rss_desc;
                                rss_desc_v[i].key_len = 0;
                                rss_desc_v[i].hash_fields = 0;
                                rss_desc_v[i].queue =