Commit 8a14793e authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker

xprtrdma: Remove xprt-specific connect cookie

Clean up: The generic rq_connect_cookie is sufficient to detect RPC
Call retransmission.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent b7e85fff
...@@ -236,8 +236,6 @@ rpcrdma_connect_worker(struct work_struct *work) ...@@ -236,8 +236,6 @@ rpcrdma_connect_worker(struct work_struct *work)
struct rpc_xprt *xprt = &r_xprt->rx_xprt; struct rpc_xprt *xprt = &r_xprt->rx_xprt;
spin_lock_bh(&xprt->transport_lock); spin_lock_bh(&xprt->transport_lock);
if (++xprt->connect_cookie == 0) /* maintain a reserved value */
++xprt->connect_cookie;
if (ep->rep_connected > 0) { if (ep->rep_connected > 0) {
if (!xprt_test_and_set_connected(xprt)) if (!xprt_test_and_set_connected(xprt))
xprt_wake_pending_tasks(xprt, 0); xprt_wake_pending_tasks(xprt, 0);
...@@ -650,7 +648,6 @@ xprt_rdma_allocate(struct rpc_task *task) ...@@ -650,7 +648,6 @@ xprt_rdma_allocate(struct rpc_task *task)
if (!rpcrdma_get_recvbuf(r_xprt, req, rqst->rq_rcvsize, flags)) if (!rpcrdma_get_recvbuf(r_xprt, req, rqst->rq_rcvsize, flags))
goto out_fail; goto out_fail;
req->rl_connect_cookie = 0; /* our reserved value */
rpcrdma_set_xprtdata(rqst, req); rpcrdma_set_xprtdata(rqst, req);
rqst->rq_buffer = req->rl_sendbuf->rg_base; rqst->rq_buffer = req->rl_sendbuf->rg_base;
rqst->rq_rbuffer = req->rl_recvbuf->rg_base; rqst->rq_rbuffer = req->rl_recvbuf->rg_base;
...@@ -721,9 +718,8 @@ xprt_rdma_send_request(struct rpc_task *task) ...@@ -721,9 +718,8 @@ xprt_rdma_send_request(struct rpc_task *task)
rpcrdma_recv_buffer_get(req); rpcrdma_recv_buffer_get(req);
/* Must suppress retransmit to maintain credits */ /* Must suppress retransmit to maintain credits */
if (req->rl_connect_cookie == xprt->connect_cookie) if (rqst->rq_connect_cookie == xprt->connect_cookie)
goto drop_connection; goto drop_connection;
req->rl_connect_cookie = xprt->connect_cookie;
__set_bit(RPCRDMA_REQ_F_PENDING, &req->rl_flags); __set_bit(RPCRDMA_REQ_F_PENDING, &req->rl_flags);
if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req)) if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
......
...@@ -255,6 +255,7 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event) ...@@ -255,6 +255,7 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event)
/* Return 1 to ensure the core destroys the id. */ /* Return 1 to ensure the core destroys the id. */
return 1; return 1;
case RDMA_CM_EVENT_ESTABLISHED: case RDMA_CM_EVENT_ESTABLISHED:
++xprt->rx_xprt.connect_cookie;
connstate = 1; connstate = 1;
rpcrdma_update_connect_private(xprt, &event->param.conn); rpcrdma_update_connect_private(xprt, &event->param.conn);
goto connected; goto connected;
...@@ -273,6 +274,7 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event) ...@@ -273,6 +274,7 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event)
connstate = -EAGAIN; connstate = -EAGAIN;
goto connected; goto connected;
case RDMA_CM_EVENT_DISCONNECTED: case RDMA_CM_EVENT_DISCONNECTED:
++xprt->rx_xprt.connect_cookie;
connstate = -ECONNABORTED; connstate = -ECONNABORTED;
connected: connected:
xprt->rx_buf.rb_credits = 1; xprt->rx_buf.rb_credits = 1;
......
...@@ -334,7 +334,6 @@ enum { ...@@ -334,7 +334,6 @@ enum {
struct rpcrdma_buffer; struct rpcrdma_buffer;
struct rpcrdma_req { struct rpcrdma_req {
struct list_head rl_list; struct list_head rl_list;
unsigned int rl_connect_cookie;
struct rpcrdma_buffer *rl_buffer; struct rpcrdma_buffer *rl_buffer;
struct rpcrdma_rep *rl_reply; struct rpcrdma_rep *rl_reply;
struct xdr_stream rl_stream; struct xdr_stream rl_stream;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment