mlx5-fixes-2023-05-31

-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEGhZs6bAKwk/OTgTpSD+KveBX+j4FAmR4C7UACgkQSD+KveBX
 +j43QQgAm2KnMLUmtSHBFgyFEh7udVTK2XKH8RFwcQ9rhGnpAaDMhZY40oNLuNZv
 i+yMl1dfopNr9SxfQQdyPAbS138rfCIxZi7F26PBAaaPJ6WS1Ds5qIpyS8Dt8FFW
 w2+AS5RXDCZwoa0OYZYqXYnsWtRCjAO7KEChbif26ruuN9alu3ll+b074xup8a8q
 +j3Guk5zFHsf9Qz+RZIXrUj//qoWpsmyKdcVlr/vsWra9Y31tpymtEp7mplUrZmu
 xAmYoRssFiYYGxl5oVIpTzyzGBLxbDrpQiBHZH+XjUmGVYeEUFsVMgCcvLs5VjeF
 wvcEFMTPcuAdkkXzNa2txEznYf53Bg==
 =vNQo
 -----END PGP SIGNATURE-----

Merge tag 'mlx5-fixes-2023-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5 fixes 2023-05-31

This series provides bug fixes to mlx5 driver.

* tag 'mlx5-fixes-2023-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
  net/mlx5: Read embedded cpu after init bit cleared
  net/mlx5e: Fix error handling in mlx5e_refresh_tirs
  net/mlx5: Ensure af_desc.mask is properly initialized
  net/mlx5: Fix setting of irq->map.index for static IRQ case
  net/mlx5: Remove rmap also in case dynamic MSIX not supported
====================

Link: https://lore.kernel.org/r/20230601031051.131529-1-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2023-06-01 10:15:43 -07:00
commit a451b8eb96
3 changed files with 12 additions and 14 deletions

View File

@ -150,10 +150,8 @@ int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb,
inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
in = kvzalloc(inlen, GFP_KERNEL);
if (!in) {
err = -ENOMEM;
goto out;
}
if (!in)
return -ENOMEM;
if (enable_uc_lb)
lb_flags = MLX5_TIRC_SELF_LB_BLOCK_BLOCK_UNICAST;
@ -171,14 +169,13 @@ int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb,
tirn = tir->tirn;
err = mlx5_core_modify_tir(mdev, tirn, in);
if (err)
goto out;
break;
}
mutex_unlock(&mdev->mlx5e_res.hw_objs.td.list_lock);
out:
kvfree(in);
if (err)
netdev_err(priv->netdev, "refresh tir(0x%x) failed, %d\n", tirn, err);
mutex_unlock(&mdev->mlx5e_res.hw_objs.td.list_lock);
return err;
}

View File

@ -923,7 +923,6 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev,
}
mlx5_pci_vsc_init(dev);
dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
return 0;
err_clr_master:
@ -1155,6 +1154,7 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, bool boot, u64 timeout
goto err_cmd_cleanup;
}
dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_UP);
mlx5_start_health_poll(dev);

View File

@ -141,7 +141,7 @@ static void irq_release(struct mlx5_irq *irq)
irq_update_affinity_hint(irq->map.virq, NULL);
#ifdef CONFIG_RFS_ACCEL
rmap = mlx5_eq_table_get_rmap(pool->dev);
if (rmap && irq->map.index)
if (rmap)
irq_cpu_rmap_remove(rmap, irq->map.virq);
#endif
@ -232,12 +232,13 @@ struct mlx5_irq *mlx5_irq_alloc(struct mlx5_irq_pool *pool, int i,
if (!irq)
return ERR_PTR(-ENOMEM);
if (!i || !pci_msix_can_alloc_dyn(dev->pdev)) {
/* The vector at index 0 was already allocated.
* Just get the irq number. If dynamic irq is not supported
* vectors have also been allocated.
/* The vector at index 0 is always statically allocated. If
* dynamic irq is not supported all vectors are statically
* allocated. In both cases just get the irq number and set
* the index.
*/
irq->map.virq = pci_irq_vector(dev->pdev, i);
irq->map.index = 0;
irq->map.index = i;
} else {
irq->map = pci_msix_alloc_irq_at(dev->pdev, MSI_ANY_INDEX, af_desc);
if (!irq->map.virq) {
@ -570,11 +571,11 @@ int mlx5_irqs_request_vectors(struct mlx5_core_dev *dev, u16 *cpus, int nirqs,
af_desc.is_managed = false;
for (i = 0; i < nirqs; i++) {
cpumask_clear(&af_desc.mask);
cpumask_set_cpu(cpus[i], &af_desc.mask);
irq = mlx5_irq_request(dev, i + 1, &af_desc, rmap);
if (IS_ERR(irq))
break;
cpumask_clear(&af_desc.mask);
irqs[i] = irq;
}