aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2008-04-17 00:09:32 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-17 00:09:32 -0400
commit0f39cf3d54e67a705773fd0ec56ca3dcd3e9272f (patch)
tree83f19f0014d0e880fb245906105e903dd6d733d5 /drivers/infiniband/hw/mthca
parente7eacd36865ae0707f5efae8e4dda421ffcd1b66 (diff)
IB/core: Add support for "send with invalidate" work requests
Add a new IB_WR_SEND_WITH_INV send opcode that can be used to mark a "send with invalidate" work request as defined in the iWARP verbs and the InfiniBand base memory management extensions. Also put "imm_data" and a new "invalidate_rkey" member in a new "ex" union in struct ib_send_wr. The invalidate_rkey member can be used to pass in an R_Key/STag to be invalidated. Add this new union to struct ib_uverbs_send_wr. Add code to copy the invalidate_rkey field in ib_uverbs_post_send(). Fix up low-level drivers to deal with the change to struct ib_send_wr, and just remove the imm_data initialization from net/sunrpc/xprtrdma/, since that code never does any send with immediate operations. Also, move the existing IB_DEVICE_SEND_W_INV flag to a new bit, since the iWARP drivers currently in the tree set the bit. The amso1100 driver at least will silently fail to honor the IB_SEND_INVALIDATE bit if passed in as part of userspace send requests (since it does not implement kernel bypass work request queueing). Remove the flag from all existing drivers that set it until we know which ones are OK. The values chosen for the new flag is not consecutive to avoid clashing with flags defined in the XRC patches, which are not merged yet but which are already in use and are likely to be merged soon. This resurrects a patch sent long ago by Mikkel Hagen <mhagen@iol.unh.edu>. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 8433897624bc..b3fd6b05d79d 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -1532,7 +1532,7 @@ static int build_mlx_header(struct mthca_dev *dev, struct mthca_sqp *sqp,
1532 case IB_WR_SEND_WITH_IMM: 1532 case IB_WR_SEND_WITH_IMM:
1533 sqp->ud_header.bth.opcode = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE; 1533 sqp->ud_header.bth.opcode = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE;
1534 sqp->ud_header.immediate_present = 1; 1534 sqp->ud_header.immediate_present = 1;
1535 sqp->ud_header.immediate_data = wr->imm_data; 1535 sqp->ud_header.immediate_data = wr->ex.imm_data;
1536 break; 1536 break;
1537 default: 1537 default:
1538 return -EINVAL; 1538 return -EINVAL;
@@ -1679,7 +1679,7 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1679 cpu_to_be32(1); 1679 cpu_to_be32(1);
1680 if (wr->opcode == IB_WR_SEND_WITH_IMM || 1680 if (wr->opcode == IB_WR_SEND_WITH_IMM ||
1681 wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM) 1681 wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM)
1682 ((struct mthca_next_seg *) wqe)->imm = wr->imm_data; 1682 ((struct mthca_next_seg *) wqe)->imm = wr->ex.imm_data;
1683 1683
1684 wqe += sizeof (struct mthca_next_seg); 1684 wqe += sizeof (struct mthca_next_seg);
1685 size = sizeof (struct mthca_next_seg) / 16; 1685 size = sizeof (struct mthca_next_seg) / 16;
@@ -2020,7 +2020,7 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
2020 cpu_to_be32(1); 2020 cpu_to_be32(1);
2021 if (wr->opcode == IB_WR_SEND_WITH_IMM || 2021 if (wr->opcode == IB_WR_SEND_WITH_IMM ||
2022 wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM) 2022 wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM)
2023 ((struct mthca_next_seg *) wqe)->imm = wr->imm_data; 2023 ((struct mthca_next_seg *) wqe)->imm = wr->ex.imm_data;
2024 2024
2025 wqe += sizeof (struct mthca_next_seg); 2025 wqe += sizeof (struct mthca_next_seg);
2026 size = sizeof (struct mthca_next_seg) / 16; 2026 size = sizeof (struct mthca_next_seg) / 16;