All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v2 05/15] xprtrdma: Prevent infinite loop in rpcrdma_ep_create()
Date: Tue, 24 Mar 2015 16:31:15 -0400	[thread overview]
Message-ID: <20150324203115.2311.38830.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20150324201849.2311.53599.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>

If a provider advertizes a zero max_fast_reg_page_list_len, FRWR
depth detection loops forever. Instead of just failing the mount,
try other memory registration modes.

Fixes: 0fc6c4e7bb28 ("xprtrdma: mind the device's max fast . . .")
Reported-by: Devesh Sharma <Devesh.Sharma-iH1Dq9VlAzfQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 net/sunrpc/xprtrdma/verbs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 60f3317..99752b5 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -618,9 +618,10 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
 
 	if (memreg == RPCRDMA_FRMR) {
 		/* Requires both frmr reg and local dma lkey */
-		if ((devattr->device_cap_flags &
+		if (((devattr->device_cap_flags &
 		     (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) !=
-		    (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) {
+		    (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) ||
+		      (devattr->max_fast_reg_page_list_len == 0)) {
 			dprintk("RPC:       %s: FRMR registration "
 				"not supported by HCA\n", __func__);
 			memreg = RPCRDMA_MTHCAFMR;

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: [PATCH v2 05/15] xprtrdma: Prevent infinite loop in rpcrdma_ep_create()
Date: Tue, 24 Mar 2015 16:31:15 -0400	[thread overview]
Message-ID: <20150324203115.2311.38830.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20150324201849.2311.53599.stgit@manet.1015granger.net>

If a provider advertizes a zero max_fast_reg_page_list_len, FRWR
depth detection loops forever. Instead of just failing the mount,
try other memory registration modes.

Fixes: 0fc6c4e7bb28 ("xprtrdma: mind the device's max fast . . .")
Reported-by: Devesh Sharma <Devesh.Sharma@Emulex.Com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/verbs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 60f3317..99752b5 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -618,9 +618,10 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
 
 	if (memreg == RPCRDMA_FRMR) {
 		/* Requires both frmr reg and local dma lkey */
-		if ((devattr->device_cap_flags &
+		if (((devattr->device_cap_flags &
 		     (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) !=
-		    (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) {
+		    (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) ||
+		      (devattr->max_fast_reg_page_list_len == 0)) {
 			dprintk("RPC:       %s: FRMR registration "
 				"not supported by HCA\n", __func__);
 			memreg = RPCRDMA_MTHCAFMR;


  parent reply	other threads:[~2015-03-24 20:31 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 20:30 [PATCH v2 00/15] NFS/RDMA patches proposed for 4.1 Chuck Lever
2015-03-24 20:30 ` Chuck Lever
     [not found] ` <20150324201849.2311.53599.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2015-03-24 20:30   ` [PATCH v2 01/15] SUNRPC: Introduce missing well-known netids Chuck Lever
2015-03-24 20:30     ` Chuck Lever
2015-03-24 20:30   ` [PATCH v2 02/15] xprtrdma: Display IPv6 addresses and port numbers correctly Chuck Lever
2015-03-24 20:30     ` Chuck Lever
2015-03-24 20:30   ` [PATCH v2 03/15] xprtrdma: Perform a full marshal on retransmit Chuck Lever
2015-03-24 20:30     ` Chuck Lever
2015-03-24 20:31   ` [PATCH v2 04/15] xprtrdma: Byte-align FRWR registration Chuck Lever
2015-03-24 20:31     ` Chuck Lever
2015-03-24 20:31   ` Chuck Lever [this message]
2015-03-24 20:31     ` [PATCH v2 05/15] xprtrdma: Prevent infinite loop in rpcrdma_ep_create() Chuck Lever
2015-03-24 20:31   ` [PATCH v2 06/15] xprtrdma: Add vector of ops for each memory registration strategy Chuck Lever
2015-03-24 20:31     ` Chuck Lever
2015-03-24 20:31   ` [PATCH v2 07/15] xprtrdma: Add a "max_payload" op for each memreg mode Chuck Lever
2015-03-24 20:31     ` Chuck Lever
2015-03-24 20:31   ` [PATCH v2 08/15] xprtrdma: Add a "register_external" " Chuck Lever
2015-03-24 20:31     ` Chuck Lever
2015-03-24 20:31   ` [PATCH v2 09/15] xprtrdma: Add a "deregister_external" " Chuck Lever
2015-03-24 20:31     ` Chuck Lever
2015-03-24 20:32   ` [PATCH v2 10/15] xprtrdma: Add "init MRs" memreg op Chuck Lever
2015-03-24 20:32     ` Chuck Lever
2015-03-24 20:32   ` [PATCH v2 11/15] xprtrdma: Add "reset " Chuck Lever
2015-03-24 20:32     ` Chuck Lever
2015-03-24 20:32   ` [PATCH v2 12/15] xprtrdma: Add "destroy " Chuck Lever
2015-03-24 20:32     ` Chuck Lever
2015-03-24 20:32   ` [PATCH v2 13/15] xprtrdma: Add "open" " Chuck Lever
2015-03-24 20:32     ` Chuck Lever
2015-03-24 20:32   ` [PATCH v2 14/15] xprtrdma: Handle non-SEND completions via a callout Chuck Lever
2015-03-24 20:32     ` Chuck Lever
2015-03-24 20:32   ` [PATCH v2 15/15] xprtrdma: Make rpcrdma_{un}map_one() into inline functions Chuck Lever
2015-03-24 20:32     ` Chuck Lever
2015-03-26 18:39   ` [PATCH v2 00/15] NFS/RDMA patches proposed for 4.1 Anna Schumaker
2015-03-26 18:39     ` Anna Schumaker
     [not found]     ` <55145274.203-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2015-03-26 18:43       ` Chuck Lever
2015-03-26 18:43         ` Chuck Lever
2015-03-27  5:42       ` Devesh Sharma
2015-03-27  5:42         ` Devesh Sharma
     [not found]         ` <EE7902D3F51F404C82415C4803930ACD5DC3B914-DWYeeINJQrxExQ8dmkPuX0M9+F4ksjoh@public.gmane.org>
2015-03-27  5:44           ` Devesh Sharma
2015-03-27  5:44             ` Devesh Sharma
     [not found]             ` <c541888a-6b49-4b9f-98ba-a1d77df1d071-3RiH6ntJJkOPfaB/Gd0HpljyZtpTMMwT@public.gmane.org>
2015-03-27 14:17               ` Chuck Lever
2015-03-27 14:17                 ` Chuck Lever
     [not found]                 ` <AFCD874E-D85C-4788-A409-17906D841C5B-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-03-27 15:59                   ` Devesh Sharma
2015-03-27 15:59                     ` Devesh Sharma
2015-03-30 14:18   ` Steve Wise
2015-03-30 14:18     ` Steve Wise
     [not found]     ` <55195B3B.40205-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2015-03-30 17:53       ` Chuck Lever
2015-03-30 17:53         ` Chuck Lever
     [not found]         ` <9D560F87-71BF-470E-B411-EF68D75070AA-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-03-30 18:01           ` Steve Wise
2015-03-30 18:01             ` Steve Wise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150324203115.2311.38830.stgit@manet.1015granger.net \
    --to=chuck.lever-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.