提交 367cc371 编写于 作者: K Konstantin Taranov 提交者: Greg Kroah-Hartman

RDMA/rxe: Fill in wc byte_len with IB_WC_RECV_RDMA_WITH_IMM

[ Upstream commit bdce1290493caa3f8119f24b5dacc3fb7ca27389 ]

Calculate the correct byte_len on the receiving side when a work
completion is generated with IB_WC_RECV_RDMA_WITH_IMM opcode.

According to the IBA byte_len must indicate the number of written bytes,
whereas it was always equal to zero for the IB_WC_RECV_RDMA_WITH_IMM
opcode, even though data was transferred.

Fixes: 8700e3e7 ("Soft RoCE driver")
Signed-off-by: NKonstantin Taranov <konstantin.taranov@inf.ethz.ch>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 4fe7ea29
...@@ -435,6 +435,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp, ...@@ -435,6 +435,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
qp->resp.va = reth_va(pkt); qp->resp.va = reth_va(pkt);
qp->resp.rkey = reth_rkey(pkt); qp->resp.rkey = reth_rkey(pkt);
qp->resp.resid = reth_len(pkt); qp->resp.resid = reth_len(pkt);
qp->resp.length = reth_len(pkt);
} }
access = (pkt->mask & RXE_READ_MASK) ? IB_ACCESS_REMOTE_READ access = (pkt->mask & RXE_READ_MASK) ? IB_ACCESS_REMOTE_READ
: IB_ACCESS_REMOTE_WRITE; : IB_ACCESS_REMOTE_WRITE;
...@@ -859,7 +860,9 @@ static enum resp_states do_complete(struct rxe_qp *qp, ...@@ -859,7 +860,9 @@ static enum resp_states do_complete(struct rxe_qp *qp,
pkt->mask & RXE_WRITE_MASK) ? pkt->mask & RXE_WRITE_MASK) ?
IB_WC_RECV_RDMA_WITH_IMM : IB_WC_RECV; IB_WC_RECV_RDMA_WITH_IMM : IB_WC_RECV;
wc->vendor_err = 0; wc->vendor_err = 0;
wc->byte_len = wqe->dma.length - wqe->dma.resid; wc->byte_len = (pkt->mask & RXE_IMMDT_MASK &&
pkt->mask & RXE_WRITE_MASK) ?
qp->resp.length : wqe->dma.length - wqe->dma.resid;
/* fields after byte_len are different between kernel and user /* fields after byte_len are different between kernel and user
* space * space
......
...@@ -212,6 +212,7 @@ struct rxe_resp_info { ...@@ -212,6 +212,7 @@ struct rxe_resp_info {
struct rxe_mem *mr; struct rxe_mem *mr;
u32 resid; u32 resid;
u32 rkey; u32 rkey;
u32 length;
u64 atomic_orig; u64 atomic_orig;
/* SRQ only */ /* SRQ only */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册