Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754730AbbLPK0v (ORCPT ); Wed, 16 Dec 2015 05:26:51 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36802 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933879AbbLPK0m (ORCPT ); Wed, 16 Dec 2015 05:26:42 -0500 From: Michael Wang Subject: Re: [PATCH RESEND] infiniband:core:Add needed error path in cm_init_av_by_path To: Jason Gunthorpe References: <1450194724-7107-1-git-send-email-xerofoify@gmail.com> <5670420A.7040202@profitbricks.com> <20151215173022.GB25965@obsidianresearch.com> Cc: Nicholas Krause , 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 Message-ID: <56713C5F.5020507@profitbricks.com> Date: Wed, 16 Dec 2015 11:26:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151215173022.GB25965@obsidianresearch.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1305 Lines: 43 On 12/15/2015 06:30 PM, Jason Gunthorpe wrote: > On Tue, Dec 15, 2015 at 05:38:34PM +0100, Michael Wang wrote: >> The hop_limit is only suggest that the package allowed to be >> routed, not have to, correct? > > If the hop limit is >= 2 (?) then the GRH is mandatory. The > SM will return this information in the PathRecord if it determines a > GRH is required. The whole stack follows this protocol. > > The GRH is optional for in-subnet communications. Thanks for the explain :-) 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: grh.sgid_index = 0 grh.flow_label = 0 grh.hop_limit = 0 grh.traffic_class = 0 Not sure if it's just coincidence, hop_limit is 0, so router will discard the pkg and GRH won't be used, the transaction in subnet still works. Could this by designed as an optimization for the case like when SM reassigning the GID? BTW, cma_sidr_rep_handler() also call ib_init_ah_from_path() with out a check on return. Regards, Michael Wang > > Jason > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/