From patchwork Tue Feb 5 17:00:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 2098461 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 960B0DF23E for ; Tue, 5 Feb 2013 17:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754447Ab3BERAl (ORCPT ); Tue, 5 Feb 2013 12:00:41 -0500 Received: from mail-bk0-f52.google.com ([209.85.214.52]:65172 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753878Ab3BERAk (ORCPT ); Tue, 5 Feb 2013 12:00:40 -0500 Received: by mail-bk0-f52.google.com with SMTP id jk13so191310bkc.39 for ; Tue, 05 Feb 2013 09:00:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=x2AvRW4GXVx97demDG9/R/kUS/agyDcEUpb/XK7dWoQ=; b=HzGc8l8sizs9T9u2aGm7d/O7AgQ5VFZz6QBoZovRrRLSNlWAg38K475AJHPu8/AwAd enIZEvLVGQtMfvDwxgdNXxgc9KVkkO5ZXAQjERcWtLKVpbDQLi+IbMEZWUe+buHGrv7n l+WTSheKqL0P2BNaHEkeTZNqsuwpMfPAM/wjJoIyX7O+ONgLzYQqKjRNFiQmsoSxs+cb htP4f6GXSD/vNeH12Qa3vHIpV0YWFCG4fdnJ46+IgYVlda3atXqkcM26fVsJjtvrF2Y6 YUDDIR9AKBUUJCbbtV4GjzHjtfDBNwpz80FvG+y0Y8wNj++fezu2BpqGB1AuHH7b+GTD VaDw== X-Received: by 10.204.131.89 with SMTP id w25mr6697768bks.22.1360083638977; Tue, 05 Feb 2013 09:00:38 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPS id o9sm6843660bko.15.2013.02.05.09.00.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Feb 2013 09:00:38 -0800 (PST) From: Alex Netes To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock , Alex Netes Subject: [PATCH 4/6] opensm: Use IB_PATH_SELECTOR_EXACTLY rather than harded coded constant Date: Tue, 5 Feb 2013 19:00:25 +0200 Message-Id: <1360083625-15981-3-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1360083625-15981-1-git-send-email-alexne@mellanox.com> References: <1360083625-15981-1-git-send-email-alexne@mellanox.com> X-Gm-Message-State: ALoCoQkpM3CPLqQG1tsa55USOxaP3AVjtTSc4DMEci7k10qusnQCQvlIVyrXSJUtPcQHYUCCkZf2 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Hal Rosenstock Signed-off-by: Hal Rosenstock Signed-off-by: Alex Netes --- opensm/osm_prtn.c | 4 ++-- opensm/osm_sa_mcmember_record.c | 12 ++++++------ opensm/osm_sa_path_record.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/opensm/osm_prtn.c b/opensm/osm_prtn.c index b4ee965..ca7703d 100644 --- a/opensm/osm_prtn.c +++ b/opensm/osm_prtn.c @@ -253,10 +253,10 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn, mc_rec.mgid = *mgid; mc_rec.qkey = CL_HTON32(Q_Key); - mc_rec.mtu = mtu | (2 << 6); + mc_rec.mtu = mtu | (IB_PATH_SELECTOR_EXACTLY << 6); mc_rec.tclass = tclass; mc_rec.pkey = pkey; - mc_rec.rate = rate | (2 << 6); + mc_rec.rate = rate | (IB_PATH_SELECTOR_EXACTLY << 6); mc_rec.pkt_life = p_subn->opt.subnet_timeout; mc_rec.sl_flow_hop = ib_member_set_sl_flow_hop(sl, FlowLabel, hop_limit); /* Scope in MCMemberRecord (if present) needs to be consistent with MGID */ diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c index 6df1945..4a9ad71 100644 --- a/opensm/osm_sa_mcmember_record.c +++ b/opensm/osm_sa_mcmember_record.c @@ -207,11 +207,11 @@ static void mcmr_rcv_respond(IN osm_sa_t * sa, IN osm_madw_t * p_madw, /* Fill in the mtu, rate, and packet lifetime selectors */ item->resp.mc_rec.mtu &= 0x3f; - item->resp.mc_rec.mtu |= 2 << 6; /* exactly */ + item->resp.mc_rec.mtu |= IB_PATH_SELECTOR_EXACTLY << 6; item->resp.mc_rec.rate &= 0x3f; - item->resp.mc_rec.rate |= 2 << 6; /* exactly */ + item->resp.mc_rec.rate |= IB_PATH_SELECTOR_EXACTLY << 6; item->resp.mc_rec.pkt_life &= 0x3f; - item->resp.mc_rec.pkt_life |= 2 << 6; /* exactly */ + item->resp.mc_rec.pkt_life |= IB_PATH_SELECTOR_EXACTLY << 6; cl_qlist_init(&rec_list); cl_qlist_insert_tail(&rec_list, &item->list_item); @@ -862,11 +862,11 @@ static ib_api_status_t mcmr_rcv_create_new_mgrp(IN osm_sa_t * sa, /* the mcmember_record should have mtu_sel, rate_sel, and pkt_lifetime_sel = 2 */ (*pp_mgrp)->mcmember_rec.mtu &= 0x3f; - (*pp_mgrp)->mcmember_rec.mtu |= 2 << 6; /* exactly */ + (*pp_mgrp)->mcmember_rec.mtu |= IB_PATH_SELECTOR_EXACTLY << 6; (*pp_mgrp)->mcmember_rec.rate &= 0x3f; - (*pp_mgrp)->mcmember_rec.rate |= 2 << 6; /* exactly */ + (*pp_mgrp)->mcmember_rec.rate |= IB_PATH_SELECTOR_EXACTLY << 6; (*pp_mgrp)->mcmember_rec.pkt_life &= 0x3f; - (*pp_mgrp)->mcmember_rec.pkt_life |= 2 << 6; /* exactly */ + (*pp_mgrp)->mcmember_rec.pkt_life |= IB_PATH_SELECTOR_EXACTLY << 6; Exit: OSM_LOG_EXIT(sa->p_log); diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c index 08beb58..359cdf4 100644 --- a/opensm/osm_sa_path_record.c +++ b/opensm/osm_sa_path_record.c @@ -1666,9 +1666,9 @@ static void pr_process_multicast(osm_sa_t * sa, const ib_sa_mad_t *sa_mad, pr_item->resp.path_rec.pkey = mgrp->mcmember_rec.pkey; /* MTU, rate, and packet lifetime should be exactly */ - pr_item->resp.path_rec.mtu = (2 << 6) | mgrp->mcmember_rec.mtu; - pr_item->resp.path_rec.rate = (2 << 6) | mgrp->mcmember_rec.rate; - pr_item->resp.path_rec.pkt_life = (2 << 6) | mgrp->mcmember_rec.pkt_life; + pr_item->resp.path_rec.mtu = (IB_PATH_SELECTOR_EXACTLY << 6) | mgrp->mcmember_rec.mtu; + pr_item->resp.path_rec.rate = (IB_PATH_SELECTOR_EXACTLY << 6) | mgrp->mcmember_rec.rate; + pr_item->resp.path_rec.pkt_life = (IB_PATH_SELECTOR_EXACTLY << 6) | mgrp->mcmember_rec.pkt_life; /* SL, Hop Limit, and Flow Label */ ib_member_get_sl_flow_hop(mgrp->mcmember_rec.sl_flow_hop,