diff options
author | Roland Dreier <rolandd@cisco.com> | 2007-04-20 22:14:14 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-04-20 22:20:16 -0700 |
commit | f89e3921653950229b1da397881fe69a1d6af42b (patch) | |
tree | 30128b11dc9e46722ebc5e4fe1a2980fe0af952c | |
parent | ad85b50e66c1a4e03e871d93a20a281559f59b7c (diff) | |
download | libmlx4-f89e3921653950229b1da397881fe69a1d6af42b.tar.gz |
Handle IBV_SEND_INLINE for send work requests
If IBV_SEND_INLINE is set for a send work request, copy the data to be
sent into an inline segment in the WQE.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | src/qp.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -212,7 +212,31 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, } if (wr->send_flags & IBV_SEND_INLINE) { - /*XXX handle inline send */ + if (wr->num_sge) { + struct mlx4_wqe_inline_seg *seg = wqe; + int s = 0; + + wqe += sizeof *seg; + for (i = 0; i < wr->num_sge; ++i) { + uint32_t len = wr->sg_list[i].length; + + s += len; + + if (s > qp->max_inline_data) { + ret = -1; + *bad_wr = wr; + goto out; + } + + memcpy(wqe, + (void *) (intptr_t) wr->sg_list[i].addr, + len); + wqe += len; + } + + seg->byte_count = htonl(MLX4_INLINE_SEG | s); + size += (s + sizeof *seg + 15) / 16; + } } else { struct mlx4_wqe_data_seg *seg = wqe; |