[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230203132705.627232-17-aaptel@nvidia.com>
Date: Fri, 3 Feb 2023 15:26:56 +0200
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: Aurelien Aptel <aaptel@...dia.com>, aurelien.aptel@...il.com,
smalin@...dia.com, malin1024@...il.com, ogerlitz@...dia.com,
yorayz@...dia.com, borisp@...dia.com
Subject: [PATCH v11 16/25] 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 92a71d1a7605..37217e4cc118 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
@@ -243,10 +243,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();
@@ -260,6 +260,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.31.1
Powered by blists - more mailing lists