[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230822150425.3390-16-aaptel@nvidia.com>
Date: Tue, 22 Aug 2023 15:04:16 +0000
From: Aurelien Aptel <aaptel@...dia.com>
To: linux-nvme@...ts.infradead.org,
netdev@...r.kernel.org,
sagi@...mberg.me,
hch@....de,
kbusch@...nel.org,
axboe@...com,
chaitanyak@...dia.com,
davem@...emloft.net,
kuba@...nel.org
Cc: Or Gerlitz <ogerlitz@...dia.com>,
aaptel@...dia.com,
aurelien.aptel@...il.com,
smalin@...dia.com,
malin1024@...il.com,
yorayz@...dia.com,
borisp@...dia.com,
galshalom@...dia.com,
mgurtovoy@...dia.com
Subject: [PATCH v13 15/24] net/mlx5e: Refactor doorbell function to allow avoiding a completion
From: Or Gerlitz <ogerlitz@...dia.com>
Currently the doorbell function always asks for completion to be generated.
Refactor things such that all existing call sites are untouched and no
branching is added. This is done using inner function which can be invoked
directly in cases completion is not desired (as done in downstream patch).
No functional change here.
Signed-off-by: Or Gerlitz <ogerlitz@...dia.com>
Signed-off-by: Aurelien Aptel <aaptel@...dia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
index cdd7fbf218ae..3807536932e4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
@@ -256,10 +256,10 @@ static inline u16 mlx5e_icosq_get_next_pi(struct mlx5e_icosq *sq, u16 size)
}
static inline void
-mlx5e_notify_hw(struct mlx5_wq_cyc *wq, u16 pc, void __iomem *uar_map,
- struct mlx5_wqe_ctrl_seg *ctrl)
+__mlx5e_notify_hw(struct mlx5_wq_cyc *wq, u16 pc, void __iomem *uar_map,
+ struct mlx5_wqe_ctrl_seg *ctrl, u8 cq_update)
{
- ctrl->fm_ce_se |= MLX5_WQE_CTRL_CQ_UPDATE;
+ ctrl->fm_ce_se |= cq_update;
/* ensure wqe is visible to device before updating doorbell record */
dma_wmb();
@@ -273,6 +273,13 @@ mlx5e_notify_hw(struct mlx5_wq_cyc *wq, u16 pc, void __iomem *uar_map,
mlx5_write64((__be32 *)ctrl, uar_map);
}
+static inline void
+mlx5e_notify_hw(struct mlx5_wq_cyc *wq, u16 pc, void __iomem *uar_map,
+ struct mlx5_wqe_ctrl_seg *ctrl)
+{
+ __mlx5e_notify_hw(wq, pc, uar_map, ctrl, MLX5_WQE_CTRL_CQ_UPDATE);
+}
+
static inline void mlx5e_cq_arm(struct mlx5e_cq *cq)
{
struct mlx5_core_cq *mcq;
--
2.34.1
Powered by blists - more mailing lists