Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
	Leon Romanovsky <leonro@mellanox.com>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Yuval Avnery <yuvalav@mellanox.com>,
	Parav Pandit <parav@mellanox.com>
Subject: [PATCH mlx5-next 14/16] net/mlx5: Rename mlx5_irq_info to mlx5_irq
Date: Mon, 10 Jun 2019 23:38:39 +0000	[thread overview]
Message-ID: <20190610233733.12155-15-saeedm@mellanox.com> (raw)
In-Reply-To: <20190610233733.12155-1-saeedm@mellanox.com>

From: Yuval Avnery <yuvalav@mellanox.com>

struct mlx5_irq_info is an active object and not just info.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../net/ethernet/mellanox/mlx5/core/pci_irq.c | 77 +++++++++----------
 1 file changed, 38 insertions(+), 39 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
index 75408639d150..fec861f4fefe 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
@@ -12,14 +12,14 @@
 
 #define MLX5_MAX_IRQ_NAME (32)
 
-struct mlx5_irq_info {
+struct mlx5_irq {
 	struct atomic_notifier_head nh;
 	cpumask_var_t mask;
 	char name[MLX5_MAX_IRQ_NAME];
 };
 
 struct mlx5_irq_table {
-	struct mlx5_irq_info *irq_info;
+	struct mlx5_irq *irq;
 	int nvec;
 #ifdef CONFIG_RFS_ACCEL
 	struct cpu_rmap *rmap;
@@ -48,29 +48,29 @@ int mlx5_irq_get_num_comp(struct mlx5_irq_table *table)
 	return table->nvec - MLX5_EQ_VEC_COMP_BASE;
 }
 
-static struct mlx5_irq_info *mlx5_irq_get(struct mlx5_core_dev *dev, int vecidx)
+static struct mlx5_irq *mlx5_irq_get(struct mlx5_core_dev *dev, int vecidx)
 {
 	struct mlx5_irq_table *irq_table = dev->priv.irq_table;
 
-	return &irq_table->irq_info[vecidx];
+	return &irq_table->irq[vecidx];
 }
 
 int mlx5_irq_attach_nb(struct mlx5_irq_table *irq_table, int vecidx,
 		       struct notifier_block *nb)
 {
-	struct mlx5_irq_info *irq_info;
+	struct mlx5_irq *irq;
 
-	irq_info = &irq_table->irq_info[vecidx];
-	return atomic_notifier_chain_register(&irq_info->nh, nb);
+	irq = &irq_table->irq[vecidx];
+	return atomic_notifier_chain_register(&irq->nh, nb);
 }
 
 int mlx5_irq_detach_nb(struct mlx5_irq_table *irq_table, int vecidx,
 		       struct notifier_block *nb)
 {
-	struct mlx5_irq_info *irq_info;
+	struct mlx5_irq *irq;
 
-	irq_info = &irq_table->irq_info[vecidx];
-	return atomic_notifier_chain_unregister(&irq_info->nh, nb);
+	irq = &irq_table->irq[vecidx];
+	return atomic_notifier_chain_unregister(&irq->nh, nb);
 }
 
 static irqreturn_t mlx5_irq_int_handler(int irq, void *nh)
@@ -108,15 +108,15 @@ static int request_irqs(struct mlx5_core_dev *dev, int nvec)
 	int i;
 
 	for (i = 0; i < nvec; i++) {
-		struct mlx5_irq_info *irq_info = mlx5_irq_get(dev, i);
+		struct mlx5_irq *irq = mlx5_irq_get(dev, i);
 		int irqn = pci_irq_vector(dev->pdev, i);
 
 		irq_set_name(name, i);
-		ATOMIC_INIT_NOTIFIER_HEAD(&irq_info->nh);
-		snprintf(irq_info->name, MLX5_MAX_IRQ_NAME,
+		ATOMIC_INIT_NOTIFIER_HEAD(&irq->nh);
+		snprintf(irq->name, MLX5_MAX_IRQ_NAME,
 			 "%s@pci:%s", name, pci_name(dev->pdev));
-		err = request_irq(irqn, mlx5_irq_int_handler, 0, irq_info->name,
-				  &irq_info->nh);
+		err = request_irq(irqn, mlx5_irq_int_handler, 0, irq->name,
+				  &irq->nh);
 		if (err) {
 			mlx5_core_err(dev, "Failed to request irq\n");
 			goto err_request_irq;
@@ -126,10 +126,10 @@ static int request_irqs(struct mlx5_core_dev *dev, int nvec)
 
 err_request_irq:
 	for (; i >= 0; i--) {
-		struct mlx5_irq_info *irq_info = mlx5_irq_get(dev, i);
+		struct mlx5_irq *irq = mlx5_irq_get(dev, i);
 		int irqn = pci_irq_vector(dev->pdev, i);
 
-		free_irq(irqn, &irq_info->nh);
+		free_irq(irqn, &irq->nh);
 	}
 	return  err;
 }
@@ -183,23 +183,22 @@ static int irq_set_rmap(struct mlx5_core_dev *mdev)
 static int set_comp_irq_affinity_hint(struct mlx5_core_dev *mdev, int i)
 {
 	int vecidx = MLX5_EQ_VEC_COMP_BASE + i;
-	struct mlx5_irq_info *irq_info;
-	int irq;
+	struct mlx5_irq *irq;
+	int irqn;
 
-	irq_info = mlx5_irq_get(mdev, vecidx);
-	irq = pci_irq_vector(mdev->pdev, vecidx);
-	if (!zalloc_cpumask_var(&irq_info->mask, GFP_KERNEL)) {
+	irq = mlx5_irq_get(mdev, vecidx);
+	irqn = pci_irq_vector(mdev->pdev, vecidx);
+	if (!zalloc_cpumask_var(&irq->mask, GFP_KERNEL)) {
 		mlx5_core_warn(mdev, "zalloc_cpumask_var failed");
 		return -ENOMEM;
 	}
 
 	cpumask_set_cpu(cpumask_local_spread(i, mdev->priv.numa_node),
-			irq_info->mask);
-
+			irq->mask);
 	if (IS_ENABLED(CONFIG_SMP) &&
-	    irq_set_affinity_hint(irq, irq_info->mask))
+	    irq_set_affinity_hint(irqn, irq->mask))
 		mlx5_core_warn(mdev, "irq_set_affinity_hint failed, irq 0x%.4x",
-			       irq);
+			       irqn);
 
 	return 0;
 }
@@ -207,13 +206,13 @@ static int set_comp_irq_affinity_hint(struct mlx5_core_dev *mdev, int i)
 static void clear_comp_irq_affinity_hint(struct mlx5_core_dev *mdev, int i)
 {
 	int vecidx = MLX5_EQ_VEC_COMP_BASE + i;
-	struct mlx5_irq_info *irq_info;
-	int irq;
+	struct mlx5_irq *irq;
+	int irqn;
 
-	irq_info = mlx5_irq_get(mdev, vecidx);
-	irq = pci_irq_vector(mdev->pdev, vecidx);
-	irq_set_affinity_hint(irq, NULL);
-	free_cpumask_var(irq_info->mask);
+	irq = mlx5_irq_get(mdev, vecidx);
+	irqn = pci_irq_vector(mdev->pdev, vecidx);
+	irq_set_affinity_hint(irqn, NULL);
+	free_cpumask_var(irq->mask);
 }
 
 static int set_comp_irq_affinity_hints(struct mlx5_core_dev *mdev)
@@ -249,7 +248,7 @@ static void clear_comp_irqs_affinity_hints(struct mlx5_core_dev *mdev)
 struct cpumask *
 mlx5_irq_get_affinity_mask(struct mlx5_irq_table *irq_table, int vecidx)
 {
-	return irq_table->irq_info[vecidx].mask;
+	return irq_table->irq[vecidx].mask;
 }
 
 #ifdef CONFIG_RFS_ACCEL
@@ -285,15 +284,15 @@ int mlx5_irq_table_create(struct mlx5_core_dev *dev)
 	if (nvec <= MLX5_EQ_VEC_COMP_BASE)
 		return -ENOMEM;
 
-	table->irq_info = kcalloc(nvec, sizeof(*table->irq_info), GFP_KERNEL);
-	if (!table->irq_info)
+	table->irq = kcalloc(nvec, sizeof(*table->irq), GFP_KERNEL);
+	if (!table->irq)
 		return -ENOMEM;
 
 	nvec = pci_alloc_irq_vectors(dev->pdev, MLX5_EQ_VEC_COMP_BASE + 1,
 				     nvec, PCI_IRQ_MSIX);
 	if (nvec < 0) {
 		err = nvec;
-		goto err_free_irq_info;
+		goto err_free_irq;
 	}
 
 	table->nvec = nvec;
@@ -320,8 +319,8 @@ int mlx5_irq_table_create(struct mlx5_core_dev *dev)
 	irq_clear_rmap(dev);
 err_set_rmap:
 	pci_free_irq_vectors(dev->pdev);
-err_free_irq_info:
-	kfree(table->irq_info);
+err_free_irq:
+	kfree(table->irq);
 	return err;
 }
 
@@ -340,6 +339,6 @@ void mlx5_irq_table_destroy(struct mlx5_core_dev *dev)
 		free_irq(pci_irq_vector(dev->pdev, i),
 			 &mlx5_irq_get(dev, i)->nh);
 	pci_free_irq_vectors(dev->pdev);
-	kfree(table->irq_info);
+	kfree(table->irq);
 }
 
-- 
2.21.0


  parent reply	other threads:[~2019-06-10 23:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 23:38 [PATCH mlx5-next 00/16] Mellanox, mlx5 next updates 10-06-2019 Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 01/16] net/mlx5: Increase wait time for fw initialization Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 02/16] net/mlx5: E-Switch, Handle representors creation in handler context Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 03/16] net/mlx5: E-Switch, Return raw output for query esw functions Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 04/16] net/mlx5: Support querying max VFs from device Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 05/16] net/mlx5: Introduce EQ polling budget Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 06/16] net/mlx5: Change interrupt handler to call chain notifier Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 07/16] net/mlx5: Separate IRQ request/free from EQ life cycle Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 08/16] net/mlx5: Separate IRQ data from EQ table data Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 09/16] net/mlx5: Move IRQ rmap creation to IRQ allocation phase Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 10/16] net/mlx5: Move IRQ affinity set " Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 11/16] net/mlx5: Separate IRQ table creation from EQ table creation Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 12/16] net/mlx5: Generalize IRQ interface to work with irq_table Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 13/16] net/mlx5: Move all IRQ logic to pci_irq.c Saeed Mahameed
2019-06-10 23:38 ` Saeed Mahameed [this message]
2019-06-10 23:38 ` [PATCH mlx5-next 15/16] net/mlx5: Use a single IRQ for all async EQs Saeed Mahameed
2019-06-10 23:38 ` [PATCH mlx5-next 16/16] net/mlx5: Add EQ enable/disable API Saeed Mahameed
2019-06-13 18:02 ` [PATCH mlx5-next 00/16] Mellanox, mlx5 next updates 10-06-2019 Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190610233733.12155-15-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=parav@mellanox.com \
    --cc=yuvalav@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox