All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Amir Vadai <amirv@mellanox.com>,
	Tal Alon <talal@mellanox.com>,
	Achiad Shochat <achiad@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Or Gerlitz <ogerlitz@mellanox.com>
Subject: [PATCH net-next 10/12] net/mlx5e: Remove mlx5e_cq.sqrq back-pointer
Date: Wed, 17 Jun 2015 18:26:27 +0300	[thread overview]
Message-ID: <1434554789-13758-11-git-send-email-ogerlitz@mellanox.com> (raw)
In-Reply-To: <1434554789-13758-1-git-send-email-ogerlitz@mellanox.com>

From: Achiad Shochat <achiad@mellanox.com>

Use container_of() instead.

Signed-off-by: Achiad Shochat <achiad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h      | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ---
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c   | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c   | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 2 +-
 5 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 1706979..3d23bd6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -208,7 +208,6 @@ enum cq_flags {
 struct mlx5e_cq {
 	/* data path - accessed per cqe */
 	struct mlx5_cqwq           wq;
-	void                      *sqrq;
 	unsigned long              flags;
 
 	/* data path - accessed per napi poll */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 45dc8c2..40206da 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -853,8 +853,6 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c,
 				    priv->params.tx_cq_moderation_pkts);
 		if (err)
 			goto err_close_tx_cqs;
-
-		c->sq[tc].cq.sqrq = &c->sq[tc];
 	}
 
 	return 0;
@@ -946,7 +944,6 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
 			    priv->params.rx_cq_moderation_pkts);
 	if (err)
 		goto err_close_tx_cqs;
-	c->rq.cq.sqrq = &c->rq;
 
 	napi_enable(&c->napi);
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 06e7c74..4a25957 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -191,7 +191,7 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe,
 
 bool mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget)
 {
-	struct mlx5e_rq *rq = cq->sqrq;
+	struct mlx5e_rq *rq = container_of(cq, struct mlx5e_rq, cq);
 	int i;
 
 	/* avoid accessing cq (dma coherent memory) if not needed */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 67493ab..c789619 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -266,7 +266,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq)
 	if (!test_and_clear_bit(MLX5E_CQ_HAS_CQES, &cq->flags))
 		return false;
 
-	sq = cq->sqrq;
+	sq = container_of(cq, struct mlx5e_sq, cq);
 
 	npkts = 0;
 	nbytes = 0;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
index 9f31572..8f7cbac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
@@ -62,7 +62,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
 
 	busy |= mlx5e_poll_rx_cq(&c->rq.cq, budget);
 
-	busy |= mlx5e_post_rx_wqes(c->rq.cq.sqrq);
+	busy |= mlx5e_post_rx_wqes(&c->rq);
 
 	for (i = 0; i < c->num_tc; i++)
 		busy |= mlx5e_poll_tx_cq(&c->sq[i].cq);
-- 
2.3.7

  parent reply	other threads:[~2015-06-17 15:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 15:26 [PATCH net-next 00/12] Mellanox NIC drivers update, Jun 17 2015 Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 01/12] net/mlx4_en: Fix off-by-four in ethtool Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 02/12] net/mlx4_en: Use HW counters for rx/tx bytes/packets in PF device Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 03/12] net/mlx5e: Static mapping of netdev priv resources to/from netdev TX queues Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 04/12] net/mlx5e: Use skb_shinfo(skb)->gso_segs rather than counting them Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 05/12] net/mlx5e: Poll rx cq before tx cq to improve round-trip latency Or Gerlitz
2015-06-21 17:21   ` David Miller
2015-06-21 21:35     ` achiad shochat
2015-06-22 13:35       ` David Miller
2015-06-23 14:12         ` Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 06/12] net/mlx5e: Remove re-assignment of wq type in mlx5e_enable_rq() Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 07/12] net/mlx5e: Avoid redundant dev_kfree_skb() upon NOP completion Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 08/12] net/mlx5e: Avoid TX CQE generation if more xmit packets expected Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 09/12] net/mlx5e: Remove extra spaces Or Gerlitz
2015-06-17 15:26 ` Or Gerlitz [this message]
2015-06-17 15:26 ` [PATCH net-next 11/12] net/mlx5e: Pop cq outside mlx5e_get_cqe Or Gerlitz
2015-06-17 15:26 ` [PATCH net-next 12/12] net/mlx5e: Prefetch skb data on RX Or Gerlitz

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=1434554789-13758-11-git-send-email-ogerlitz@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --cc=achiad@mellanox.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=talal@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 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.