Hi Sagi-

> On Oct 6, 2015, at 5:48 AM, Sagi Grimberg <[email protected]> wrote:
> 
> There is no need to require LOCAL_DMA_LKEY support in order to
> use fast registration as the PD allocation makes sure that there
> is a local_dma_lkey.

In other words, all devices now have a local DMA lkey, so the
check is unnecessary.


> This caused a NULL pointer dereference in mlx5 which removed
> the support for LOCAL_DMA_LKEY.

Where was the bad dereference? in mlx5, or in xprtrdma?


> Fixes: bb6c96d72879 ("xprtrdma: Replace global lkey with lkey local to PD")
> Signed-off-by: Sagi Grimberg <[email protected]>
> ---
> net/sunrpc/xprtrdma/verbs.c |    7 ++-----
> 1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index eb081ad..7efd9ef 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -543,11 +543,8 @@ 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 &
> -                  (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)) {
> +             if (!(devattr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) 
> ||
> +                 (devattr->max_fast_reg_page_list_len == 0)) {
>                       dprintk("RPC:       %s: FRMR registration "
>                               "not supported by HCA\n", __func__);
>                       memreg = RPCRDMA_MTHCAFMR;

Reviewed-by: Chuck Lever <[email protected]>


—
Chuck Lever



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to