From patchwork Fri Jan 3 13:40:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3431401 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 308A59F2E9 for ; Fri, 3 Jan 2014 13:40:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED58420149 for ; Fri, 3 Jan 2014 13:40:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 891832013D for ; Fri, 3 Jan 2014 13:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751649AbaACNkz (ORCPT ); Fri, 3 Jan 2014 08:40:55 -0500 Received: from mail-ee0-f52.google.com ([74.125.83.52]:54695 "EHLO mail-ee0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbaACNky (ORCPT ); Fri, 3 Jan 2014 08:40:54 -0500 Received: by mail-ee0-f52.google.com with SMTP id d17so6737882eek.39 for ; Fri, 03 Jan 2014 05:40:53 -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=97rSTVk9nj6kpWPWRM/5POjWy33x0qJUSig9v5wq8W8=; b=V2ySE2a0unX8M7uNoCQhf7nhoaXbtA0STK/n0R9V5EsZDVAQCLtKRSd79Scn8JMwKm yxgrRfhpmfCx1PJVsHVAf1u+vi1xqa+FKIruhtVCUcBIw5LVoiio0Zyxkh1RFeE2o9sE eQQ2t5tAmHZUxteuBXWRLOnWARSGF8vL3IeIBtpUq4Vp/QfpC/AtFQNxBVdUTWjlAHX6 0u4Q8B/ZRDmK8obD+6PCfBYaAtG5GcQonqNg19z8r59AiJMlHXQRFPxZFKq5Wt0Ameqj qsPH/YktXgU1C+DL9AGNS3jbDF5ZtLApFuYTtVHX+0I3OAK0TACyBWSV3bxXxEmiZ8Rv 0YGg== X-Gm-Message-State: ALoCoQlB+frNaprZ9qO2L6uJkpg53t6NyFtDQSkFq7eupu8ogx/1W41bgQagmpFPpC7RRgpfs1zZ X-Received: by 10.15.54.72 with SMTP id s48mr73405791eew.3.1388756453384; Fri, 03 Jan 2014 05:40:53 -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 e3sm145066862eeg.11.2014.01.03.05.40.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Jan 2014 05:40:52 -0800 (PST) Message-ID: <52C6BDE0.1040602@dev.mellanox.co.il> Date: Fri, 03 Jan 2014 08:40:48 -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: Ilya Nelkenbaum Subject: [PATCH opensm] Add client_rereg flag to Port Info context Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.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: Ilya Nelkenbaum In case of ports that don't set client_rereg in response the port info context will contain additional client_rereg flag that will indicate that it was already sent and therefore it won't be sent in future. Signed-off-by: Ilya Nelkenbaum Signed-off-by: Hal Rosenstock --- include/opensm/osm_madw.h | 1 + opensm/osm_lid_mgr.c | 5 ++++- opensm/osm_link_mgr.c | 1 + opensm/osm_node_info_rcv.c | 1 + opensm/osm_pkey_mgr.c | 1 + opensm/osm_port_info_rcv.c | 3 ++- opensm/osm_state_mgr.c | 1 + opensm/osm_trap_rcv.c | 1 + 8 files changed, 12 insertions(+), 2 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/include/opensm/osm_madw.h b/include/opensm/osm_madw.h index fd6ba7f..9fb7d5d 100644 --- a/include/opensm/osm_madw.h +++ b/include/opensm/osm_madw.h @@ -182,6 +182,7 @@ typedef struct osm_pi_context { boolean_t set_method; boolean_t light_sweep; boolean_t active_transition; + boolean_t client_rereg; } osm_pi_context_t; /*********/ diff --git a/opensm/osm_lid_mgr.c b/opensm/osm_lid_mgr.c index 3ba1a79..757a9e3 100644 --- a/opensm/osm_lid_mgr.c +++ b/opensm/osm_lid_mgr.c @@ -1043,9 +1043,12 @@ static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr, "Setting client rereg on %s, port %d\n", p_port->p_node->print_desc, p_port->p_physp->port_num); ib_port_info_set_client_rereg(p_pi, 1); + context.pi_context.client_rereg = TRUE; send_set = TRUE; - } else + } else { ib_port_info_set_client_rereg(p_pi, 0); + context.pi_context.client_rereg = FALSE; + } /* We need to send the PortInfo Set request with the new sm_lid in the following cases: diff --git a/opensm/osm_link_mgr.c b/opensm/osm_link_mgr.c index 6bcfbf6..ed19d75 100644 --- a/opensm/osm_link_mgr.c +++ b/opensm/osm_link_mgr.c @@ -451,6 +451,7 @@ Send: context.pi_context.port_guid = osm_physp_get_port_guid(p_physp); context.pi_context.set_method = TRUE; context.pi_context.light_sweep = FALSE; + context.pi_context.client_rereg = FALSE; /* We need to send the PortInfoSet request with the new sm_lid in the following cases: diff --git a/opensm/osm_node_info_rcv.c b/opensm/osm_node_info_rcv.c index 786bcde..4242924 100644 --- a/opensm/osm_node_info_rcv.c +++ b/opensm/osm_node_info_rcv.c @@ -307,6 +307,7 @@ static void ni_rcv_get_port_info(IN osm_sm_t * sm, IN osm_node_t * node, context.pi_context.set_method = FALSE; context.pi_context.light_sweep = FALSE; context.pi_context.active_transition = FALSE; + context.pi_context.client_rereg = FALSE; for (; port < num_ports; port++) { status = osm_req_get(sm, osm_physp_get_dr_path_ptr(physp), diff --git a/opensm/osm_pkey_mgr.c b/opensm/osm_pkey_mgr.c index d9f2d94..0809d1e 100644 --- a/opensm/osm_pkey_mgr.c +++ b/opensm/osm_pkey_mgr.c @@ -253,6 +253,7 @@ pkey_mgr_enforce_partition(IN osm_log_t * p_log, osm_sm_t * sm, context.pi_context.set_method = TRUE; context.pi_context.light_sweep = FALSE; context.pi_context.active_transition = FALSE; + context.pi_context.client_rereg = FALSE; status = osm_req_set(sm, osm_physp_get_dr_path_ptr(p_physp), payload, sizeof(payload), diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c index a8ac75b..5c12989 100644 --- a/opensm/osm_port_info_rcv.c +++ b/opensm/osm_port_info_rcv.c @@ -566,10 +566,12 @@ void osm_pi_rcv_process(IN void *context, IN void *data) /* On receipt of client reregister, clear the reregister bit so reregistering won't be sent again and again */ - if (p_context->set_method && ib_port_info_get_client_rereg(p_pi)) { + if (p_context->set_method && + (ib_port_info_get_client_rereg(p_pi) || p_context->client_rereg)) { OSM_LOG(sm->p_log, OSM_LOG_DEBUG, "Client reregister received on response\n"); ib_port_info_set_client_rereg(p_pi, 0); + p_context->client_rereg = FALSE; } /* diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c index 85b233d..c86627d 100644 --- a/opensm/osm_state_mgr.c +++ b/opensm/osm_state_mgr.c @@ -186,6 +186,7 @@ static void state_mgr_get_remote_port_info(IN osm_sm_t * sm, mad_context.pi_context.set_method = FALSE; mad_context.pi_context.light_sweep = TRUE; mad_context.pi_context.active_transition = FALSE; + mad_context.pi_context.client_rereg = FALSE; /* note that with some negative logic - if the query failed it means * that there is no point in going to heavy sweep */ diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c index c2c0ed2..663fa35 100644 --- a/opensm/osm_trap_rcv.c +++ b/opensm/osm_trap_rcv.c @@ -241,6 +241,7 @@ static int disable_port(osm_sm_t *sm, osm_physp_t *p) context.pi_context.set_method = TRUE; context.pi_context.light_sweep = FALSE; context.pi_context.active_transition = FALSE; + context.pi_context.client_rereg = FALSE; if (osm_node_get_type(p->p_node) == IB_NODE_TYPE_SWITCH && osm_physp_get_port_num(p) != 0) { physp0 = osm_node_get_physp_ptr(p->p_node, 0);