Blob Blame History Raw
From: Chuck Lever <chuck.lever@oracle.com>
Date: Mon, 19 Aug 2019 18:51:49 -0400
Subject: xprtrdma: Optimize rpcrdma_post_recvs()
Patch-mainline: v5.4-rc1
Git-commit: 435eba4ae0692e2f3d62988f8648efd65c935b6a
References: jsc#SLE-8449

Micro-optimization: In rpcrdma_post_recvs, since commit e340c2d6ef2a
("xprtrdma: Reduce the doorbell rate (Receive)"), the common case is
to return without doing anything. Found with perf.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 net/sunrpc/xprtrdma/verbs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1464,7 +1464,7 @@ rpcrdma_post_recvs(struct rpcrdma_xprt *
 	count = 0;
 
 	needed = buf->rb_credits + (buf->rb_bc_srv_max_requests << 1);
-	if (ep->rep_receive_count > needed)
+	if (likely(ep->rep_receive_count > needed))
 		goto out;
 	needed -= ep->rep_receive_count;
 	if (!temp)