All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Bart Van Assche <bvanassche@acm.org>, Hal Rosenstock <hal@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
	Doug Ledford <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	oulijun <oulijun@huawei.com>
Subject: Re: [PATCH] RDMA/srpt: Filter out AGN bits
Date: Mon, 19 Aug 2019 12:21:32 +0000	[thread overview]
Message-ID: <20190819122126.GA6509@ziepe.ca> (raw)
In-Reply-To: <20190814151507.140572-1-bvanassche@acm.org>

On Wed, Aug 14, 2019 at 08:15:07AM -0700, Bart Van Assche wrote:
> The ib_srpt driver derives its default service GUID from the node GUID
> of the first encountered HCA. Since that service GUID is passed to
> ib_cm_listen(), the AGN bits must not be set. Since the AGN bits can
> be set in the node GUID of RoCE HCAs, filter these bits out. This
> patch avoids that loading the ib_srpt driver fails as follows for the
> hns driver:
> 
>   ib_srpt srpt_add_one(hns_0) failed.
> 
> Cc: oulijun <oulijun@huawei.com>
> Reported-by: oulijun <oulijun@huawei.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>  drivers/infiniband/ulp/srpt/ib_srpt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index e25c70a56be6..114bf8d6c82b 100644
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -3109,7 +3109,8 @@ static void srpt_add_one(struct ib_device *device)
>  	srpt_use_srq(sdev, sdev->port[0].port_attrib.use_srq);
>  
>  	if (!srpt_service_guid)
> -		srpt_service_guid = be64_to_cpu(device->node_guid);
> +		srpt_service_guid = be64_to_cpu(device->node_guid) &
> +			~IB_SERVICE_ID_AGN_MASK;

This seems kind of sketchy, masking bits in the GUID is going to make
it non-unique.. Should we do this only for roce or something?

Hal, do you have any insight?

Jason

  reply	other threads:[~2019-08-19 12:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 15:15 [PATCH] RDMA/srpt: Filter out AGN bits Bart Van Assche
2019-08-19 12:21 ` Jason Gunthorpe [this message]
2019-08-19 13:40   ` Hal Rosenstock
2019-08-19 13:46     ` Jason Gunthorpe
2019-08-19 13:49       ` Hal Rosenstock
2019-08-19 15:11   ` Bart Van Assche
2019-08-19 15:17     ` Jason Gunthorpe
2019-08-19 15:45       ` Bart Van Assche
2019-08-19 16:16         ` Jason Gunthorpe
2019-08-19 16:48           ` Bart Van Assche
2019-08-20 17:08             ` 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=20190819122126.GA6509@ziepe.ca \
    --to=jgg@mellanox.com \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=hal@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=oulijun@huawei.com \
    /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.