aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mlx5/mlx5_core
diff options
context:
space:
mode:
authorPatrisious Haddad <phaddad@nvidia.com>2023-04-04 06:01:24 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-11-15 23:08:17 +0000
commit7b959396ca6fae5635260131eedb9bc19f2726a3 (patch)
tree78541a1eec3ab8d774ce4111cd0412c3e34626e9 /sys/dev/mlx5/mlx5_core
parentb94ef2a3bcbb369d85b276a45504d42f2f2cd369 (diff)
mlx5: Introduce new destination type TABLE_TYPE
This new destination type supports flow transition between different table types, e.g. from NIC_RX to RDMA_RX or from RDMA_TX to NIC_TX. In addition add driver support to be able to query the capability for this new destination type. Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Sponsored by: NVidia networking MFC after: 1 week
Diffstat (limited to 'sys/dev/mlx5/mlx5_core')
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_main.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c
index df38a41a8be0..efaf726e19e5 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_main.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c
@@ -559,6 +559,43 @@ static int handle_hca_cap_atomic(struct mlx5_core_dev *dev)
return err;
}
+static int handle_hca_cap_2(struct mlx5_core_dev *dev)
+{
+ void *set_ctx;
+ void *set_hca_cap;
+ int set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in);
+ int err;
+
+ if (MLX5_CAP_GEN_MAX(dev, hca_cap_2)) {
+ err = mlx5_core_get_caps(dev, MLX5_CAP_GENERAL_2);
+ if (err)
+ return err;
+ } else {
+ return 0;
+ }
+
+ /* To be added if sw_vhca support was added */
+ /*if (!MLX5_CAP_GEN_2_MAX(dev, sw_vhca_id_valid) ||
+ !(dev->priv.sw_vhca_id > 0))
+ return 0;*/
+
+ set_ctx = kzalloc(set_sz, GFP_KERNEL);
+ if (!set_ctx)
+ return -ENOMEM;
+
+ MLX5_SET(set_hca_cap_in, set_ctx, op_mod,
+ MLX5_CAP_GENERAL_2 << 1);
+ set_hca_cap = MLX5_ADDR_OF(set_hca_cap_in, set_ctx, capability);
+ memcpy(set_hca_cap, dev->hca_caps_cur[MLX5_CAP_GENERAL_2],
+ MLX5_ST_SZ_BYTES(cmd_hca_cap_2));
+ //MLX5_SET(cmd_hca_cap_2, set_hca_cap, sw_vhca_id_valid, 1);
+
+ err = set_caps(dev, set_ctx, set_sz);
+
+ kfree(set_ctx);
+ return err;
+}
+
static int set_hca_ctrl(struct mlx5_core_dev *dev)
{
struct mlx5_reg_host_endianess he_in;
@@ -1139,6 +1176,12 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
goto reclaim_boot_pages;
}
+ err = handle_hca_cap_2(dev);
+ if (err) {
+ mlx5_core_err(dev, "handle_hca_cap_2 failed\n");
+ goto reclaim_boot_pages;
+ }
+
err = mlx5_satisfy_startup_pages(dev, 0);
if (err) {
mlx5_core_err(dev, "failed to allocate init pages\n");