net/txgbe: support ntuple filter add and delete
[dpdk.git] / drivers / net / mlx5 / mlx5_flow_verbs.c
index 04f6b40..2d43819 100644 (file)
@@ -39,6 +39,12 @@ static const uint32_t priority_map_5[][MLX5_PRIORITY_MAP_MAX] = {
        { 9, 10, 11 }, { 12, 13, 14 },
 };
 
+/* Verbs specification header. */
+struct ibv_spec_header {
+       enum ibv_flow_spec_type type;
+       uint16_t size;
+};
+
 /**
  * Discover the maximum number of priority available.
  *
@@ -1703,7 +1709,7 @@ flow_verbs_translate(struct rte_eth_dev *dev,
        struct mlx5_flow_rss_desc *rss_desc;
 
        MLX5_ASSERT(wks);
-       rss_desc = &wks->rss_desc[!!wks->flow_nested_idx];
+       rss_desc = &wks->rss_desc;
        if (priority == MLX5_FLOW_PRIO_RSVD)
                priority = priv->config.flow_prio - 1;
        for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
@@ -1956,7 +1962,7 @@ flow_verbs_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
        struct mlx5_flow_workspace *wks = mlx5_flow_get_thread_workspace();
 
        MLX5_ASSERT(wks);
-       for (idx = wks->flow_idx - 1; idx >= wks->flow_nested_idx; idx--) {
+       for (idx = wks->flow_idx - 1; idx >= 0; idx--) {
                dev_flow = &wks->flows[idx];
                handle = dev_flow->handle;
                if (handle->fate_action == MLX5_FLOW_FATE_DROP) {
@@ -1964,15 +1970,14 @@ flow_verbs_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
                        hrxq = priv->drop_queue.hrxq;
                } else {
                        uint32_t hrxq_idx;
-                       struct mlx5_flow_rss_desc *rss_desc =
-                               &wks->rss_desc[!!wks->flow_nested_idx];
+                       struct mlx5_flow_rss_desc *rss_desc = &wks->rss_desc;
 
                        MLX5_ASSERT(rss_desc->queue_num);
                        rss_desc->key_len = MLX5_RSS_HASH_KEY_LEN;
                        rss_desc->hash_fields = dev_flow->hash_fields;
                        rss_desc->tunnel = !!(handle->layers &
                                              MLX5_FLOW_LAYER_TUNNEL);
-                       rss_desc->standalone = false;
+                       rss_desc->shared_rss = 0;
                        hrxq_idx = mlx5_hrxq_get(dev, rss_desc);
                        hrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],
                                              hrxq_idx);