Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1bcb68e authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker
Browse files

xprtrdma: Clean up XDR decoding in rpcrdma_update_granted_credits()



Clean up: Replace C-structure based XDR decoding for consistency
with other areas.

struct rpcrdma_rep is rearranged slightly so that the relevant fields
are in cache when the Receive completion handler is invoked.

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent e2a67190
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -139,11 +139,11 @@ rpcrdma_wc_send(struct ib_cq *cq, struct ib_wc *wc)
static void
static void
rpcrdma_update_granted_credits(struct rpcrdma_rep *rep)
rpcrdma_update_granted_credits(struct rpcrdma_rep *rep)
{
{
	struct rpcrdma_msg *rmsgp = rdmab_to_msg(rep->rr_rdmabuf);
	struct rpcrdma_buffer *buffer = &rep->rr_rxprt->rx_buf;
	struct rpcrdma_buffer *buffer = &rep->rr_rxprt->rx_buf;
	__be32 *p = rep->rr_rdmabuf->rg_base;
	u32 credits;
	u32 credits;


	credits = be32_to_cpu(rmsgp->rm_credit);
	credits = be32_to_cpup(p + 2);
	if (credits == 0)
	if (credits == 0)
		credits = 1;	/* don't deadlock */
		credits = 1;	/* don't deadlock */
	else if (credits > buffer->rb_max_requests)
	else if (credits > buffer->rb_max_requests)
+1 −1
Original line number Original line Diff line number Diff line
@@ -220,13 +220,13 @@ struct rpcrdma_rep {
	struct ib_cqe		rr_cqe;
	struct ib_cqe		rr_cqe;
	int			rr_wc_flags;
	int			rr_wc_flags;
	u32			rr_inv_rkey;
	u32			rr_inv_rkey;
	struct rpcrdma_regbuf	*rr_rdmabuf;
	struct rpcrdma_xprt	*rr_rxprt;
	struct rpcrdma_xprt	*rr_rxprt;
	struct work_struct	rr_work;
	struct work_struct	rr_work;
	struct xdr_buf		rr_hdrbuf;
	struct xdr_buf		rr_hdrbuf;
	struct xdr_stream	rr_stream;
	struct xdr_stream	rr_stream;
	struct list_head	rr_list;
	struct list_head	rr_list;
	struct ib_recv_wr	rr_recv_wr;
	struct ib_recv_wr	rr_recv_wr;
	struct rpcrdma_regbuf	*rr_rdmabuf;
};
};


/*
/*