summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
diff options
context:
space:
mode:
authorAya Levin <ayal@mellanox.com>2020-04-30 13:36:26 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2020-07-02 21:05:17 -0700
commitfc42d0de16debb2c8ba83e1345a55a18ff87e2d9 (patch)
treea4616ec6ea5b48ad355fa032218f0d56edddee50 /drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
parent5d95c816608cd6e7ccfe3d4c8083465973b9f3d1 (diff)
net/mlx5e: Add helper to get RQ WQE's head
Add helper which retrieves the RQ WQE's head. Use this helper in RX reporter diagnose callback. Signed-off-by: Aya Levin <ayal@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
index ed9e0b8a6f9e..d787e8fc2e99 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
@@ -304,6 +304,16 @@ static inline u32 mlx5e_rqwq_get_cur_sz(struct mlx5e_rq *rq)
}
}
+static inline u16 mlx5e_rqwq_get_head(struct mlx5e_rq *rq)
+{
+ switch (rq->wq_type) {
+ case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ:
+ return mlx5_wq_ll_get_head(&rq->mpwqe.wq);
+ default:
+ return mlx5_wq_cyc_get_head(&rq->wqe.wq);
+ }
+}
+
/* SW parser related functions */
struct mlx5e_swp_spec {