From patchwork Wed Dec 10 17:29:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 5471091 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3E4CE9F1CD for ; Wed, 10 Dec 2014 17:29:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 59B442017D for ; Wed, 10 Dec 2014 17:29:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD35F200CF for ; Wed, 10 Dec 2014 17:29:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932397AbaLJR3W (ORCPT ); Wed, 10 Dec 2014 12:29:22 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:32989 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932268AbaLJR3W (ORCPT ); Wed, 10 Dec 2014 12:29:22 -0500 Received: by mail-wi0-f171.google.com with SMTP id bs8so11966147wib.16 for ; Wed, 10 Dec 2014 09:29:21 -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=+F49XWWosVuP/A/tmWyk23YPw+F9XZK3tzT9qr4UM6w=; b=EgdlfDwA6JYxb4kVrartwMb0QYd+TW9ZSD0kU7xnBO4qIxR5crbxLQueQzSSdVIFJX BlmMSvZ4/oeWvg1zMBEqGcKnlUO7ws7UwzZFbA0qmaYqLtVHifr3X9YB7ArT9hY7kglm MUbLxFmucTmANX7JskRtt4zh1N9+jEq0NdCovDocYzR8p/woYohvUP0wf7Mj3Os1Az+c t+2zau4ptQEmp3VT3OH1mSroJvp0pFfzZuYsbIpChX632Gcrgh2eEDgFjpyAoj/nA/RS aGBWrBbud4BxSbjOnhzqFmVxPAPXffjJiepsXSsVc1AxtBWkbwWTXKHrcc8Bg+ZoMRvc DVDw== X-Gm-Message-State: ALoCoQl9Qm+jaJIN3wpsMMZJOrXcE0s5RE7+c9KaKq1dC3Otn71d0a2sjbhuNQRuHE3FUQQb5soh X-Received: by 10.194.79.199 with SMTP id l7mr8747310wjx.136.1418232561207; Wed, 10 Dec 2014 09:29:21 -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 u9sm6668600wjy.37.2014.12.10.09.29.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Dec 2014 09:29:20 -0800 (PST) Message-ID: <548882ED.5000400@dev.mellanox.co.il> Date: Wed, 10 Dec 2014 12:29:17 -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 , "Chu, Al" , "Susan Coulter (skc@lanl.gov)" , Florent Parent , Ira Weiny Subject: [PATCH opensm] osm_perfmgr.c: Reset physp_discovered before discovery 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 Bug description: When PerfMgr starts discovery, it resets the discovery_count of ports and node, but it doesn't reset the physp_discoved buffers. As a result, the drop manager frees osm_port_t and osm_physp_t objects of nodes without removing the nodes themselves. On the next discovery process, when OpenSM receives responses for NodeInfo from a switch, it treats it as a NodeInfo from an existing node and assumes that osm_physp_t objects of the switch exists and tries to access them. This change adds code that clears the physp_discoverd buffers of all nodes at the beginning of the discovery process in PerfMgr. Signed-off-by: Daniel Klein Signed-off-by: Hal Rosenstock --- opensm/osm_perfmgr.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c index 4ab654b..993fdb7 100644 --- a/opensm/osm_perfmgr.c +++ b/opensm/osm_perfmgr.c @@ -985,6 +985,9 @@ static void reset_node_count(cl_map_item_t * p_map_item, void *cxt) { osm_node_t *p_node = (osm_node_t *) p_map_item; p_node->discovery_count = 0; + + memset(p_node->physp_discovered, 0, + sizeof(uint8_t) * p_node->physp_tbl_size); } static void reset_port_count(cl_map_item_t * p_map_item, void *cxt)