diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2017-08-03 14:30:44 -0400 |
|---|---|---|
| committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2017-08-08 10:52:01 -0400 |
| commit | e2a671904149c1c0aa438e3cbe7d0e8ad2cf8721 (patch) | |
| tree | 8d4e174de83896a1745dcd9bcf48a9a549bf9669 /net | |
| parent | fdf503e302c5e6ec136703b25bde989a34f0f27f (diff) | |
xprtrdma: Remove rpcrdma_rep::rr_len
This field is no longer used outside the Receive completion handler.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/sunrpc/xprtrdma/rpc_rdma.c | 2 | ||||
| -rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 11 | ||||
| -rw-r--r-- | net/sunrpc/xprtrdma/xprt_rdma.h | 3 |
3 files changed, 5 insertions, 11 deletions
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index e422c0f63a69..621986156495 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c | |||
| @@ -1178,7 +1178,7 @@ rpcrdma_reply_handler(struct work_struct *work) | |||
| 1178 | 1178 | ||
| 1179 | dprintk("RPC: %s: incoming rep %p\n", __func__, rep); | 1179 | dprintk("RPC: %s: incoming rep %p\n", __func__, rep); |
| 1180 | 1180 | ||
| 1181 | if (rep->rr_len == RPCRDMA_BAD_LEN) | 1181 | if (rep->rr_hdrbuf.head[0].iov_len == 0) |
| 1182 | goto out_badstatus; | 1182 | goto out_badstatus; |
| 1183 | 1183 | ||
| 1184 | xdr_init_decode(xdr, &rep->rr_hdrbuf, | 1184 | xdr_init_decode(xdr, &rep->rr_hdrbuf, |
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 74dbba84ad38..5d36c066552d 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c | |||
| @@ -143,9 +143,6 @@ rpcrdma_update_granted_credits(struct rpcrdma_rep *rep) | |||
| 143 | struct rpcrdma_buffer *buffer = &rep->rr_rxprt->rx_buf; | 143 | struct rpcrdma_buffer *buffer = &rep->rr_rxprt->rx_buf; |
| 144 | u32 credits; | 144 | u32 credits; |
| 145 | 145 | ||
| 146 | if (rep->rr_len < RPCRDMA_HDRLEN_ERR) | ||
| 147 | return; | ||
| 148 | |||
| 149 | credits = be32_to_cpu(rmsgp->rm_credit); | 146 | credits = be32_to_cpu(rmsgp->rm_credit); |
| 150 | if (credits == 0) | 147 | if (credits == 0) |
| 151 | credits = 1; /* don't deadlock */ | 148 | credits = 1; /* don't deadlock */ |
| @@ -176,16 +173,16 @@ rpcrdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) | |||
| 176 | dprintk("RPC: %s: rep %p opcode 'recv', length %u: success\n", | 173 | dprintk("RPC: %s: rep %p opcode 'recv', length %u: success\n", |
| 177 | __func__, rep, wc->byte_len); | 174 | __func__, rep, wc->byte_len); |
| 178 | 175 | ||
| 179 | rep->rr_len = wc->byte_len; | ||
| 180 | rpcrdma_set_xdrlen(&rep->rr_hdrbuf, wc->byte_len); | 176 | rpcrdma_set_xdrlen(&rep->rr_hdrbuf, wc->byte_len); |
| 181 | rep->rr_wc_flags = wc->wc_flags; | 177 | rep->rr_wc_flags = wc->wc_flags; |
| 182 | rep->rr_inv_rkey = wc->ex.invalidate_rkey; | 178 | rep->rr_inv_rkey = wc->ex.invalidate_rkey; |
| 183 | 179 | ||
| 184 | ib_dma_sync_single_for_cpu(rdmab_device(rep->rr_rdmabuf), | 180 | ib_dma_sync_single_for_cpu(rdmab_device(rep->rr_rdmabuf), |
| 185 | rdmab_addr(rep->rr_rdmabuf), | 181 | rdmab_addr(rep->rr_rdmabuf), |
| 186 | rep->rr_len, DMA_FROM_DEVICE); | 182 | wc->byte_len, DMA_FROM_DEVICE); |
| 187 | 183 | ||
| 188 | rpcrdma_update_granted_credits(rep); | 184 | if (wc->byte_len >= RPCRDMA_HDRLEN_ERR) |
| 185 | rpcrdma_update_granted_credits(rep); | ||
| 189 | 186 | ||
| 190 | out_schedule: | 187 | out_schedule: |
| 191 | queue_work(rpcrdma_receive_wq, &rep->rr_work); | 188 | queue_work(rpcrdma_receive_wq, &rep->rr_work); |
| @@ -196,7 +193,7 @@ out_fail: | |||
| 196 | pr_err("rpcrdma: Recv: %s (%u/0x%x)\n", | 193 | pr_err("rpcrdma: Recv: %s (%u/0x%x)\n", |
| 197 | ib_wc_status_msg(wc->status), | 194 | ib_wc_status_msg(wc->status), |
| 198 | wc->status, wc->vendor_err); | 195 | wc->status, wc->vendor_err); |
| 199 | rep->rr_len = RPCRDMA_BAD_LEN; | 196 | rpcrdma_set_xdrlen(&rep->rr_hdrbuf, 0); |
| 200 | goto out_schedule; | 197 | goto out_schedule; |
| 201 | } | 198 | } |
| 202 | 199 | ||
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index 13556ae11eec..d4a897af9d9b 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h | |||
| @@ -218,7 +218,6 @@ enum { | |||
| 218 | 218 | ||
| 219 | struct rpcrdma_rep { | 219 | struct rpcrdma_rep { |
| 220 | struct ib_cqe rr_cqe; | 220 | struct ib_cqe rr_cqe; |
| 221 | unsigned int rr_len; | ||
| 222 | int rr_wc_flags; | 221 | int rr_wc_flags; |
| 223 | u32 rr_inv_rkey; | 222 | u32 rr_inv_rkey; |
| 224 | struct rpcrdma_xprt *rr_rxprt; | 223 | struct rpcrdma_xprt *rr_rxprt; |
| @@ -230,8 +229,6 @@ struct rpcrdma_rep { | |||
| 230 | struct rpcrdma_regbuf *rr_rdmabuf; | 229 | struct rpcrdma_regbuf *rr_rdmabuf; |
| 231 | }; | 230 | }; |
| 232 | 231 | ||
| 233 | #define RPCRDMA_BAD_LEN (~0U) | ||
| 234 | |||
| 235 | /* | 232 | /* |
| 236 | * struct rpcrdma_mw - external memory region metadata | 233 | * struct rpcrdma_mw - external memory region metadata |
| 237 | * | 234 | * |
