Skip to content

Commit c788d79

Browse files
Jianbo Liukuba-moo
authored andcommitted
net/mlx5: Skip pages EQ creation for non-page supplier function
Page events are not issued by device on the function if page_request_disable is set, so no need to create pages EQ. Signed-off-by: Jianbo Liu <jianbol@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://lore.kernel.org/r/20240402133043.56322-11-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 137f3d5 commit c788d79

File tree

2 files changed

+11
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core
  • include/linux/mlx5

2 files changed

+11
-2
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,12 @@ static int create_async_eqs(struct mlx5_core_dev *dev)
688688
if (err)
689689
goto err2;
690690

691+
/* Skip page eq creation when the device does not request for page requests */
692+
if (MLX5_CAP_GEN(dev, page_request_disable)) {
693+
mlx5_core_dbg(dev, "Skip page EQ creation\n");
694+
return 0;
695+
}
696+
691697
param = (struct mlx5_eq_param) {
692698
.irq = table->ctrl_irq,
693699
.nent = /* TODO: sriov max_vf + */ 1,
@@ -716,7 +722,8 @@ static void destroy_async_eqs(struct mlx5_core_dev *dev)
716722
{
717723
struct mlx5_eq_table *table = dev->priv.eq_table;
718724

719-
cleanup_async_eq(dev, &table->pages_eq, "pages");
725+
if (!MLX5_CAP_GEN(dev, page_request_disable))
726+
cleanup_async_eq(dev, &table->pages_eq, "pages");
720727
cleanup_async_eq(dev, &table->async_eq, "async");
721728
mlx5_cmd_allowed_opcode(dev, MLX5_CMD_OP_DESTROY_EQ);
722729
mlx5_cmd_use_polling(dev);

include/linux/mlx5/mlx5_ifc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,9 @@ enum {
14851485
};
14861486

14871487
struct mlx5_ifc_cmd_hca_cap_bits {
1488-
u8 reserved_at_0[0x10];
1488+
u8 reserved_at_0[0x6];
1489+
u8 page_request_disable[0x1];
1490+
u8 reserved_at_7[0x9];
14891491
u8 shared_object_to_user_object_allowed[0x1];
14901492
u8 reserved_at_13[0xe];
14911493
u8 vhca_resource_manager[0x1];

0 commit comments

Comments
 (0)