[ofa-general] [PATCH] infiniband-diags: Do not change logical state on SubnAdmSet

Hal Rosenstock hal.rosenstock at gmail.com
Mon Jun 1 04:50:24 PDT 2009


On Sun, May 31, 2009 at 10:44 AM, Eli Dorfman (Voltaire)
<dorfman.eli at gmail.com> wrote:
> Do not change logical state on SubnAdmSet

The method is SubnSet r.t. SubnAdmSet. Subject might also indicate
ibportstate.c and it would be clearer saying logical port state r.t.
just logical state.

-- Hal

> When changing physical state do not change logical port state.
> >From the IB spec When writing PortInfo:PortState, only legal transitions are
> valid. So if PortState is ACTIVE and we try to set it to ACTIVE this will fail.
>
> This patch allows reset in a single MAD.
>
> Signed-off-by: Eli Dorfman <elid at voltaire.com>
> ---
>  infiniband-diags/src/ibportstate.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/infiniband-diags/src/ibportstate.c b/infiniband-diags/src/ibportstate.c
> index 65c9ca1..d19a2e5 100644
> --- a/infiniband-diags/src/ibportstate.c
> +++ b/infiniband-diags/src/ibportstate.c
> @@ -275,8 +275,10 @@ int main(int argc, char **argv)
>
>        /* Only if one of the "set" options is chosen */
>        if (port_op) {
> -               if (port_op == 1)               /* Enable port */
> +               if (port_op == 1) {             /* Enable port */
>                        mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);        /* Polling */
> +                       mad_set_field(data, 0, IB_PORT_STATE_F, 0);             /* No Change */
> +               }
>                else if ((port_op == 2) || (port_op == 3)) { /* Disable port */
>                        mad_set_field(data, 0, IB_PORT_STATE_F, 1);             /* Down */
>                        mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 3);        /* Disabled */
> @@ -292,6 +294,7 @@ int main(int argc, char **argv)
>
>                if (port_op == 3) {     /* Reset port - so also enable */
>                        mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);        /* Polling */
> +                       mad_set_field(data, 0, IB_PORT_STATE_F, 0);             /* No Change */
>                        err = set_port_info(&portid, data, portnum, port_op);
>                        if (err < 0)
>                                IBERROR("smp set portinfo failed");
> --
> 1.5.5
>
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
>



More information about the general mailing list