From patchwork Sun Sep 5 10:01:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 156481 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o859wmP6008857 for ; Sun, 5 Sep 2010 10:01:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754131Ab0IEKBi (ORCPT ); Sun, 5 Sep 2010 06:01:38 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:40133 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752231Ab0IEKBi (ORCPT ); Sun, 5 Sep 2010 06:01:38 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from kliteyn@mellanox.co.il) with SMTP; 5 Sep 2010 13:00:58 +0300 Received: from [10.4.1.29] (10.4.1.29) by mtlmail01.mtl.com (10.0.8.12) with Microsoft SMTP Server id 8.2.254.0; Sun, 5 Sep 2010 13:01:35 +0300 Message-ID: <4C836A74.3070004@mellanox.co.il> Date: Sun, 5 Sep 2010 13:01:24 +0300 From: Yevgeny Kliteynik Reply-To: kliteyn@dev.mellanox.co.il User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Sasha Khapyorsky , Linux RDMA Subject: [PATCH] opensm/osm_qos_policy.c: fix SL for TS-precreated mcast group 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 (demeter1.kernel.org [140.211.167.41]); Sun, 05 Sep 2010 10:01:39 +0000 (UTC) diff --git a/opensm/opensm/osm_qos_policy.c b/opensm/opensm/osm_qos_policy.c index ac49ab3..bdd27d0 100644 --- a/opensm/opensm/osm_qos_policy.c +++ b/opensm/opensm/osm_qos_policy.c @@ -764,6 +764,20 @@ static osm_qos_port_group_t *__qos_policy_get_port_group_by_name( /*************************************************** ***************************************************/ +/* + * HACK: Until TS resolves their noncompliant join compmask, + * we have to fix SL for this pre-defined the MGID too + */ +static const ib_gid_t osm_ts_ipoib_mgid = { + { + 0xff, /* multicast field */ + 0x12, /* non-permanent bit, link local scope */ + 0x40, 0x1b, /* IPv4 signature */ + 0xff, 0xff, /* 16 bits of P_Key (to be filled in) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 48 bits of zeros */ + 0x00, 0x00, 0x00, 0x01, /* 32 bit IPv4 broadcast address */ + }, +}; static void __qos_policy_validate_pkey( osm_qos_policy_t * p_qos_policy, @@ -773,6 +787,9 @@ static void __qos_policy_validate_pkey( uint8_t sl; uint32_t flow; uint8_t hop; + ib_gid_t mgid; + ib_net16_t pkey; + osm_mgrp_t * mgrp; char gid_str[INET6_ADDRSTRLEN]; if (!p_qos_policy || !p_qos_match_rule || !p_prtn) @@ -810,6 +827,24 @@ static void __qos_policy_validate_pkey( p_prtn->mgrp->mcmember_rec.sl_flow_hop = ib_member_set_sl_flow_hop(p_prtn->sl, flow, hop); } + + /* workaround for TS */ + /* FIXME: remove this upon TS fixes */ + mgid = osm_ts_ipoib_mgid; + pkey = p_prtn->pkey | cl_hton16(0x8000); + memcpy(&mgid.raw[4], &pkey, sizeof(pkey)); + mgrp = osm_get_mgrp_by_mgid(p_qos_policy->p_subn, &mgid); + if (mgrp) { + OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG, + "TS workaround: Updating MCGroup (MGID %s) SL to " + "match partition SL (%u)\n", + inet_ntop(AF_INET6, mgid.raw, gid_str, sizeof gid_str), + p_prtn->sl); + ib_member_get_sl_flow_hop(mgrp->mcmember_rec.sl_flow_hop, + &sl, &flow, &hop); + mgrp->mcmember_rec.sl_flow_hop = + ib_member_set_sl_flow_hop(p_prtn->sl, flow, hop); + } } /***************************************************