From patchwork Mon Feb 15 21:45:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Schutt X-Patchwork-Id: 79471 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 o1FLifpc005503 for ; Mon, 15 Feb 2010 21:45:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932148Ab0BOVpn (ORCPT ); Mon, 15 Feb 2010 16:45:43 -0500 Received: from sentry-three.sandia.gov ([132.175.109.17]:34241 "EHLO sentry-three.sandia.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932129Ab0BOVpm (ORCPT ); Mon, 15 Feb 2010 16:45:42 -0500 X-WSS-ID: 0KXWKGA-08-RJ8-02 X-M-MSG: Received: from sentry.sandia.gov (mm03snlnto.sandia.gov [132.175.109.20]) by sentry-three.sandia.gov (Postfix) with ESMTP id 2D00C8C68F9; Mon, 15 Feb 2010 14:45:46 -0700 (MST) Received: from [134.253.165.160] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Mon, 15 Feb 2010 14:45:29 -0700 X-Server-Uuid: AF72F651-81B1-4134-BA8C-A8E1A4E620FF Received: from [134.253.4.20] (134.253.4.20) by smtps.sandia.gov ( 134.253.165.15) with Microsoft SMTP Server (TLS) id 8.1.375.2; Mon, 15 Feb 2010 14:45:29 -0700 Subject: Re: [PATCH 02/11] opensm: Allow the routing engine to influence SL2VL calculations. From: "Jim Schutt" To: "kliteyn@mellanox.co.il" cc: "linux-rdma@vger.kernel.org" , "sashak@voltaire.com" , "eitan@mellanox.co.il" In-Reply-To: <4B72DBBD.9020709@mellanox.co.il> References: <1258744509-11148-1-git-send-email-jaschut@sandia.gov> <1258744509-11148-3-git-send-email-jaschut@sandia.gov> <4B72DBBD.9020709@mellanox.co.il> Date: Mon, 15 Feb 2010 14:45:29 -0700 Message-ID: <1266270329.31472.112.camel@sale659.sandia.gov> MIME-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) X-TMWD-Spam-Summary: TS=20100215214529; ID=1; SEV=2.3.1; DFV=B2010021521; IFV=NA; AIF=B2010021521; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230342E34423739433037392E303137392C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAABADrBBQAAAAAAAAAAAAAAAAAAAH0= X-MMS-Spam-Filter-ID: B2010021521_5.03.0010 X-WSS-ID: 67671FF32EK633568-01-01 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, 15 Feb 2010 21:45:44 +0000 (UTC) diff --git a/opensm/opensm/osm_qos.c b/opensm/opensm/osm_qos.c index 0f0b24f..07f4836 100644 --- a/opensm/opensm/osm_qos.c +++ b/opensm/opensm/osm_qos.c @@ -197,6 +197,12 @@ static ib_api_status_t sl2vl_update(osm_sm_t * sm, osm_port_t * p_port, struct osm_routing_engine *re = sm->p_subn->p_osm->routing_engine_used; osm_physp_t *p_physp; + /* + * Do nothing unless the most recent routing attempt was successful. + */ + if (!re) + return IB_SUCCESS; + if (osm_node_get_type(osm_physp_get_node_ptr(p)) == IB_NODE_TYPE_SWITCH) { if (ib_port_info_get_vl_cap(&p->port_info) == 1) { /* Check port 0's capability mask */ > I think that it would be better > not to apply QoS configuration if unicast manager failed - just > restart the sweep. I think you are right. Something like this? diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c index 10d5e09..d8d4c9e 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1113,7 +1113,11 @@ static void do_sweep(osm_sm_t * sm) /* Re-program the switches fully */ sm->p_subn->ignore_existing_lfts = TRUE; - osm_ucast_mgr_process(&sm->ucast_mgr); + if (osm_ucast_mgr_process(&sm->ucast_mgr)) { + OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, + "REROUTE FAILED"); + return; + } osm_qos_setup(sm->p_subn->p_osm); /* Reset flag */ @@ -1272,12 +1276,14 @@ repeat_discovery: "LID ASSIGNMENT COMPLETE - STARTING SWITCH TABLE CONFIG"); /* - * Proceed with unicast forwarding table configuration. + * Proceed with unicast forwarding table configuration; repeat + * if unicast routing fails. */ if (!sm->ucast_mgr.cache_valid || osm_ucast_cache_process(&sm->ucast_mgr)) - osm_ucast_mgr_process(&sm->ucast_mgr); + if (osm_ucast_mgr_process(&sm->ucast_mgr)) + goto repeat_discovery; osm_qos_setup(sm->p_subn->p_osm); diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c index fbc9244..8ea2e52 100644 --- a/opensm/opensm/osm_ucast_mgr.c +++ b/opensm/opensm/osm_ucast_mgr.c @@ -955,6 +955,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; OSM_LOG_ENTER(p_mgr->p_log);