Re: [PATCH] opensm/osm_qos.c: merge SL2VL mapping capability check

Hal Rosenstock
2010-01-07T13:38:46Z

On Mon, Jan 4, 2010 at 12:01 PM, Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote:
>
> The IBA 1.2.1 states (Vol.1, p.840, Table XX,

Table 146 PortInfo

> explanation (b)) that
> SL2VL mapping capability for switch external ports must be indicated on
> its port 0 PortInfo:CapMask.

That footnote was added at IBA 1.2.1.

> So it lets us to unify this capability check over all types of IB nodes.

Change appears to be for switches to always rely on this bit rather
than only when VLCap is 1. I wonder if there are any switches with
VLCap > 1 that don't set the IsSLMappingSupported CapabilityMask bit.
There shouldn't be (at least if they are IBA 1.2.1 compliant) but are
you sure about this ?

-- Hal

> Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
> ---
>  opensm/opensm/osm_qos.c |   22 +++++++---------------
>  1 files changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/opensm/opensm/osm_qos.c b/opensm/opensm/osm_qos.c
> index 08f9a60..afeaa11 100644
> --- a/opensm/opensm/osm_qos.c
> +++ b/opensm/opensm/osm_qos.c
> @@ -194,23 +194,15 @@ static ib_api_status_t sl2vl_update(osm_sm_t * sm, osm_port_t * p_port,
>  {
>        ib_api_status_t status;
>        uint8_t i, num_ports;
> -       osm_physp_t *p_physp;
> +       ib_port_info_t *pi = &p_port->p_physp->port_info;
> +
> +       if (!(pi->capability_mask & IB_PORT_CAP_HAS_SL_MAP))
> +               return IB_SUCCESS;
>
> -       if (osm_node_get_type(osm_physp_get_node_ptr(p)) == IB_NODE_TYPE_SWITCH) {
> -               if (ib_port_info_get_vl_cap(&p->port_info) == 1) {
> -                       /* Check port 0's capability mask */
> -                       p_physp = p_port->p_physp;
> -                       if (!
> -                           (p_physp->port_info.
> -                            capability_mask & IB_PORT_CAP_HAS_SL_MAP))
> -                               return IB_SUCCESS;
> -               }
> +       if (osm_node_get_type(osm_physp_get_node_ptr(p)) == IB_NODE_TYPE_SWITCH)
>                num_ports = osm_node_get_num_physp(osm_physp_get_node_ptr(p));
> -       } else {
> -               if (!(p->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP))
> -                       return IB_SUCCESS;
> +       else
>                num_ports = 1;
> -       }
>
>        for (i = 0; i < num_ports; i++) {
>                status = sl2vl_update_table(sm, p, i, port_num, force_update,
> --
> 1.6.6
>
> --
> 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