[ofa-general] [PATCH] infiniband-diags/src/ibqueryerrors: Add clear errors and counters options

Hal Rosenstock hal.rosenstock at gmail.com
Fri Sep 25 07:07:28 PDT 2009


Ira,
See one minor comment below:


On Fri, Sep 25, 2009 at 2:50 AM, Ira Weiny <weiny2 at llnl.gov> wrote:

> Sasha,
>
> This applies after
>
>   "infiniband-diags/src/ibqueryerrors: move --all option and replace it
> with
>   --switch, --ca, --router"
>
>
> From: Ira Weiny <weiny2 at llnl.gov>
> Date: Thu, 24 Sep 2009 20:39:29 -0700
> Subject: [PATCH] infiniband-diags/src/ibqueryerrors: Add clear errors and
> counters options
>
>        Add -k and -K options to clear errors and counters.  If both are
>        specified they will both be cleared.
>

Nice efficiency improvement over running a subsequent ibclearerrors/counters
:-)


>
>        Update man page
>
>        In addition fix 2 bugs
>        fix the printing of Xmt Wait errors
>        properly skip the counter select field.
>
> Signed-off-by: Ira Weiny <weiny2 at llnl.gov>
> ---
>  infiniband-diags/man/ibqueryerrors.8 |   20 +++++--
>  infiniband-diags/src/ibqueryerrors.c |   91
> +++++++++++++++++++++++++++++----
>  2 files changed, 94 insertions(+), 17 deletions(-)
>
> <snip...>


> diff --git a/infiniband-diags/src/ibqueryerrors.c
> b/infiniband-diags/src/ibqueryerrors.c
> index ecfd662..e379a42 100644
> --- a/infiniband-diags/src/ibqueryerrors.c
> +++ b/infiniband-diags/src/ibqueryerrors.c
>
<snip...>


> +static void clear_port(ib_portid_t * portid, uint16_t cap_mask,
> +                             ibnd_node_t * node, int port)
> +{
> +       uint8_t pc[1024];
> +       /* bits defined in Table 228 PortCounters CounterSelect and
> +        * CounterSelect2
> +        */
> +       uint32_t mask = 0;
> +
> +       if (!clear_errors && !clear_counts)
> +               return;
> +
> +       if (clear_errors)
> +               mask |= 0x10FFF;
>
Since PortXmitWait setting is new, shouldn't the setting of this bit in the
mask be conditionalized on the CapabilityMask indicating that this is
supported ? That seems safer to me.

-- Hal


> +       if (clear_counts)
> +               mask |= 0xF000;
> +
> +       if (!performance_reset_via(pc, portid, port, mask, ibd_timeout,
> +                                  IB_GSI_PORT_COUNTERS, ibmad_port))
> +               IBERROR("Failed to reset errors %s port %d",
> +                       node->nodedesc, port);
> +}
> +
>
<snip...>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20090925/65e791bd/attachment.html>


More information about the general mailing list