From patchwork Mon Jun 27 17:08:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 921692 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5RH3VWR005439 for ; Mon, 27 Jun 2011 17:08:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752872Ab1F0RIO (ORCPT ); Mon, 27 Jun 2011 13:08:14 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:50700 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752863Ab1F0RIN (ORCPT ); Mon, 27 Jun 2011 13:08:13 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from alexne@mellanox.com) with SMTP; 27 Jun 2011 20:08:10 +0300 Received: from MTRCASDAG01.mtl.com (172.25.0.174) by MTLCAS02.mtl.com (10.0.8.72) with Microsoft SMTP Server (TLS) id 14.1.270.1; Mon, 27 Jun 2011 20:08:09 +0300 Received: from localhost (172.25.6.157) by MTRCASDAG01.mtl.com (172.25.0.174) with Microsoft SMTP Server (TLS) id 14.1.270.1; Mon, 27 Jun 2011 20:08:09 +0300 Date: Mon, 27 Jun 2011 20:08:03 +0300 From: Alex Netes To: Subject: [PATCH] opensm: don't set switch hops to lid 0 Message-ID: <20110627170803.GB17645@calypso.voltaire.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [172.25.6.157] 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.6 (demeter2.kernel.org [140.211.167.43]); Mon, 27 Jun 2011 17:08:16 +0000 (UTC) Some faulty switches, may retuen port_info.base_lid=0. This patch fixes a crash in a multicast engine, caused by lid matrix with hops values for lid 0. Signed-off-by: Alex Netes --- opensm/osm_switch.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c index fbb8292..a625b2c 100644 --- a/opensm/osm_switch.c +++ b/opensm/osm_switch.c @@ -54,7 +54,7 @@ cl_status_t osm_switch_set_hops(IN osm_switch_t * p_sw, IN uint16_t lid_ho, IN uint8_t port_num, IN uint8_t num_hops) { - if (lid_ho > p_sw->max_lid_ho) + if (!lid_ho || lid_ho > p_sw->max_lid_ho) return -1; if (!p_sw->hops[lid_ho]) { p_sw->hops[lid_ho] = malloc(p_sw->num_ports);