From patchwork Thu Oct 22 13:43:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 55351 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 n9MDjJDS019549 for ; Thu, 22 Oct 2009 13:45:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755989AbZJVNo5 (ORCPT ); Thu, 22 Oct 2009 09:44:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756022AbZJVNo5 (ORCPT ); Thu, 22 Oct 2009 09:44:57 -0400 Received: from qmta07.westchester.pa.mail.comcast.net ([76.96.62.64]:39955 "EHLO QMTA07.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755989AbZJVNo4 (ORCPT ); Thu, 22 Oct 2009 09:44:56 -0400 Received: from OMTA02.westchester.pa.mail.comcast.net ([76.96.62.19]) by QMTA07.westchester.pa.mail.comcast.net with comcast id voA81c0030QuhwU57pl1G1; Thu, 22 Oct 2009 13:45:01 +0000 Received: from hal.comcast.net ([75.69.247.31]) by OMTA02.westchester.pa.mail.comcast.net with comcast id vpl11c0020hNrtn3Npl10u; Thu, 22 Oct 2009 13:45:01 +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 n9MDhGnY028243; Thu, 22 Oct 2009 09:43:22 -0400 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id n9MDh0gK028211; Thu, 22 Oct 2009 09:43:00 -0400 Date: Thu, 22 Oct 2009 09:43:00 -0400 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCHv2] opensm/osm_vendor_ibumad: Use OSM_UMAD_MAX_AGENTS rather than UMAD_CA_MAX_AGENTS Message-ID: <20091022134300.GA28208@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/include/vendor/osm_vendor_ibumad.h b/opensm/include/vendor/osm_vendor_ibumad.h index e346a2e..f3a48e5 100644 --- a/opensm/include/vendor/osm_vendor_ibumad.h +++ b/opensm/include/vendor/osm_vendor_ibumad.h @@ -66,6 +66,8 @@ BEGIN_C_DECLS #define OSM_DEFAULT_RETRY_COUNT 3 #define OSM_UMAD_MAX_CAS 32 #define OSM_UMAD_MAX_PORTS_PER_CA 2 +#define OSM_UMAD_MAX_AGENTS 32 + /****s* OpenSM: Vendor UMAD/osm_ca_info_t * NAME * osm_ca_info_t @@ -154,7 +156,7 @@ typedef struct _osm_vendor { osm_ca_info_t *p_ca_info; uint32_t timeout; int max_retries; - osm_bind_handle_t agents[UMAD_CA_MAX_AGENTS]; + osm_bind_handle_t agents[OSM_UMAD_MAX_AGENTS]; char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN]; vendor_match_tbl_t mtbl; umad_port_t umad_port; diff --git a/opensm/libvendor/osm_vendor_ibumad.c b/opensm/libvendor/osm_vendor_ibumad.c index 8d3c680..b221335 100644 --- a/opensm/libvendor/osm_vendor_ibumad.c +++ b/opensm/libvendor/osm_vendor_ibumad.c @@ -288,7 +288,7 @@ static void *umad_receiver(void *p_ptr) } } - if (mad_agent >= UMAD_CA_MAX_AGENTS || + if (mad_agent >= OSM_UMAD_MAX_AGENTS || !(p_bind = p_vend->agents[mad_agent])) { OSM_LOG(p_ur->p_log, OSM_LOG_ERROR, "ERR 5407: " "invalid mad agent %d - dropping\n", mad_agent); @@ -738,7 +738,7 @@ static void osm_vendor_close_port(osm_vendor_t * const p_vend) } if (p_vend->umad_port_id >= 0) { - for (i = 0; i < UMAD_CA_MAX_AGENTS; i++) + for (i = 0; i < OSM_UMAD_MAX_AGENTS; i++) if (p_vend->agents[i]) umad_unregister(p_vend->umad_port_id, i); umad_close_port(p_vend->umad_port_id); @@ -862,7 +862,7 @@ osm_vendor_bind(IN osm_vendor_t * const p_vend, goto Exit; } - if (p_bind->agent_id >= UMAD_CA_MAX_AGENTS || + if (p_bind->agent_id >= OSM_UMAD_MAX_AGENTS || p_vend->agents[p_bind->agent_id]) { OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5427: " "bad agent id %u or duplicate agent for class %u vers %u\n", @@ -890,7 +890,7 @@ osm_vendor_bind(IN osm_vendor_t * const p_vend, goto Exit; } - if (p_bind->agent_id1 >= UMAD_CA_MAX_AGENTS || + if (p_bind->agent_id1 >= OSM_UMAD_MAX_AGENTS || p_vend->agents[p_bind->agent_id1]) { OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5429: " "bad agent id %u or duplicate agent for class 1 vers %u\n",