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>
struct mlx5e_cq {
/* data path - accessed per cqe */
struct mlx5_cqwq wq;
- void *sqrq;
unsigned long flags;
/* data path - accessed per napi poll */
priv->params.tx_cq_moderation_pkts);
if (err)
goto err_close_tx_cqs;
-
- c->sq[tc].cq.sqrq = &c->sq[tc];
}
return 0;
priv->params.rx_cq_moderation_pkts);
if (err)
goto err_close_tx_cqs;
- c->rq.cq.sqrq = &c->rq;
napi_enable(&c->napi);
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 */
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;
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;