On Fri, Oct 30, 2009 at 6:16 PM, Hal Rosenstock
<[email protected]> wrote:
> On Thu, Oct 29, 2009 at 9:17 PM, Sasha Khapyorsky <[email protected]> wrote:
>>
>> On 17:17 Sat 26 Sep     , Hal Rosenstock wrote:
>>>
>>> to not have any bits on for reserved components
>>
>> Why to care?
>
> Because a PMA implementation which follows the IBA recommendation will
> reject this so it's safer.

There's an errata removing this so it's a don't care.

-- Hal

>
> -- Hal
>
>>>
>>> Signed-off-by: Hal Rosenstock <[email protected]>
>>> ---
>>> diff --git a/infiniband-diags/src/perfquery.c
>>> b/infiniband-diags/src/perfquery.c
>>> index d70af9e..5d4046b 100644
>>> --- a/infiniband-diags/src/perfquery.c
>>> +++ b/infiniband-diags/src/perfquery.c
>>> @@ -91,6 +91,8 @@ struct perf_count perf_count =
>>>      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
>>>  struct perf_count_ext perf_count_ext = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
>>>
>>> +int not_def_mask = 0;
>>> +
>>>  #define ALL_PORTS 0xFF
>>>
>>>  /* Notes: IB semantics is to cap counters if count has exceeded limits.
>>> @@ -337,8 +339,10 @@ static void reset_counters(int extended, int timeout,
>>> int mask,
>>>                                             IB_GSI_PORT_COUNTERS,
>>> srcport))
>>>                          IBERROR("perf reset");
>>>          } else {
>>> -                if (!performance_reset_via(pc, portid, port, mask,
>>> timeout,
>>> -                                           IB_GSI_PORT_COUNTERS_EXT,
>>> srcport))
>>> +                if (!performance_reset_via(pc, portid, port,
>>> +                                           not_def_mask ? mask : mask &
>>> 0xff,
>>> +                                           timeout,
>>> IB_GSI_PORT_COUNTERS_EXT,
>>> +                                           srcport))
>>
>> And if it is really needed please do it somehow without introducing yet
>> another global flow switcher.
>>
>> Sasha
>>
>>>                          IBERROR("perf ext reset");
>>>          }
>>>  }
>>> @@ -476,8 +480,10 @@ int main(int argc, char **argv)
>>>
>>>          if (argc > 1)
>>>                  port = strtoul(argv[1], 0, 0);
>>> -        if (argc > 2)
>>> +        if (argc > 2) {
>>>                  mask = strtoul(argv[2], 0, 0);
>>> +                not_def_mask = 1;
>>> +        }
>>>
>>>          srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes,
>>> 4);
>>>          if (!srcport)
>>>
>>
>

Reply via email to