From patchwork Thu Jan 8 12:49:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 5592431 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 243F6BF6C3 for ; Thu, 8 Jan 2015 12:50:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FC0B2038A for ; Thu, 8 Jan 2015 12:50:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8396020389 for ; Thu, 8 Jan 2015 12:50:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754203AbbAHMuG (ORCPT ); Thu, 8 Jan 2015 07:50:06 -0500 Received: from mail-wi0-f174.google.com ([209.85.212.174]:34246 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753240AbbAHMuF (ORCPT ); Thu, 8 Jan 2015 07:50:05 -0500 Received: by mail-wi0-f174.google.com with SMTP id h11so3023338wiw.1 for ; Thu, 08 Jan 2015 04:49:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=oG7LT4H3BHJT2H3b+qUAP66pp/dhr25sW8dDPkLHeY0=; b=YWN3QtVJ1psP/W9Ji4rSAspZ/DL174S8xCqFQt4oeELgQtHUfe0aO7Vly/Ho0QpyqZ BOzSdAID6EKfcI98hp/nAHQmBRFcws9tqh3/JvZ4n9xa8tE5EseEqsqQVZGAXtfVevF4 SdkbJl8NVpClicOFKrZyUJvGrrRbaCT8mgJEotLus061aJy5Si1NbNgJ3NZGRw27ggfn VC3P4JOlcYJ09NHOfj94A4Fe6w0zx5PX+tkfAYdbpXr/FvyczceWwFIgyzeOe8Zs4fMq l8t4/AI9pcbKsv4k+CSJVgBdY1uyVRl6XbFNTYXBiiO/OyHPbf8dJd1r28vUd9Ad+pFe 0q5Q== X-Gm-Message-State: ALoCoQmveWiWchuNvWg/11D52YGM/KlA5GKeRf/naJ9P/hUX+SLweyJ4fT9Ys2ToQnBfqBMvvesO X-Received: by 10.194.90.81 with SMTP id bu17mr18689137wjb.3.1420721384167; Thu, 08 Jan 2015 04:49:44 -0800 (PST) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id be4sm21734478wib.16.2015.01.08.04.49.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Jan 2015 04:49:43 -0800 (PST) Message-ID: <54AE7CE5.20203@dev.mellanox.co.il> Date: Thu, 08 Jan 2015 07:49:41 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Daniel Klein Subject: [PATCH opensm 1/5] osm_ucast_mgr.c: Force unicast routing to fail when lft allocations fail Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Klein Force unicast routing to fail when OpenSM fails to allocate memory for new_lft buffers for all the switches. Signed-off-by: Daniel Klein Signed-off-by: Hal Rosenstock --- opensm/osm_ucast_mgr.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/opensm/osm_ucast_mgr.c b/opensm/osm_ucast_mgr.c index 9f435c6..a52b044 100644 --- a/opensm/osm_ucast_mgr.c +++ b/opensm/osm_ucast_mgr.c @@ -1096,7 +1096,7 @@ int osm_ucast_mgr_process(IN osm_ucast_mgr_t * p_mgr) osm_opensm_t *p_osm; struct osm_routing_engine *p_routing_eng; cl_qmap_t *p_sw_guid_tbl; - int failed = 0; + int failed = -1; OSM_LOG_ENTER(p_mgr->p_log); @@ -1113,7 +1113,6 @@ int osm_ucast_mgr_process(IN osm_ucast_mgr_t * p_mgr) ucast_mgr_setup_all_switches(p_mgr->p_subn) < 0) goto Exit; - failed = -1; p_osm->routing_engine_used = NULL; while (p_routing_eng) { failed = ucast_mgr_route(p_routing_eng, p_osm);