Skip to content

Commit a1ded2c

Browse files
Saeed Mahameedjgunthorpe
authored andcommitted
mlx5: Create an auxiliary device for fwctl_mlx5
If the device supports User Context then it can support fwctl. Create an auxiliary device to allow fwctl to bind to it. Create a sysfs like: $ ls /sys/devices/pci0000:00/0000:00:0a.0/mlx5_core.fwctl.0/driver -l lrwxrwxrwx 1 root root 0 Apr 25 19:46 /sys/devices/pci0000:00/0000:00:0a.0/mlx5_core.fwctl.0/driver -> ../../../../bus/auxiliary/drivers/mlx5_fwctl.mlx5_fwctl Link: https://patch.msgid.link/r/[email protected] Signed-off-by: Saeed Mahameed <[email protected]> Acked-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 52929c2 commit a1ded2c

File tree

1 file changed

+9
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,15 @@ enum {
228228
MLX5_INTERFACE_PROTOCOL_VNET,
229229

230230
MLX5_INTERFACE_PROTOCOL_DPLL,
231+
MLX5_INTERFACE_PROTOCOL_FWCTL,
231232
};
232233

234+
static bool is_fwctl_supported(struct mlx5_core_dev *dev)
235+
{
236+
/* fwctl is most useful on PFs, prevent fwctl on SFs for now */
237+
return MLX5_CAP_GEN(dev, uctx_cap) && !mlx5_core_is_sf(dev);
238+
}
239+
233240
static const struct mlx5_adev_device {
234241
const char *suffix;
235242
bool (*is_supported)(struct mlx5_core_dev *dev);
@@ -252,6 +259,8 @@ static const struct mlx5_adev_device {
252259
.is_supported = &is_mp_supported },
253260
[MLX5_INTERFACE_PROTOCOL_DPLL] = { .suffix = "dpll",
254261
.is_supported = &is_dpll_supported },
262+
[MLX5_INTERFACE_PROTOCOL_FWCTL] = { .suffix = "fwctl",
263+
.is_supported = &is_fwctl_supported },
255264
};
256265

257266
int mlx5_adev_idx_alloc(void)

0 commit comments

Comments
 (0)