diff options
author | Brenden Blanco <bblanco@plumgrid.com> | 2016-07-19 15:16:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-20 00:46:33 -0400 |
commit | 224e92e02a769b8028ca2450443586af8b4f1715 (patch) | |
tree | ce194a7d8fad10dfb1edf32036b2cbe585665559 /drivers/infiniband/hw/mlx4 | |
parent | 6ce96ca348a9e949f8c43f4d3e98db367d93cffd (diff) |
net/mlx4_en: break out tx_desc write into separate function
In preparation for writing the tx descriptor from multiple functions,
create a helper for both normal and blueflame access.
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 8db8405c1e99..768085f59566 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
@@ -232,7 +232,7 @@ static void stamp_send_wqe(struct mlx4_ib_qp *qp, int n, int size) | |||
232 | } | 232 | } |
233 | } else { | 233 | } else { |
234 | ctrl = buf = get_send_wqe(qp, n & (qp->sq.wqe_cnt - 1)); | 234 | ctrl = buf = get_send_wqe(qp, n & (qp->sq.wqe_cnt - 1)); |
235 | s = (ctrl->fence_size & 0x3f) << 4; | 235 | s = (ctrl->qpn_vlan.fence_size & 0x3f) << 4; |
236 | for (i = 64; i < s; i += 64) { | 236 | for (i = 64; i < s; i += 64) { |
237 | wqe = buf + i; | 237 | wqe = buf + i; |
238 | *wqe = cpu_to_be32(0xffffffff); | 238 | *wqe = cpu_to_be32(0xffffffff); |
@@ -264,7 +264,7 @@ static void post_nop_wqe(struct mlx4_ib_qp *qp, int n, int size) | |||
264 | inl->byte_count = cpu_to_be32(1 << 31 | (size - s - sizeof *inl)); | 264 | inl->byte_count = cpu_to_be32(1 << 31 | (size - s - sizeof *inl)); |
265 | } | 265 | } |
266 | ctrl->srcrb_flags = 0; | 266 | ctrl->srcrb_flags = 0; |
267 | ctrl->fence_size = size / 16; | 267 | ctrl->qpn_vlan.fence_size = size / 16; |
268 | /* | 268 | /* |
269 | * Make sure descriptor is fully written before setting ownership bit | 269 | * Make sure descriptor is fully written before setting ownership bit |
270 | * (because HW can start executing as soon as we do). | 270 | * (because HW can start executing as soon as we do). |
@@ -1992,7 +1992,8 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, | |||
1992 | ctrl = get_send_wqe(qp, i); | 1992 | ctrl = get_send_wqe(qp, i); |
1993 | ctrl->owner_opcode = cpu_to_be32(1 << 31); | 1993 | ctrl->owner_opcode = cpu_to_be32(1 << 31); |
1994 | if (qp->sq_max_wqes_per_wr == 1) | 1994 | if (qp->sq_max_wqes_per_wr == 1) |
1995 | ctrl->fence_size = 1 << (qp->sq.wqe_shift - 4); | 1995 | ctrl->qpn_vlan.fence_size = |
1996 | 1 << (qp->sq.wqe_shift - 4); | ||
1996 | 1997 | ||
1997 | stamp_send_wqe(qp, i, 1 << qp->sq.wqe_shift); | 1998 | stamp_send_wqe(qp, i, 1 << qp->sq.wqe_shift); |
1998 | } | 1999 | } |
@@ -3169,8 +3170,8 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
3169 | wmb(); | 3170 | wmb(); |
3170 | *lso_wqe = lso_hdr_sz; | 3171 | *lso_wqe = lso_hdr_sz; |
3171 | 3172 | ||
3172 | ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ? | 3173 | ctrl->qpn_vlan.fence_size = (wr->send_flags & IB_SEND_FENCE ? |
3173 | MLX4_WQE_CTRL_FENCE : 0) | size; | 3174 | MLX4_WQE_CTRL_FENCE : 0) | size; |
3174 | 3175 | ||
3175 | /* | 3176 | /* |
3176 | * Make sure descriptor is fully written before | 3177 | * Make sure descriptor is fully written before |