public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Cc: Linux RDMA <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] opensm/osm_qos_policy.c: fix SL for TS-precreated mcast group
Date: Mon, 6 Sep 2010 19:56:47 +0300	[thread overview]
Message-ID: <20100906165647.GF11502@me> (raw)
In-Reply-To: <4C836A74.3070004-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

On 13:01 Sun 05 Sep     , Yevgeny Kliteynik wrote:
> Assuming we still need to support TopSpin's non-compliant join
> compmask for IPoIB v4 multicast group ff12:401b:<pkey>::1

Wouldn't it be better to understand an use case of this group? It is
probably obsolete and such addition is not needed.

Sasha

> 
> The group is pre-defined and maintained as a well-known
> multicast group, hence it's SL needs to be fixed too in
> accordance with QoS policy configuration, same as for
> ff12:401b:<pkey>::ffff:ffff MGID.
> 
> Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> ---
>  opensm/opensm/osm_qos_policy.c |   35 +++++++++++++++++++++++++++++++++++
>  1 files changed, 35 insertions(+), 0 deletions(-)
> 
> 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);
> +	}
>  }
> 
>  /***************************************************
> -- 
> 1.6.2.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-09-06 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-05 10:01 [PATCH] opensm/osm_qos_policy.c: fix SL for TS-precreated mcast group Yevgeny Kliteynik
     [not found] ` <4C836A74.3070004-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-09-06 16:56   ` Sasha Khapyorsky [this message]
2010-09-06 20:57     ` Yevgeny Kliteynik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100906165647.GF11502@me \
    --to=sashak-smomgflxvozwk0htik3j/w@public.gmane.org \
    --cc=kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox