Commit 1658f40e authored by Chuck Lever's avatar Chuck Lever Committed by Luis Henriques

xprtrdma: Prevent infinite loop in rpcrdma_ep_create()

commit 41f97028 upstream.

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: 0fc6c4e7 ("xprtrdma: mind the device's max fast . . .")
Reported-by: default avatarDevesh Sharma <Devesh.Sharma@Emulex.Com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Tested-by: default avatarDevesh Sharma <Devesh.Sharma@Emulex.Com>
Tested-by: default avatarMeghana Cheripady <Meghana.Cheripady@Emulex.Com>
Tested-by: default avatarVeeresh U. Kokatnur <veereshuk@chelsio.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
[ luis: backported to 3.16:
  - devattr struct isn't a pointer ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 08ba9e1c
...@@ -541,9 +541,10 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg) ...@@ -541,9 +541,10 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
if (memreg == RPCRDMA_FRMR) { if (memreg == RPCRDMA_FRMR) {
/* Requires both frmr reg and local dma lkey */ /* 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)) { (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) ||
(devattr.max_fast_reg_page_list_len == 0)) {
dprintk("RPC: %s: FRMR registration " dprintk("RPC: %s: FRMR registration "
"not supported by HCA\n", __func__); "not supported by HCA\n", __func__);
memreg = RPCRDMA_MTHCAFMR; memreg = RPCRDMA_MTHCAFMR;
......
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