public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Wang <yun.wang@profitbricks.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Nicholas Krause <xerofoify@gmail.com>,
	dledford@redhat.com, sean.hefty@intel.com,
	hal.rosenstock@gmail.com, haggaie@mellanox.com,
	matanb@mellanox.com, doront@mellanox.com, david.ahern@oracle.com,
	erezsh@mellanox.com, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] infiniband:core:Add needed error path in cm_init_av_by_path
Date: Thu, 17 Dec 2015 09:43:43 +0100	[thread overview]
Message-ID: <567275BF.1010208@profitbricks.com> (raw)
In-Reply-To: <20151216181644.GF32594@obsidianresearch.com>



On 12/16/2015 07:16 PM, Jason Gunthorpe wrote:
> On Wed, Dec 16, 2015 at 11:26:39AM +0100, Michael Wang wrote:
[snip]
>>
>> I've rechecked the ib_init_ah_from_path() again, and found it
>> still set IB_AH_GRH when the GID cache missing, but with:
> 
> How do you mean?
> 
>                 ah_attr->ah_flags = IB_AH_GRH;
>                 ah_attr->grh.dgid = rec->dgid;
> 
>                 ret = ib_find_cached_gid(device, &rec->sgid, ndev, &port_num,
>                                          &gid_index);
>                 if (ret) {
>                         if (ndev)
>                                 dev_put(ndev);
>                         return ret;
>                 }
> 
> If find_cached_gid fails then ib_init_ah_from_path also fails.
> 
> Is there a case where ib_find_cached_gid can succeed but not return
> good data?

Just for the GRH header, ib_find_cached_gid() will failed but the flag
and dgid will be correct, and others are all 0 including hop limit, but
may be just coincidence...

As long as hop_limit > 1 means the pkg do have to pass through a router
to other subnet, the fix make sense :-)

Regards,
Michael Wang

> 
> I agree it would read nicer if the ah_flags and gr.dgid was moved
> after the ib_find_cached_gid
> 
>> BTW, cma_sidr_rep_handler() also call ib_init_ah_from_path() with out
>> a check on return.
> 
> That sounds like a problem.
> 
> Jason
> 

      reply	other threads:[~2015-12-17  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1450194724-7107-1-git-send-email-xerofoify@gmail.com>
2015-12-15 16:38 ` [PATCH RESEND] infiniband:core:Add needed error path in cm_init_av_by_path Michael Wang
2015-12-15 17:30   ` Jason Gunthorpe
2015-12-16  6:52     ` ira.weiny
2015-12-16 10:26     ` Michael Wang
2015-12-16 18:16       ` Jason Gunthorpe
2015-12-17  8:43         ` Michael Wang [this message]

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=567275BF.1010208@profitbricks.com \
    --to=yun.wang@profitbricks.com \
    --cc=david.ahern@oracle.com \
    --cc=dledford@redhat.com \
    --cc=doront@mellanox.com \
    --cc=erezsh@mellanox.com \
    --cc=haggaie@mellanox.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matanb@mellanox.com \
    --cc=sean.hefty@intel.com \
    --cc=xerofoify@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox