Skip to content

Commit

Permalink
net/mlx5: Remove unused msix related exported APIs
Browse files Browse the repository at this point in the history
MSIX irq allocation and free APIs are no longer
in use. Hence, remove the dead code.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://lore.kernel.org/r/20240512124306.740898-4-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Parav Pandit authored and Jakub Kicinski committed May 13, 2024
1 parent bcee093 commit db5944e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
52 changes: 0 additions & 52 deletions drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,58 +507,6 @@ struct mlx5_irq *mlx5_irq_request(struct mlx5_core_dev *dev, u16 vecidx,
return irq;
}

/**
* mlx5_msix_alloc - allocate msix interrupt
* @dev: mlx5 device from which to request
* @handler: interrupt handler
* @affdesc: affinity descriptor
* @name: interrupt name
*
* Returns: struct msi_map with result encoded.
* Note: the caller must make sure to release the irq by calling
* mlx5_msix_free() if shutdown was initiated.
*/
struct msi_map mlx5_msix_alloc(struct mlx5_core_dev *dev,
irqreturn_t (*handler)(int, void *),
const struct irq_affinity_desc *affdesc,
const char *name)
{
struct msi_map map;
int err;

if (!dev->pdev) {
map.virq = 0;
map.index = -EINVAL;
return map;
}

map = pci_msix_alloc_irq_at(dev->pdev, MSI_ANY_INDEX, affdesc);
if (!map.virq)
return map;

err = request_irq(map.virq, handler, 0, name, NULL);
if (err) {
mlx5_core_warn(dev, "err %d\n", err);
pci_msix_free_irq(dev->pdev, map);
map.virq = 0;
map.index = -ENOMEM;
}
return map;
}
EXPORT_SYMBOL(mlx5_msix_alloc);

/**
* mlx5_msix_free - free a previously allocated msix interrupt
* @dev: mlx5 device associated with interrupt
* @map: map previously returned by mlx5_msix_alloc()
*/
void mlx5_msix_free(struct mlx5_core_dev *dev, struct msi_map map)
{
free_irq(map.virq, NULL);
pci_msix_free_irq(dev->pdev, map);
}
EXPORT_SYMBOL(mlx5_msix_free);

/**
* mlx5_irq_release_vector - release one IRQ back to the system.
* @irq: the irq to release.
Expand Down
7 changes: 0 additions & 7 deletions include/linux/mlx5/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -1374,11 +1374,4 @@ static inline bool mlx5_is_macsec_roce_supported(struct mlx5_core_dev *mdev)
enum {
MLX5_OCTWORD = 16,
};

struct msi_map mlx5_msix_alloc(struct mlx5_core_dev *dev,
irqreturn_t (*handler)(int, void *),
const struct irq_affinity_desc *affdesc,
const char *name);
void mlx5_msix_free(struct mlx5_core_dev *dev, struct msi_map map);

#endif /* MLX5_DRIVER_H */

0 comments on commit db5944e

Please sign in to comment.