]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/mlx5/linux/mlx5_os.c
net/mlx5: create global default miss action
[dpdk.git] / drivers / net / mlx5 / linux / mlx5_os.c
index a579ddefc0c16050ee0284ab957f43d2f8802cb3..ae735a3616fedbf58134b4fb6391f15041d9b14c 100644 (file)
@@ -305,6 +305,10 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
        }
        sh->pop_vlan_action = mlx5_glue->dr_create_flow_action_pop_vlan();
 #endif /* HAVE_MLX5DV_DR */
+       sh->default_miss_action =
+                       mlx5_glue->dr_create_flow_action_default_miss();
+       if (!sh->default_miss_action)
+               DRV_LOG(WARNING, "Default miss action is not supported.");
        return 0;
 error:
        /* Rollback the created objects. */
@@ -388,6 +392,9 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
        }
        pthread_mutex_destroy(&sh->dv_mutex);
 #endif /* HAVE_MLX5DV_DR */
+       if (sh->default_miss_action)
+               mlx5_glue->destroy_flow_action
+                               (sh->default_miss_action);
        if (sh->encaps_decaps) {
                mlx5_hlist_destroy(sh->encaps_decaps, NULL, NULL);
                sh->encaps_decaps = NULL;