public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: jackm <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH rdma-rc 5/9] IB/mlx4: Handle well-known-gid in mad_demux processing
Date: Mon, 7 Nov 2016 16:42:28 +0200	[thread overview]
Message-ID: <20161107164228.000047a5@dev.mellanox.co.il> (raw)
In-Reply-To: <d339ee5f-bf7e-dc35-3dd0-c6ff13a222b4-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On Sat, 5 Nov 2016 17:03:25 -0400
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> On 11/5/2016 3:57 PM, Leon Romanovsky wrote:
> > From: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> > 
> > If OpenSM runs over ConnectX-3, and there are ConnectIB VFs active
> > on the network, the OpenSM will receive QP1 packets containing a GRH
> > where the destination GID is the "Well-Known GID" -- which is not a
> > GID in the HCA Port's GID Table.
> > 
> > This GID must be tested-for separately -- and packets which contain
> > this destination GID should be routed to slave 0 (the PF).
> > 
> > Fixes: 37bfc7c1e83f ('IB/mlx4: SR-IOV multiplex and demultiplex
> > MADs') Signed-off-by: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> > Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > ---
> >  drivers/infiniband/hw/mlx4/mad.c | 16 ++++++++++++----
> >  include/rdma/ib_verbs.h          |  1 +
> >  2 files changed, 13 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/infiniband/hw/mlx4/mad.c
> > b/drivers/infiniband/hw/mlx4/mad.c index b8e9013..f0b8272 100644
> > --- a/drivers/infiniband/hw/mlx4/mad.c
> > +++ b/drivers/infiniband/hw/mlx4/mad.c
> > @@ -729,10 +729,18 @@ static int mlx4_ib_demux_mad(struct ib_device
> > *ibdev, u8 port, 
> >  	/* If a grh is present, we demux according to it */
> >  	if (wc->wc_flags & IB_WC_GRH) {
> > -		slave = mlx4_ib_find_real_gid(ibdev, port,
> > grh->dgid.global.interface_id);
> > -		if (slave < 0) {
> > -			mlx4_ib_warn(ibdev, "failed matching
> > grh\n");
> > -			return -ENOENT;
> > +		if (grh->dgid.global.interface_id ==
> > +			cpu_to_be64(IB_SA_WELL_KNOWN_GUID) &&
> > +		    grh->dgid.global.subnet_prefix ==
> > +			cpu_to_be64(IB_SA_WELL_KNOWN_GID_PREFIX)) {
> > +			slave = 0;
> > +		} else {
> > +			slave = mlx4_ib_find_real_gid(ibdev, port,
> > +
> > grh->dgid.global.interface_id);
> > +			if (slave < 0) {
> > +				mlx4_ib_warn(ibdev, "failed
> > matching grh\n");
> > +				return -ENOENT;
> > +			}
> >  		}
> >  	}
> >  	/* Class-specific handling */
> > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> > index 467a4b4..da5949f 100644
> > --- a/include/rdma/ib_verbs.h
> > +++ b/include/rdma/ib_verbs.h
> > @@ -100,6 +100,7 @@ enum rdma_node_type {
> >  
> >  enum {
> >  	/* set the local administered indication */
> > +	IB_SA_WELL_KNOWN_GID_PREFIX = 0xfe80000000000000ull,
> >  	IB_SA_WELL_KNOWN_GUID	= BIT_ULL(57) | 2,  
> 
> Isn't the SA well-known GID the concatenation of the subnet prefix
> (which isn't necessarily the default link local one) and the GUID
> 0x0200000000000002 ?
> 
> -- Hal

PLEASE DO NOT APPLY THIS PATCH. Hal is correct, and the patch needs
to be fixed. We will submit an updated (i.e. fixed) version.

-Jack

> 
> >  };
> >  
> >   

--
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:[~2016-11-07 14:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-05 19:57 [PATCH rdma-rc 0/9] mlx4 fixes for 4.9 Leon Romanovsky
     [not found] ` <1478375842-21513-1-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-11-05 19:57   ` [PATCH rdma-rc 1/9] IB/mlx4: Set traffic class in ah Leon Romanovsky
     [not found]     ` <1478375842-21513-2-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-11-06  7:26       ` Yuval Shaia
2016-11-05 19:57   ` [PATCH rdma-rc 2/9] IB/mlx4: Check gid_index return value Leon Romanovsky
     [not found]     ` <1478375842-21513-3-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-11-06  7:25       ` Yuval Shaia
     [not found]         ` <20161106072503.GB3799-Hxa29pjIrETwm8eLU6eYyt+IiqhCXseY@public.gmane.org>
2016-11-09  7:26           ` Leon Romanovsky
2016-11-05 19:57   ` [PATCH rdma-rc 3/9] IB/mlx4: Fix mlx4_ib_create_cq error flow Leon Romanovsky
2016-11-05 19:57   ` [PATCH rdma-rc 4/9] IB/{core, mlx4}: Handle IPv4 header when demultiplexing MAD Leon Romanovsky
2016-11-05 19:57   ` [PATCH rdma-rc 5/9] IB/mlx4: Handle well-known-gid in mad_demux processing Leon Romanovsky
     [not found]     ` <1478375842-21513-6-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-11-05 21:03       ` Hal Rosenstock
     [not found]         ` <d339ee5f-bf7e-dc35-3dd0-c6ff13a222b4-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-11-06 18:41           ` jackm
     [not found]             ` <20161106204107.00005742-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-11-06 20:46               ` Or Gerlitz
     [not found]                 ` <CAJ3xEMjLvo+LVFS0WL-K=m34-_1Tc0=pArOgELXmxqdtN871TA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-06 20:51                   ` Or Gerlitz
2016-11-07 14:42           ` jackm [this message]
2016-11-05 19:57   ` [PATCH rdma-rc 6/9] IB/mlx4: Put non zero value in max_ah device attribute Leon Romanovsky
     [not found]     ` <1478375842-21513-7-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-11-06  7:33       ` Yuval Shaia
2016-11-05 19:57   ` [PATCH rdma-rc 7/9] IB/mlx4: Fix port query for 56Gb Ethernet links Leon Romanovsky
2016-11-05 19:57   ` [PATCH rdma-rc 8/9] IB/mlx4: Add precondition for flow_steering_ib_uc_qp_range command Leon Romanovsky
2016-11-05 19:57   ` [PATCH rdma-rc 9/9] IB/mlx4: Check if GRH is available before using it in modify_qp Leon Romanovsky
2016-11-08  8:50   ` [PATCH rdma-rc 0/9] mlx4 fixes for 4.9 Leon Romanovsky
     [not found]     ` <20161108085021.GA27883-2ukJVAZIZ/Y@public.gmane.org>
2016-11-10  5:02       ` Doug Ledford

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=20161107164228.000047a5@dev.mellanox.co.il \
    --to=jackm-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox