All of lore.kernel.org
 help / color / mirror / Atom feed
From: "ira.weiny" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Michael Wang <yun.wang-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] IB/CMA: Fix condition to search for InfiniBand route
Date: Mon, 8 Jun 2015 11:44:13 -0400	[thread overview]
Message-ID: <20150608154412.GA23803@phlsvsds.ph.intel.com> (raw)
In-Reply-To: <1433770345-17354-1-git-send-email-monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

On Mon, Jun 08, 2015 at 04:32:25PM +0300, Moni Shoua wrote:
> The flag RDMA_CORE_CAP_IB_SA is set when link layer is InfiniBand but
> also when link layer is Ethernet.

Why?  Ethernet does not have an SA nor need one.

>
> Therefore, link layer is not implied by
> this flag.

Of course not.  This flag is explicitly saying this port needs to use the IB
SA to resolve the route information.

cma_resolve_ib_route finds the route information by issuing an SA query.
Therefore it should only be called on ports which require an SA.

Was this change inspired by a bug being found?  If so it seems the underlying
device needs to be fixed to not set the RDMA_CORE_CAP_IB_SA flag when the link
layer is ethernet.

Ira

> 
> ---
>  drivers/infiniband/core/cma.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 3b943b7..f96d6fd 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -1993,7 +1993,7 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
>  		return -EINVAL;
>  
>  	atomic_inc(&id_priv->refcount);
> -	if (rdma_cap_ib_sa(id->device, id->port_num))
> +	if (rdma_protocol_ib(id->device, id->port_num))
>  		ret = cma_resolve_ib_route(id_priv, timeout_ms);
>  	else if (rdma_protocol_roce(id->device, id->port_num))
>  		ret = cma_resolve_iboe_route(id_priv);
> -- 
> 1.7.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-06-08 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 13:32 [PATCH] IB/CMA: Fix condition to search for InfiniBand route Moni Shoua
     [not found] ` <1433770345-17354-1-git-send-email-monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-06-08 15:44   ` ira.weiny [this message]
2015-06-08 16:48   ` Hefty, Sean

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=20150608154412.GA23803@phlsvsds.ph.intel.com \
    --to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yun.wang-EIkl63zCoXaH+58JC4qpiA@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.