Skip to content

Commit

Permalink
net/mlx5e: Remove mlx5e_cq.sqrq back-pointer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Achiad Shochat authored and David S. Miller committed Jun 24, 2015
1 parent 8ca56ce commit e339105
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e339105

Please sign in to comment.