Skip to content

Commit ce0f750

Browse files
Saeed Mahameeddavem330
authored andcommitted
net/mlx5_core: Modify arm CQ in preparation for upcoming Ethernet driver
Pass consumer index as a parameter to arm CQ Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 233d05d commit ce0f750

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

  • drivers/infiniband/hw/mlx5
  • include/linux/mlx5

‎drivers/infiniband/hw/mlx5/cq.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,15 @@ int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
572572

573573
int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
574574
{
575+
struct mlx5_core_dev *mdev = to_mdev(ibcq->device)->mdev;
576+
void __iomem *uar_page = mdev->priv.uuari.uars[0].map;
577+
575578
mlx5_cq_arm(&to_mcq(ibcq)->mcq,
576579
(flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED ?
577580
MLX5_CQ_DB_REQ_NOT_SOL : MLX5_CQ_DB_REQ_NOT,
578-
to_mdev(ibcq->device)->mdev->priv.uuari.uars[0].map,
579-
MLX5_GET_DOORBELL_LOCK(&to_mdev(ibcq->device)->mdev->priv.cq_uar_lock));
581+
uar_page,
582+
MLX5_GET_DOORBELL_LOCK(&mdev->priv.cq_uar_lock),
583+
to_mcq(ibcq)->mcq.cons_index);
580584

581585
return 0;
582586
}

‎include/linux/mlx5/cq.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@ enum {
137137

138138
static inline void mlx5_cq_arm(struct mlx5_core_cq *cq, u32 cmd,
139139
void __iomem *uar_page,
140-
spinlock_t *doorbell_lock)
140+
spinlock_t *doorbell_lock,
141+
u32 cons_index)
141142
{
142143
__be32 doorbell[2];
143144
u32 sn;
144145
u32 ci;
145146

146147
sn = cq->arm_sn & 3;
147-
ci = cq->cons_index & 0xffffff;
148+
ci = cons_index & 0xffffff;
148149

149150
*cq->arm_db = cpu_to_be32(sn << 28 | cmd | ci);
150151

0 commit comments

Comments
 (0)