From patchwork Thu Feb 4 18:12:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eli Dorfman (Voltaire)" X-Patchwork-Id: 77170 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 o14I0uAm027911 for ; Thu, 4 Feb 2010 18:00:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756774Ab0BDSA2 (ORCPT ); Thu, 4 Feb 2010 13:00:28 -0500 Received: from fwil.voltaire.com ([193.47.165.2]:20309 "EHLO exil.voltaire.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756759Ab0BDSA2 (ORCPT ); Thu, 4 Feb 2010 13:00:28 -0500 Received: from [172.25.1.69] ([172.25.1.69]) by exil.voltaire.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 4 Feb 2010 20:00:25 +0200 Message-ID: <4B6B0E04.808@gmail.com> Date: Thu, 04 Feb 2010 20:12:20 +0200 From: "Eli Dorfman (Voltaire)" User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: Sasha Khapyorsky CC: linux-rdma , Vladimir Koushnir Subject: [PATCH] Delete port only after GID OUT trap was sent X-OriginalArrivalTime: 04 Feb 2010 18:00:25.0301 (UTC) FILETIME=[ED5D7050:01CAA5C3] 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]); Thu, 04 Feb 2010 18:00:56 +0000 (UTC) diff --git a/opensm/opensm/osm_drop_mgr.c b/opensm/opensm/osm_drop_mgr.c index 879e21f..111582e 100644 --- a/opensm/opensm/osm_drop_mgr.c +++ b/opensm/opensm/osm_drop_mgr.c @@ -180,6 +180,33 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN osm_port_t * p_port) goto Exit; } + /* issue a notice - trap 65 */ + /* details of the notice */ + notice.generic_type = 0x83; /* is generic subn mgt type */ + ib_notice_set_prod_type_ho(¬ice, 4); /* A class manager generator */ + /* endport ceases to be reachable */ + notice.g_or_v.generic.trap_num = CL_HTON16(65); + /* The sm_base_lid is saved in network order already. */ + notice.issuer_lid = sm->p_subn->sm_base_lid; + /* following C14-72.1.2 and table 119 p725 */ + /* we need to provide the GID */ + port_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix; + port_gid.unicast.interface_id = port_guid; + memcpy(&(notice.data_details.ntc_64_67.gid), + &(port_gid), sizeof(ib_gid_t)); + + /* According to page 653 - the issuer gid in this case of trap + is the SM gid, since the SM is the initiator of this trap. */ + notice.issuer_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix; + notice.issuer_gid.unicast.interface_id = sm->p_subn->sm_port_guid; + + status = osm_report_notice(sm->p_log, sm->p_subn, ¬ice); + if (status != IB_SUCCESS) { + OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0103: " + "Error sending trap reports (%s)\n", + ib_get_err_str(status)); + } + p_sm_guid_tbl = &sm->p_subn->sm_guid_tbl; p_sm = (osm_remote_sm_t *) cl_qmap_remove(p_sm_guid_tbl, port_guid); if (p_sm != (osm_remote_sm_t *) cl_qmap_end(p_sm_guid_tbl)) { @@ -217,35 +244,6 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN osm_port_t * p_port) osm_port_delete(&p_port); - /* issue a notice - trap 65 */ - - /* details of the notice */ - notice.generic_type = 0x83; /* is generic subn mgt type */ - ib_notice_set_prod_type_ho(¬ice, 4); /* A class manager generator */ - /* endport ceases to be reachable */ - notice.g_or_v.generic.trap_num = CL_HTON16(65); - /* The sm_base_lid is saved in network order already. */ - notice.issuer_lid = sm->p_subn->sm_base_lid; - /* following C14-72.1.2 and table 119 p725 */ - /* we need to provide the GID */ - port_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix; - port_gid.unicast.interface_id = port_guid; - memcpy(&(notice.data_details.ntc_64_67.gid), - &(port_gid), sizeof(ib_gid_t)); - - /* According to page 653 - the issuer gid in this case of trap - is the SM gid, since the SM is the initiator of this trap. */ - notice.issuer_gid.unicast.prefix = sm->p_subn->opt.subnet_prefix; - notice.issuer_gid.unicast.interface_id = sm->p_subn->sm_port_guid; - - status = osm_report_notice(sm->p_log, sm->p_subn, ¬ice); - if (status != IB_SUCCESS) { - OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0103: " - "Error sending trap reports (%s)\n", - ib_get_err_str(status)); - goto Exit; - } - OSM_LOG(sm->p_log, OSM_LOG_INFO, "Removed port with GUID:0x%016" PRIx64 " LID range [%u, %u] of node:%s\n",