aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
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/core
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/core')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 9e98cec6230f..2c3bff5fe867 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1463,7 +1463,6 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
1463 next->num_sge = user_wr->num_sge; 1463 next->num_sge = user_wr->num_sge;
1464 next->opcode = user_wr->opcode; 1464 next->opcode = user_wr->opcode;
1465 next->send_flags = user_wr->send_flags; 1465 next->send_flags = user_wr->send_flags;
1466 next->imm_data = (__be32 __force) user_wr->imm_data;
1467 1466
1468 if (is_ud) { 1467 if (is_ud) {
1469 next->wr.ud.ah = idr_read_ah(user_wr->wr.ud.ah, 1468 next->wr.ud.ah = idr_read_ah(user_wr->wr.ud.ah,
@@ -1476,14 +1475,24 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
1476 next->wr.ud.remote_qkey = user_wr->wr.ud.remote_qkey; 1475 next->wr.ud.remote_qkey = user_wr->wr.ud.remote_qkey;
1477 } else { 1476 } else {
1478 switch (next->opcode) { 1477 switch (next->opcode) {
1479 case IB_WR_RDMA_WRITE:
1480 case IB_WR_RDMA_WRITE_WITH_IMM: 1478 case IB_WR_RDMA_WRITE_WITH_IMM:
1479 next->ex.imm_data =
1480 (__be32 __force) user_wr->ex.imm_data;
1481 case IB_WR_RDMA_WRITE:
1481 case IB_WR_RDMA_READ: 1482 case IB_WR_RDMA_READ:
1482 next->wr.rdma.remote_addr = 1483 next->wr.rdma.remote_addr =
1483 user_wr->wr.rdma.remote_addr; 1484 user_wr->wr.rdma.remote_addr;
1484 next->wr.rdma.rkey = 1485 next->wr.rdma.rkey =
1485 user_wr->wr.rdma.rkey; 1486 user_wr->wr.rdma.rkey;
1486 break; 1487 break;
1488 case IB_WR_SEND_WITH_IMM:
1489 next->ex.imm_data =
1490 (__be32 __force) user_wr->ex.imm_data;
1491 break;
1492 case IB_WR_SEND_WITH_INV:
1493 next->ex.invalidate_rkey =
1494 user_wr->ex.invalidate_rkey;
1495 break;
1487 case IB_WR_ATOMIC_CMP_AND_SWP: 1496 case IB_WR_ATOMIC_CMP_AND_SWP:
1488 case IB_WR_ATOMIC_FETCH_AND_ADD: 1497 case IB_WR_ATOMIC_FETCH_AND_ADD:
1489 next->wr.atomic.remote_addr = 1498 next->wr.atomic.remote_addr =