From patchwork Wed Sep 10 16:44:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 4879221 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F0E38C0338 for ; Wed, 10 Sep 2014 16:44:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 334A7201B9 for ; Wed, 10 Sep 2014 16:44:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C12362017A for ; Wed, 10 Sep 2014 16:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751744AbaIJQo3 (ORCPT ); Wed, 10 Sep 2014 12:44:29 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:51076 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbaIJQo3 (ORCPT ); Wed, 10 Sep 2014 12:44:29 -0400 Received: by mail-wi0-f178.google.com with SMTP id hi2so3362161wib.5 for ; Wed, 10 Sep 2014 09:44:27 -0700 (PDT) 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=GsajWfd5xCsQKYaOb2ABGpcj/WC1fFMNmQEBNIh6olU=; b=GRoechshjWtoj8MhpbC2kAOp58CafS1B1/C2rOm7AabEnBGH195e/h90C5h4hZriSv 4xfU1haC0iBnjiHohK7zLfmsLMMqkGLbDaBCCmCXDgsvfX6OSvacqJwpWQcpnhG9y2AQ njkk6Lpp5c7KFnbyMppKkzoNElnbik+ieIe7w7B8vRT8ZFs3nGoXvVtb+MC+rJ4ETzAS ci96G8zplmYFvWTI2fEyBr5iUOUCPMaR9vV5k9pBguYxvgkeW/ZP64YabceApay7x03h 8gnwUavwbXDTm5fc6OysSHteSFi3uWH885KdYgCUgB2l1Slq440tqGijMStnmw0zhbeZ An4w== X-Gm-Message-State: ALoCoQkJPj3yrexvAYAxDWfa8NHRpmPpXNHiaJqryWk+ilwOuKqaVlLJfhS9MXijczPEdd1+kvLV X-Received: by 10.194.21.234 with SMTP id y10mr40802738wje.42.1410367467873; Wed, 10 Sep 2014 09:44:27 -0700 (PDT) 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 ec2sm3026469wib.19.2014.09.10.09.44.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Sep 2014 09:44:27 -0700 (PDT) Message-ID: <54107FD3.5030801@dev.mellanox.co.il> Date: Wed, 10 Sep 2014 12:44:03 -0400 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] osm_state_mgr.c: Avoid ucast cache invalidation due to errors during initialization Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Signed-off-by: Daniel Klein --- opensm/osm_state_mgr.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c index 106159d..42d13bb 100644 --- a/opensm/osm_state_mgr.c +++ b/opensm/osm_state_mgr.c @@ -1228,12 +1228,11 @@ static void do_sweep(osm_sm_t * sm) } /* - * Unicast cache should be invalidated if there were errors - * during initialization or if subnet re-route is requested. + * Unicast cache should be invalidated when subnet re-route is + * requested, and when OpenSM comes out of standby state. */ if (sm->p_subn->opt.use_ucast_cache && - (sm->p_subn->subnet_initialization_error || - sm->p_subn->force_reroute || sm->p_subn->coming_out_of_standby)) + (sm->p_subn->force_reroute || sm->p_subn->coming_out_of_standby)) osm_ucast_cache_invalidate(&sm->ucast_mgr); /* @@ -1458,9 +1457,12 @@ repeat_discovery: */ if (!sm->ucast_mgr.cache_valid || - osm_ucast_cache_process(&sm->ucast_mgr)) - if (osm_ucast_mgr_process(&sm->ucast_mgr)) + osm_ucast_cache_process(&sm->ucast_mgr)) { + if (osm_ucast_mgr_process(&sm->ucast_mgr)) { + osm_ucast_cache_invalidate(&sm->ucast_mgr); return; + } + } osm_qos_setup(sm->p_subn->p_osm);