[ofa-general] Re: [PATCH 2/2] osm: QoS - support for MPR in qos policy

Sasha Khapyorsky sashak at voltaire.com
Thu Sep 6 05:16:51 PDT 2007


On 12:14 Thu 06 Sep     , Yevgeny Kliteynik wrote:
> Hi Sasha,
> 
> This patch adds osm_qos_policy_get_qos_level_by_mpr() wrapper function that
> basically does the same thing as the osm_qos_policy_get_qos_level_by_pr(),
> only for MultiPathRecord instead of PathRecord..
> 
> -- Yevgeny
> 
> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
> ---
>  opensm/include/opensm/osm_qos_policy.h |    8 ++++++++
>  opensm/opensm/osm_qos_policy.c         |   32 ++++++++++++++++++++++++++++++++
>  2 files changed, 40 insertions(+), 0 deletions(-)
> 
> diff --git a/opensm/include/opensm/osm_qos_policy.h b/opensm/include/opensm/osm_qos_policy.h
> index 11598be..0c220ee 100644
> --- a/opensm/include/opensm/osm_qos_policy.h
> +++ b/opensm/include/opensm/osm_qos_policy.h
> @@ -51,6 +51,7 @@
>  #include <complib/cl_list.h>
>  #include <opensm/osm_port.h>
>  #include <opensm/osm_sa_path_record.h>
> +#include <opensm/osm_sa_multipath_record.h>
> 
>  #define YYSTYPE char *
>  #define OSM_QOS_POLICY_MAX_PORTS_ON_SWITCH  128
> @@ -179,6 +180,13 @@ osm_qos_level_t * osm_qos_policy_get_qos_level_by_pr(
>  	IN const osm_physp_t * p_dest_physp,
>  	IN ib_net64_t comp_mask);
> 
> +osm_qos_level_t * osm_qos_policy_get_qos_level_by_mpr(
> +	IN const osm_qos_policy_t * p_qos_policy,
> +	IN const ib_multipath_rec_t * p_mpr,
> +	IN const osm_physp_t * p_src_physp,
> +	IN const osm_physp_t * p_dest_physp,
> +	IN ib_net64_t comp_mask);
> +
>  /***************************************************/
> 
>  int osm_qos_parse_policy_file(IN osm_subn_t * const p_subn);
> diff --git a/opensm/opensm/osm_qos_policy.c b/opensm/opensm/osm_qos_policy.c
> index 74628a5..a778bcb 100644
> --- a/opensm/opensm/osm_qos_policy.c
> +++ b/opensm/opensm/osm_qos_policy.c
> @@ -957,3 +957,35 @@ osm_qos_level_t * osm_qos_policy_get_qos_level_by_pr(
>  /***************************************************
>   ***************************************************/
> 
> +osm_qos_level_t * osm_qos_policy_get_qos_level_by_mpr(
> +	IN const osm_qos_policy_t * p_qos_policy,
> +	IN const ib_multipath_rec_t * p_mpr,
> +	IN const osm_physp_t * p_src_physp,
> +	IN const osm_physp_t * p_dest_physp,
> +	IN ib_net64_t comp_mask)
> +{
> +	uint8_t params_comp_mask = 0;
> +
> +	if (!p_qos_policy)
> +		return NULL;
> +
> +	if (comp_mask & IB_MPR_COMPMASK_QOS_CLASS)
> +		params_comp_mask |= QOS_PARAMS_COMPMASK_QOS_CLASS;
> +		
> +	if (comp_mask & IB_MPR_COMPMASK_SERVICEID_MSB &&
> +	    comp_mask & IB_MPR_COMPMASK_SERVICEID_LSB)
> +		params_comp_mask |= QOS_PARAMS_COMPMASK_SERVICEID;
> +
> +	if (comp_mask & IB_MPR_COMPMASK_PKEY)
> +		params_comp_mask |= QOS_PARAMS_COMPMASK_PKEY;
> +
> +	return __qos_policy_get_qos_level_by_params(
> +		p_qos_policy, p_src_physp, p_dest_physp,
> +		cl_ntoh64(ib_multipath_rec_service_id(p_mpr)),
> +		ib_multipath_rec_qos_class(p_mpr),
> +		cl_ntoh16(p_mpr->pkey), params_comp_mask);
> +}
> +
> +/***************************************************
> + ***************************************************/
> +
> -- 
> 1.5.1.4

This patch does not apply. The reason is trailing newline in
osm_qos_policy.c file (introduced in the previous patch). I'm using
'git-am --whitespace=strip', so this new line was stripped and the next
patch (this one) does not apply. It is better to not put empty new lines
at the end.

Sasha



More information about the general mailing list