From patchwork Mon Oct 19 18:33:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 54812 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9JIYqFW008171 for ; Mon, 19 Oct 2009 18:34:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751191AbZJSSeq (ORCPT ); Mon, 19 Oct 2009 14:34:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755050AbZJSSeq (ORCPT ); Mon, 19 Oct 2009 14:34:46 -0400 Received: from qmta13.westchester.pa.mail.comcast.net ([76.96.59.243]:35401 "EHLO QMTA13.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbZJSSep (ORCPT ); Mon, 19 Oct 2009 14:34:45 -0400 Received: from OMTA13.westchester.pa.mail.comcast.net ([76.96.62.52]) by QMTA13.westchester.pa.mail.comcast.net with comcast id ubEf1c00A17dt5G5DiaqGN; Mon, 19 Oct 2009 18:34:50 +0000 Received: from hal.comcast.net ([75.69.247.31]) by OMTA13.westchester.pa.mail.comcast.net with comcast id uiao1c00T0hNrtn3ZiaoL7; Mon, 19 Oct 2009 18:34:48 +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 n9JIXw6d028961; Mon, 19 Oct 2009 14:34:03 -0400 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id n9JIXhLE028930; Mon, 19 Oct 2009 14:33:43 -0400 Date: Mon, 19 Oct 2009 14:33:42 -0400 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm/osm_vendor_ibumad.c: Add environment variable to change max retries Message-ID: <20091019183342.GA28926@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 diff --git a/opensm/libvendor/osm_vendor_ibumad.c b/opensm/libvendor/osm_vendor_ibumad.c index 8d3c680..01250fb 100644 --- a/opensm/libvendor/osm_vendor_ibumad.c +++ b/opensm/libvendor/osm_vendor_ibumad.c @@ -446,6 +446,17 @@ osm_vendor_init(IN osm_vendor_t * const p_vend, p_vend->p_log = p_log; p_vend->timeout = timeout; p_vend->max_retries = OSM_DEFAULT_RETRY_COUNT; + + if ((max = getenv("OSM_UMAD_MAX_RETRIES")) != NULL) { + int tmp = strtol(max, NULL, 0); + if (tmp > 0) + p_vend->max_retries = tmp; + else + OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "Error:" + "OSM_UMAD_MAX_RETRIES=%d is invalid\n", + tmp); + } + pthread_mutex_init(&p_vend->cb_mutex, NULL); pthread_mutex_init(&p_vend->match_tbl_mutex, NULL); p_vend->umad_port_id = -1; @@ -476,12 +487,13 @@ osm_vendor_init(IN osm_vendor_t * const p_vend, p_vend->mtbl.max = tmp; else OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "Error:" - "OSM_UMAD_MAX_PENDING=%d is invalid", + "OSM_UMAD_MAX_PENDING=%d is invalid\n", tmp); } - OSM_LOG(p_vend->p_log, OSM_LOG_INFO, "%d pending umads specified\n", - p_vend->mtbl.max); + OSM_LOG(p_vend->p_log, OSM_LOG_INFO, + "%d max retries %d max pending umads specified\n", + p_vend->max_retries, p_vend->mtbl.max); p_vend->mtbl.tbl = calloc(p_vend->mtbl.max, sizeof(*(p_vend->mtbl.tbl))); if (!p_vend->mtbl.tbl) {