linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Håkon Bugge" <haakon.bugge@oracle.com>
Cc: Doug Ledford <dledford@redhat.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next] RDMA/core: Unify RoCE check and re-factor code
Date: Thu, 8 Apr 2021 09:25:18 -0300	[thread overview]
Message-ID: <20210408122518.GA645599@nvidia.com> (raw)
In-Reply-To: <1617705423-15570-1-git-send-email-haakon.bugge@oracle.com>

On Tue, Apr 06, 2021 at 12:37:03PM +0200, Håkon Bugge wrote:
> In cm_req_handler(), unify the check for RoCE and re-factor to avoid
> one test.
> 
> Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
> Fixes: 8f9748602491 ("IB/cm: Reduce dependency on gid attribute ndev check")
> Fixes: 194f64a3cad3 ("RDMA/core: Fix corrupted SL on passive side")
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> ---
>  drivers/infiniband/core/cm.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> index 32c836b..074faff 100644
> --- a/drivers/infiniband/core/cm.c
> +++ b/drivers/infiniband/core/cm.c
> @@ -2138,21 +2138,17 @@ static int cm_req_handler(struct cm_work *work)
>  		goto destroy;
>  	}
>  
> -	if (cm_id_priv->av.ah_attr.type != RDMA_AH_ATTR_TYPE_ROCE)
> -		cm_process_routed_req(req_msg, work->mad_recv_wc->wc);
> -
>  	memset(&work->path[0], 0, sizeof(work->path[0]));
>  	if (cm_req_has_alt_path(req_msg))
>  		memset(&work->path[1], 0, sizeof(work->path[1]));
>  	grh = rdma_ah_read_grh(&cm_id_priv->av.ah_attr);
>  	gid_attr = grh->sgid_attr;
>  
> -	if (gid_attr &&
> -	    rdma_protocol_roce(work->port->cm_dev->ib_device,
> -			       work->port->port_num)) {
> +	if (gid_attr && cm_id_priv->av.ah_attr.type == RDMA_AH_ATTR_TYPE_ROCE) {

I think your other note was right, the gid_attr cannot be NULL when in
ROCE mode, so we can delete the 'gid_attr &&' term too

Jason

  reply	other threads:[~2021-04-08 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 10:37 [PATCH for-next] RDMA/core: Unify RoCE check and re-factor code Håkon Bugge
2021-04-08 12:25 ` Jason Gunthorpe [this message]
2021-04-08 13:24   ` Haakon Bugge
2021-04-19 15:49     ` Haakon Bugge
2021-04-19 15:57       ` Jason Gunthorpe

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=20210408122518.GA645599@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=haakon.bugge@oracle.com \
    --cc=linux-rdma@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).