diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 6bb9a07f7d49..a3527989f5b3 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c | |||
@@ -491,33 +491,32 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg) | |||
491 | ia->ri_dma_lkey = ia->ri_id->device->local_dma_lkey; | 491 | ia->ri_dma_lkey = ia->ri_id->device->local_dma_lkey; |
492 | } | 492 | } |
493 | 493 | ||
494 | switch (memreg) { | 494 | if (memreg == RPCRDMA_FRMR) { |
495 | case RPCRDMA_MTHCAFMR: | ||
496 | if (!ia->ri_id->device->alloc_fmr) { | ||
497 | dprintk("RPC: %s: MTHCAFMR registration " | ||
498 | "specified but not supported by adapter, " | ||
499 | "using riskier RPCRDMA_ALLPHYSICAL\n", | ||
500 | __func__); | ||
501 | memreg = RPCRDMA_ALLPHYSICAL; | ||
502 | } | ||
503 | break; | ||
504 | case RPCRDMA_FRMR: | ||
505 | /* Requires both frmr reg and local dma lkey */ | 495 | /* Requires both frmr reg and local dma lkey */ |
506 | if ((devattr.device_cap_flags & | 496 | if ((devattr.device_cap_flags & |
507 | (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) != | 497 | (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) != |
508 | (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) { | 498 | (IB_DEVICE_MEM_MGT_EXTENSIONS|IB_DEVICE_LOCAL_DMA_LKEY)) { |
509 | dprintk("RPC: %s: FRMR registration " | 499 | dprintk("RPC: %s: FRMR registration " |
510 | "specified but not supported by adapter, " | 500 | "not supported by HCA\n", __func__); |
511 | "using riskier RPCRDMA_ALLPHYSICAL\n", | 501 | memreg = RPCRDMA_MTHCAFMR; |
512 | __func__); | ||
513 | memreg = RPCRDMA_ALLPHYSICAL; | ||
514 | } else { | 502 | } else { |
515 | /* Mind the ia limit on FRMR page list depth */ | 503 | /* Mind the ia limit on FRMR page list depth */ |
516 | ia->ri_max_frmr_depth = min_t(unsigned int, | 504 | ia->ri_max_frmr_depth = min_t(unsigned int, |
517 | RPCRDMA_MAX_DATA_SEGS, | 505 | RPCRDMA_MAX_DATA_SEGS, |
518 | devattr.max_fast_reg_page_list_len); | 506 | devattr.max_fast_reg_page_list_len); |
519 | } | 507 | } |
520 | break; | 508 | } |
509 | if (memreg == RPCRDMA_MTHCAFMR) { | ||
510 | if (!ia->ri_id->device->alloc_fmr) { | ||
511 | dprintk("RPC: %s: MTHCAFMR registration " | ||
512 | "not supported by HCA\n", __func__); | ||
513 | #if RPCRDMA_PERSISTENT_REGISTRATION | ||
514 | memreg = RPCRDMA_ALLPHYSICAL; | ||
515 | #else | ||
516 | rc = -EINVAL; | ||
517 | goto out2; | ||
518 | #endif | ||
519 | } | ||
521 | } | 520 | } |
522 | 521 | ||
523 | /* | 522 | /* |