From patchwork Tue Nov 5 18:05:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3143201 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 B4A2D9F3C4 for ; Tue, 5 Nov 2013 18:05:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 818C920588 for ; Tue, 5 Nov 2013 18:05:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1B9B20586 for ; Tue, 5 Nov 2013 18:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532Ab3KESFd (ORCPT ); Tue, 5 Nov 2013 13:05:33 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:59728 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925Ab3KESFd (ORCPT ); Tue, 5 Nov 2013 13:05:33 -0500 Received: by mail-ee0-f41.google.com with SMTP id e53so2011510eek.14 for ; Tue, 05 Nov 2013 10:05:32 -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=tU4blvlZPi6sMwa0imx7iSYxUrKolu1I8nU6I8iPzLc=; b=J86TcK9SaBfZ80ChUP6iNLcDE+It4YiPEf0jvOhPiGrjbTZ9gIyTxx6upQon2tHoxV P/WVle7vfHzO0YwZvaImvQx50aJ+QA25JOfv2awuhuWOMIA+GHPUQADWhl3sy3xIyr5v mkBq/EmRa/Gd2m5KxIdzRR9B636Of556OHzyYfV7cg3Rc0i9wTAQs0M04XyiiWeyTehz 1Jmgxf+6xNuPo4OYLAcMENwjD0ErpAxo/Fqj9GY21OfblcxIqpiv4ERi+7qqoylflnPy Yr5RUp+E0zCxW5T3ISB4RznYYc4dSVzyO3I++HL2JCkVPZQ3Z+06FVd2JeIYpiY0/xk0 f7sg== X-Gm-Message-State: ALoCoQlqiN3Nf+ujFxBaLVJV1idDO1KlExJ0NZai5OEklTjOvgSRroN/CTbdt4eqWxeSdjMibIjA X-Received: by 10.15.23.1 with SMTP id g1mr11791954eeu.63.1383674730810; Tue, 05 Nov 2013 10:05:30 -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 k7sm63202789eeg.13.2013.11.05.10.05.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 10:05:30 -0800 (PST) Message-ID: <52793368.3090908@dev.mellanox.co.il> Date: Tue, 05 Nov 2013 13:05:28 -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: Dan Ben-Yosef Subject: [PATCH opensm] Fix dropping node after setPkey mad 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, 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: Dan Ben Yosef Need to check pkey received counter flag only after get mads and not set. Signed-off-by: Dan Ben Yosef --- include/opensm/osm_port.h | 3 ++- opensm/osm_pkey_rcv.c | 3 ++- opensm/osm_port.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/opensm/osm_port.h b/include/opensm/osm_port.h index a1efc97..f4b7efd 100644 --- a/include/opensm/osm_port.h +++ b/include/opensm/osm_port.h @@ -558,7 +558,8 @@ void osm_physp_set_port_info(IN osm_physp_t * p_physp, void osm_physp_set_pkey_tbl(IN osm_log_t * p_log, IN const osm_subn_t * p_subn, IN osm_physp_t * p_physp, IN ib_pkey_table_t * p_pkey_tbl, - IN uint16_t block_num); + IN uint16_t block_num, + IN boolean_t is_set); /* * PARAMETERS * p_log diff --git a/opensm/osm_pkey_rcv.c b/opensm/osm_pkey_rcv.c index 81da39c..6650766 100644 --- a/opensm/osm_pkey_rcv.c +++ b/opensm/osm_pkey_rcv.c @@ -186,7 +186,8 @@ void osm_pkey_rcv_process(IN void *context, IN void *data) p_pkey_tbl, FILE_ID, OSM_LOG_DEBUG); osm_physp_set_pkey_tbl(sm->p_log, sm->p_subn, - p_physp, p_pkey_tbl, block_num); + p_physp, p_pkey_tbl, block_num, + p_context->set_method); Exit: cl_plock_release(sm->p_lock); diff --git a/opensm/osm_port.c b/opensm/osm_port.c index 9dd7992..46152c5 100644 --- a/opensm/osm_port.c +++ b/opensm/osm_port.c @@ -646,7 +646,8 @@ boolean_t osm_link_is_healthy(IN const osm_physp_t * p_physp) void osm_physp_set_pkey_tbl(IN osm_log_t * p_log, IN const osm_subn_t * p_subn, IN osm_physp_t * p_physp, IN ib_pkey_table_t * p_pkey_tbl, - IN uint16_t block_num) + IN uint16_t block_num, + IN boolean_t is_set) { uint16_t max_blocks; @@ -687,7 +688,8 @@ void osm_physp_set_pkey_tbl(IN osm_log_t * p_log, IN const osm_subn_t * p_subn, } /* decrement block received counter */ - p_physp->pkeys.rcv_blocks_cnt--; + if(!is_set) + p_physp->pkeys.rcv_blocks_cnt--; osm_pkey_tbl_set(&p_physp->pkeys, block_num, p_pkey_tbl, p_subn->opt.allow_both_pkeys); }