svn commit: r352963 - in head/sys/dev/mlx5: . mlx5_core
Hans Petter Selasky
hselasky at FreeBSD.org
Wed Oct 2 09:23:35 UTC 2019
Author: hselasky
Date: Wed Oct 2 09:23:33 2019
New Revision: 352963
URL: https://svnweb.freebsd.org/changeset/base/352963
Log:
Cleanup naming of IRQ vectors in mlx5en.
Remove unused IRQ naming functions and arrays.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Modified:
head/sys/dev/mlx5/driver.h
head/sys/dev/mlx5/mlx5_core/mlx5_core.h
head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
head/sys/dev/mlx5/mlx5_core/mlx5_main.c
Modified: head/sys/dev/mlx5/driver.h
==============================================================================
--- head/sys/dev/mlx5/driver.h Wed Oct 2 09:22:22 2019 (r352962)
+++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:23:33 2019 (r352963)
@@ -84,10 +84,6 @@ enum {
};
enum {
- MLX5_MAX_IRQ_NAME = 32
-};
-
-enum {
MLX5_ATOMIC_MODE_OFF = 16,
MLX5_ATOMIC_MODE_NONE = 0 << MLX5_ATOMIC_MODE_OFF,
MLX5_ATOMIC_MODE_IB_COMP = 1 << MLX5_ATOMIC_MODE_OFF,
@@ -556,10 +552,6 @@ struct mlx5_mr_table {
struct radix_tree_root tree;
};
-struct mlx5_irq_info {
- char name[MLX5_MAX_IRQ_NAME];
-};
-
#ifdef RATELIMIT
struct mlx5_rl_entry {
u32 rate;
@@ -581,7 +573,6 @@ struct mlx5_priv {
char name[MLX5_MAX_NAME_LEN];
struct mlx5_eq_table eq_table;
struct msix_entry *msix_arr;
- struct mlx5_irq_info *irq_info;
struct mlx5_uuar_info uuari;
MLX5_DECLARE_DOORBELL_LOCK(cq_uar_lock);
int disable_irqs;
@@ -1029,7 +1020,7 @@ struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_co
void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vector, enum mlx5_cmd_mode mode);
void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type);
int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx,
- int nent, u64 mask, const char *name, struct mlx5_uar *uar);
+ int nent, u64 mask, struct mlx5_uar *uar);
int mlx5_destroy_unmap_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
int mlx5_start_eqs(struct mlx5_core_dev *dev);
int mlx5_stop_eqs(struct mlx5_core_dev *dev);
Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 09:22:22 2019 (r352962)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 09:23:33 2019 (r352963)
@@ -102,8 +102,6 @@ int mlx5_firmware_flash(struct mlx5_core_dev *dev, con
void mlx5e_init(void);
void mlx5e_cleanup(void);
-int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_ix, char *name);
-
int mlx5_ctl_init(void);
void mlx5_ctl_fini(void);
void mlx5_fwdump_prep(struct mlx5_core_dev *mdev);
Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:22:22 2019 (r352962)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:23:33 2019 (r352963)
@@ -415,7 +415,7 @@ static void init_eq_buf(struct mlx5_eq *eq)
}
int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx,
- int nent, u64 mask, const char *name, struct mlx5_uar *uar)
+ int nent, u64 mask, struct mlx5_uar *uar)
{
u32 out[MLX5_ST_SZ_DW(create_eq_out)] = {0};
struct mlx5_priv *priv = &dev->priv;
@@ -463,10 +463,8 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, stru
eq->irqn = vecidx;
eq->dev = dev;
eq->doorbell = uar->map + MLX5_EQ_DOORBEL_OFFSET;
- snprintf(priv->irq_info[vecidx].name, MLX5_MAX_IRQ_NAME, "%s at pci:%s",
- name, pci_name(dev->pdev));
err = request_irq(priv->msix_arr[vecidx].vector, mlx5_msix_handler, 0,
- priv->irq_info[vecidx].name, eq);
+ "mlx5_core", eq);
if (err)
goto err_eq;
#ifdef RSS
@@ -568,7 +566,7 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev)
err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD,
MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD,
- "mlx5_cmd_eq", &dev->priv.uuari.uars[0]);
+ &dev->priv.uuari.uars[0]);
if (err) {
mlx5_core_warn(dev, "failed to create cmd EQ %d\n", err);
return err;
@@ -578,7 +576,7 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev)
err = mlx5_create_map_eq(dev, &table->async_eq, MLX5_EQ_VEC_ASYNC,
MLX5_NUM_ASYNC_EQE, async_event_mask,
- "mlx5_async_eq", &dev->priv.uuari.uars[0]);
+ &dev->priv.uuari.uars[0]);
if (err) {
mlx5_core_warn(dev, "failed to create async EQ %d\n", err);
goto err1;
@@ -587,7 +585,7 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev)
err = mlx5_create_map_eq(dev, &table->pages_eq,
MLX5_EQ_VEC_PAGES,
/* TODO: sriov max_vf + */ 1,
- 1 << MLX5_EVENT_TYPE_PAGE_REQUEST, "mlx5_pages_eq",
+ 1 << MLX5_EVENT_TYPE_PAGE_REQUEST,
&dev->priv.uuari.uars[0]);
if (err) {
mlx5_core_warn(dev, "failed to create pages EQ %d\n", err);
Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:22:22 2019 (r352962)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:23:33 2019 (r352963)
@@ -285,8 +285,6 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev)
priv->msix_arr = kzalloc(nvec * sizeof(*priv->msix_arr), GFP_KERNEL);
- priv->irq_info = kzalloc(nvec * sizeof(*priv->irq_info), GFP_KERNEL);
-
for (i = 0; i < nvec; i++)
priv->msix_arr[i].entry = i;
@@ -296,9 +294,7 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev)
return nvec;
table->num_comp_vectors = nvec - MLX5_EQ_VEC_COMP_BASE;
-
return 0;
-
}
static void mlx5_disable_msix(struct mlx5_core_dev *dev)
@@ -306,7 +302,6 @@ static void mlx5_disable_msix(struct mlx5_core_dev *de
struct mlx5_priv *priv = &dev->priv;
pci_disable_msix(dev->pdev);
- kfree(priv->irq_info);
kfree(priv->msix_arr);
}
@@ -604,30 +599,6 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vec
}
EXPORT_SYMBOL(mlx5_vector2eqn);
-int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_ix, char *name)
-{
- struct mlx5_priv *priv = &dev->priv;
- struct mlx5_eq_table *table = &priv->eq_table;
- struct mlx5_eq *eq;
- int err = -ENOENT;
-
- spin_lock(&table->lock);
- list_for_each_entry(eq, &table->comp_eqs_list, list) {
- if (eq->index == eq_ix) {
- int irq_ix = eq_ix + MLX5_EQ_VEC_COMP_BASE;
-
- snprintf(priv->irq_info[irq_ix].name, MLX5_MAX_IRQ_NAME,
- "%s-%d", name, eq_ix);
-
- err = 0;
- break;
- }
- }
- spin_unlock(&table->lock);
-
- return err;
-}
-
static void free_comp_eqs(struct mlx5_core_dev *dev)
{
struct mlx5_eq_table *table = &dev->priv.eq_table;
@@ -649,7 +620,6 @@ static void free_comp_eqs(struct mlx5_core_dev *dev)
static int alloc_comp_eqs(struct mlx5_core_dev *dev)
{
struct mlx5_eq_table *table = &dev->priv.eq_table;
- char name[MLX5_MAX_IRQ_NAME];
struct mlx5_eq *eq;
int ncomp_vec;
int nent;
@@ -662,10 +632,9 @@ static int alloc_comp_eqs(struct mlx5_core_dev *dev)
for (i = 0; i < ncomp_vec; i++) {
eq = kzalloc(sizeof(*eq), GFP_KERNEL);
- snprintf(name, MLX5_MAX_IRQ_NAME, "mlx5_comp%d", i);
err = mlx5_create_map_eq(dev, eq,
i + MLX5_EQ_VEC_COMP_BASE, nent, 0,
- name, &dev->priv.uuari.uars[0]);
+ &dev->priv.uuari.uars[0]);
if (err) {
kfree(eq);
goto clean;
More information about the svn-src-all
mailing list