From patchwork Thu Oct 3 15:03:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Domke X-Patchwork-Id: 2984331 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 80A30BFF0B for ; Thu, 3 Oct 2013 15:18:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0F0220145 for ; Thu, 3 Oct 2013 15:18:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF1662018E for ; Thu, 3 Oct 2013 15:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754401Ab3JCPSN (ORCPT ); Thu, 3 Oct 2013 11:18:13 -0400 Received: from mail02.nap.gsic.titech.ac.jp ([131.112.13.21]:51159 "HELO mail02.nap.gsic.titech.ac.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753713Ab3JCPSN (ORCPT ); Thu, 3 Oct 2013 11:18:13 -0400 Received: from 131.112.13.37 by mail02.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(7815:0:AUTH_RELAY) (envelope-from ); Fri, 04 Oct 2013 00:03:21 +0900 (JST) Received: from [131.112.13.21] (mail02.nap.gsic.titech.ac.jp) by drweb2.nap.gsic.titech.ac.jp (Dr.Web MailD 6.0.2.0) with SMTP id 033CC138; Fri, 04 Oct 2013 00:03:20 Received: from 131.112.29.200 by mail02.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(7810:0:AUTH_LOGIN) (envelope-from ); Fri, 04 Oct 2013 00:03:18 +0900 (JST) From: Jens Domke To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock , Torsten Hoefler Subject: [PATCH 1/5] OpenSM: dfsssp - send multicast forwarding tables to switches Date: Fri, 4 Oct 2013 00:03:05 +0900 Message-Id: <1380812586-1583-1-git-send-email-domke.j.aa@m.titech.ac.jp> X-Mailer: git-send-email 1.7.1 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Issue: dfsssp calculates mcast forwarding tables but doesn't distribute them to the switches, because is_mc_member/num_of_mcm for each switch was reset to 0 in osm_mcast_mgr.c. dfsssp relies on this data to figure out with switch is involved in the mcast group. Fix: recalculate is_mc_member/num_of_mcm similar to the code of create_mgrp_switch_map(...) in osm_mcast_mgr.c right before the update_mcft function and reset to 0 afterwards. Signed-off-by: Jens Domke --- opensm/osm_ucast_dfsssp.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c index ef7de59..9c34795 100644 --- a/opensm/osm_ucast_dfsssp.c +++ b/opensm/osm_ucast_dfsssp.c @@ -1544,6 +1544,43 @@ static int update_lft(osm_ucast_mgr_t * p_mgr, vertex_t * adj_list, return 0; } +/* the function updates the multicast group membership information + similar to create_mgrp_switch_map (osm_mcast_mgr.c) + => with it we can identify if a switch needs to be processed + or not in update_mcft +*/ +static void update_mgrp_membership(cl_qlist_t * port_list) +{ + osm_mcast_work_obj_t *wobj = NULL; + osm_port_t *port = NULL; + osm_switch_t *sw = NULL; + cl_list_item_t *i = NULL; + + for (i = cl_qlist_head(port_list); i != cl_qlist_end(port_list); + i = cl_qlist_next(i)) { + wobj = cl_item_obj(i, wobj, list_item); + port = wobj->p_port; + if (port->p_node->sw) { + sw = port->p_node->sw; + sw->is_mc_member = 1; + } else { + sw = port->p_physp->p_remote_physp->p_node->sw; + sw->num_of_mcm++; + } + } +} + +/* reset is_mc_member and num_of_mcm for future computations */ +static void reset_mgrp_membership(vertex_t * adj_list, uint32_t adj_list_size) +{ + uint32_t i = 0; + + for (i = 1; i < adj_list_size; i++) { + adj_list[i].sw->is_mc_member = 0; + adj_list[i].sw->num_of_mcm = 0; + } +} + /* update the multicast forwarding tables of all switches with the informations from the previous dijsktra step for the current mlid */ @@ -2386,6 +2423,11 @@ static ib_api_status_t dfsssp_do_mcast_routing(void * context, goto Exit; } + /* set mcast group membership again for update_mcft + (unfortunately: osm_mcast_mgr_find_root_switch resets it) + */ + update_mgrp_membership(&mcastgrp_port_list); + /* update the mcast forwarding tables of the switches */ err = update_mcft(sm, adj_list, adj_list_size, mbox->mlid, &mcastgrp_port_map, root_sw); @@ -2398,6 +2440,7 @@ static ib_api_status_t dfsssp_do_mcast_routing(void * context, } Exit: + reset_mgrp_membership(adj_list, adj_list_size); osm_mcast_drop_port_list(&mcastgrp_port_list); OSM_LOG_EXIT(sm->p_log); return status;