|
@@ -37,6 +37,7 @@
|
|
|
#include "fs_core.h"
|
|
|
#include "fs_cmd.h"
|
|
|
#include "diag/fs_tracepoint.h"
|
|
|
+#include "accel/ipsec.h"
|
|
|
|
|
|
#define INIT_TREE_NODE_ARRAY_SIZE(...) (sizeof((struct init_tree_node[]){__VA_ARGS__}) /\
|
|
|
sizeof(struct init_tree_node))
|
|
@@ -2049,6 +2050,11 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev,
|
|
|
return &steering->sniffer_tx_root_ns->ns;
|
|
|
else
|
|
|
return NULL;
|
|
|
+ case MLX5_FLOW_NAMESPACE_EGRESS:
|
|
|
+ if (steering->egress_root_ns)
|
|
|
+ return &steering->egress_root_ns->ns;
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
default:
|
|
|
return NULL;
|
|
|
}
|
|
@@ -2413,6 +2419,7 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev)
|
|
|
cleanup_root_ns(steering->fdb_root_ns);
|
|
|
cleanup_root_ns(steering->sniffer_rx_root_ns);
|
|
|
cleanup_root_ns(steering->sniffer_tx_root_ns);
|
|
|
+ cleanup_root_ns(steering->egress_root_ns);
|
|
|
mlx5_cleanup_fc_stats(dev);
|
|
|
kmem_cache_destroy(steering->ftes_cache);
|
|
|
kmem_cache_destroy(steering->fgs_cache);
|
|
@@ -2558,6 +2565,20 @@ cleanup_root_ns:
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
+static int init_egress_root_ns(struct mlx5_flow_steering *steering)
|
|
|
+{
|
|
|
+ struct fs_prio *prio;
|
|
|
+
|
|
|
+ steering->egress_root_ns = create_root_ns(steering,
|
|
|
+ FS_FT_NIC_TX);
|
|
|
+ if (!steering->egress_root_ns)
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
+ /* create 1 prio*/
|
|
|
+ prio = fs_create_prio(&steering->egress_root_ns->ns, 0, 1);
|
|
|
+ return PTR_ERR_OR_ZERO(prio);
|
|
|
+}
|
|
|
+
|
|
|
int mlx5_init_fs(struct mlx5_core_dev *dev)
|
|
|
{
|
|
|
struct mlx5_flow_steering *steering;
|
|
@@ -2623,6 +2644,13 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
|
|
|
goto err;
|
|
|
}
|
|
|
|
|
|
+ if (mlx5_accel_ipsec_device_caps(steering->dev) &
|
|
|
+ MLX5_ACCEL_IPSEC_DEVICE) {
|
|
|
+ err = init_egress_root_ns(steering);
|
|
|
+ if (err)
|
|
|
+ goto err;
|
|
|
+ }
|
|
|
+
|
|
|
return 0;
|
|
|
err:
|
|
|
mlx5_cleanup_fs(dev);
|