All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: Leon Romanovsky <leonro@mellanox.com>, saeedm@mellanox.com
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	Jason Gunthorpe <jgg@mellanox.com>
Subject: [PATCH V2 mlx5-next 03/12] net/mlx5: EQ, No need to store eq index as a field
Date: Mon, 19 Nov 2018 10:52:33 -0800	[thread overview]
Message-ID: <20181119185242.21961-4-saeedm@mellanox.com> (raw)
In-Reply-To: <20181119185242.21961-1-saeedm@mellanox.com>

eq->index is used only for completion EQs and is assigned to be
the completion eq index, it is used only when traversing the completion
eqs list, and it can be calculated dynamically, thus remove the
eq->index field.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 4 ++--
 include/linux/mlx5/driver.h                    | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index d5cea0a36e6a..f5e6d375a8cc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -702,10 +702,11 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn,
 	struct mlx5_eq_table *table = &dev->priv.eq_table;
 	struct mlx5_eq *eq, *n;
 	int err = -ENOENT;
+	int i = 0;
 
 	spin_lock(&table->lock);
 	list_for_each_entry_safe(eq, n, &table->comp_eqs_list, list) {
-		if (eq->index == vector) {
+		if (i++ == vector) {
 			*eqn = eq->eqn;
 			*irqn = eq->irqn;
 			err = 0;
@@ -797,7 +798,6 @@ static int alloc_comp_eqs(struct mlx5_core_dev *dev)
 			goto clean;
 		}
 		mlx5_core_dbg(dev, "allocated completion EQN %d\n", eq->eqn);
-		eq->index = i;
 		spin_lock(&table->lock);
 		list_add_tail(&eq->list, &table->comp_eqs_list);
 		spin_unlock(&table->lock);
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 15cf6727a62d..4b62d71825c1 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -399,7 +399,6 @@ struct mlx5_eq {
 	u8			eqn;
 	int			nent;
 	struct list_head	list;
-	int			index;
 	struct mlx5_rsc_debug	*dbg;
 	enum mlx5_eq_type	type;
 	union {
-- 
2.19.1

  parent reply	other threads:[~2018-11-19 18:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 18:52 [PATCH V2 mlx5-next 00/12] mlx5 core generic EQ API for RDMA ODP Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 01/12] net/mlx5: EQ, Use the right place to store/read IRQ affinity hint Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 02/12] net/mlx5: EQ, Remove unused fields and structures Saeed Mahameed
2018-11-19 18:52 ` Saeed Mahameed [this message]
2018-11-19 18:52 ` [PATCH V2 mlx5-next 04/12] net/mlx5: EQ, Remove redundant completion EQ list lock Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 05/12] net/mlx5: EQ, Move all EQ logic to eq.c Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 06/12] net/mlx5: EQ, Create all EQs in one place Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 07/12] net/mlx5: EQ, irq_info and rmap belong to eq_table Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 08/12] net/mlx5: EQ, Privatize eq_table and friends Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 09/12] net/mlx5: EQ, Different EQ types Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 10/12] net/mlx5: EQ, Generic EQ Saeed Mahameed
2018-11-19 18:52 ` [PATCH V2 mlx5-next 11/12] {net,IB}/mlx5: Move Page fault EQ and ODP logic to RDMA Saeed Mahameed
2018-11-20 17:30   ` Jason Gunthorpe
2018-11-19 18:52 ` [PATCH V2 mlx5-next 12/12] net/mlx5: EQ, Make EQE access methods inline Saeed Mahameed
2018-11-20 18:11 ` [PATCH V2 mlx5-next 00/12] mlx5 core generic EQ API for RDMA ODP Leon Romanovsky
2018-11-21 21:32   ` Jason Gunthorpe

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=20181119185242.21961-4-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=jgg@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.