net/mlx5e: Remove mlx5e_cq.sqrq back-pointer
authorAchiad Shochat <achiad@mellanox.com>
Tue, 23 Jun 2015 14:14:20 +0000 (17:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jun 2015 07:42:39 +0000 (00:42 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

index 17069791f680aca80aa34dd373c403fa69f0fe2c..3d23bd657e3c0cf7dc6d1d61c530a2d15053712a 100644 (file)
@@ -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 */
index 45dc8c293a3024ec89f7bbfae4094ee000ffb805..40206da1f9d7b9e24ebd972e2b798f05dc4be46b 100644 (file)
@@ -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);
 
index 06e7c744ed4a6071de2643a9c7ae3df0eaa3391b..4a259575359702dd1a56b6b65be2a4e96646966b 100644 (file)
@@ -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 */
index 67493ab94ff6dfbe9c6fb17310b5b585f127e7b8..c789619b9c8ee0baa0e28783560d66caad147606 100644 (file)
@@ -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;
index 088bc424157c7a76f777c212a0cb2d6da7549a3d..bf6b27b2fec2313a80fc5e33a9f37df7c344fa6c 100644 (file)
@@ -65,7 +65,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);
 
        if (busy)
                return budget;