Skip to content

Commit fe998a3

Browse files
shayshyiSaeed Mahameed
authored andcommitted
net/mlx5: Enable management PF initialization
Enable initialization of DPU Management PF, which is a new loopback PF designed for communication with BMC. For now Management PF doesn't support nor require most upper layer protocols so avoid them. Signed-off-by: Shay Drory <[email protected]> Reviewed-by: Eran Ben Elisha <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 0e41451 commit fe998a3

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/dev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ bool mlx5_eth_supported(struct mlx5_core_dev *dev)
5959
if (!IS_ENABLED(CONFIG_MLX5_CORE_EN))
6060
return false;
6161

62+
if (mlx5_core_is_management_pf(dev))
63+
return false;
64+
6265
if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
6366
return false;
6467

@@ -198,6 +201,9 @@ bool mlx5_rdma_supported(struct mlx5_core_dev *dev)
198201
if (!IS_ENABLED(CONFIG_MLX5_INFINIBAND))
199202
return false;
200203

204+
if (mlx5_core_is_management_pf(dev))
205+
return false;
206+
201207
if (dev->priv.flags & MLX5_PRIV_FLAGS_DISABLE_IB_ADEV)
202208
return false;
203209

drivers/net/ethernet/mellanox/mlx5/core/ecpf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ int mlx5_ec_init(struct mlx5_core_dev *dev)
7575
if (!mlx5_core_is_ecpf(dev))
7676
return 0;
7777

78+
/* Management PF don't have a peer PF */
79+
if (mlx5_core_is_management_pf(dev))
80+
return 0;
81+
7882
return mlx5_host_pf_init(dev);
7983
}
8084

@@ -85,6 +89,10 @@ void mlx5_ec_cleanup(struct mlx5_core_dev *dev)
8589
if (!mlx5_core_is_ecpf(dev))
8690
return;
8791

92+
/* Management PF don't have a peer PF */
93+
if (mlx5_core_is_management_pf(dev))
94+
return;
95+
8896
mlx5_host_pf_cleanup(dev);
8997

9098
err = mlx5_wait_for_pages(dev, &dev->priv.host_pf_pages);

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ int mlx5_esw_sf_max_hpf_functions(struct mlx5_core_dev *dev, u16 *max_sfs, u16 *
14881488
void *hca_caps;
14891489
int err;
14901490

1491-
if (!mlx5_core_is_ecpf(dev)) {
1491+
if (!mlx5_core_is_ecpf(dev) || mlx5_core_is_management_pf(dev)) {
14921492
*max_sfs = 0;
14931493
return 0;
14941494
}

include/linux/mlx5/driver.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,11 @@ static inline bool mlx5_core_is_vf(const struct mlx5_core_dev *dev)
12021202
return dev->coredev_type == MLX5_COREDEV_VF;
12031203
}
12041204

1205+
static inline bool mlx5_core_is_management_pf(const struct mlx5_core_dev *dev)
1206+
{
1207+
return MLX5_CAP_GEN(dev, num_ports) == 1 && !MLX5_CAP_GEN(dev, native_port_num);
1208+
}
1209+
12051210
static inline bool mlx5_core_is_ecpf(const struct mlx5_core_dev *dev)
12061211
{
12071212
return dev->caps.embedded_cpu;

0 commit comments

Comments
 (0)