From patchwork Mon May 24 19:43:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 101930 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4OJpqr0005597 for ; Mon, 24 May 2010 19:51:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756043Ab0EXTv4 (ORCPT ); Mon, 24 May 2010 15:51:56 -0400 Received: from qmta13.westchester.pa.mail.comcast.net ([76.96.59.243]:54863 "EHLO qmta13.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755863Ab0EXTvz (ORCPT ); Mon, 24 May 2010 15:51:55 -0400 Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71]) by qmta13.westchester.pa.mail.comcast.net with comcast id MQXF1e00A1YDfWL5DXlxgo; Mon, 24 May 2010 19:45:57 +0000 Received: from hal.comcast.net ([75.69.247.31]) by omta20.westchester.pa.mail.comcast.net with comcast id MXlw1e00H0hNrtn3gXlwb5; Mon, 24 May 2010 19:45:57 +0000 Received: from hal.comcast.net (localhost.localdomain [127.0.0.1]) by hal.comcast.net (8.14.3/8.14.3) with ESMTP id o4OJjSOx026962; Mon, 24 May 2010 15:45:33 -0400 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id o4OJhrue026927; Mon, 24 May 2010 15:43:53 -0400 Date: Mon, 24 May 2010 15:43:53 -0400 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm/osm_sa_multipath_record.c: livelock in mpr_rcv_get_path_parms Message-ID: <20100524194353.GB26919@comcast.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 24 May 2010 19:51:57 +0000 (UTC) diff --git a/opensm/opensm/osm_sa_multipath_record.c b/opensm/opensm/osm_sa_multipath_record.c index cb27e9d..18a0122 100644 --- a/opensm/opensm/osm_sa_multipath_record.c +++ b/opensm/opensm/osm_sa_multipath_record.c @@ -62,6 +62,7 @@ #include #define OSM_SA_MPR_MAX_NUM_PATH 127 +#define MAX_HOPS 64 typedef struct osm_mpr_item { cl_list_item_t list_item; @@ -295,7 +296,23 @@ static ib_api_status_t mpr_rcv_get_path_parms(IN osm_sa_t * sa, goto Exit; } + /* update number of hops traversed */ hops++; + if (hops > MAX_HOPS) { + OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4520: " + "Path from GUID 0x%016" PRIx64 " (%s) to" + " lid %u GUID 0x%016" PRIx64 " (%s) needs" + " more than %d hops, max %d hops allowed\n", + cl_ntoh64(osm_physp_get_port_guid(p_src_physp)), + p_src_physp->p_node->print_desc, dest_lid_ho, + cl_ntoh64(osm_physp_get_port_guid + (p_dest_physp)), + p_dest_physp->p_node->print_desc, hops, + MAX_HOPS); + status = IB_NOT_FOUND; + goto Exit; + } + in_port_num = osm_physp_get_port_num(p_physp); /*