[ofa-general] Re: [PATCH] opensm/osm_perfmgr.c: In perfmgr_send_pc_mad, only set CounterSelect when Set method is used

Hal Rosenstock hal.rosenstock at gmail.com
Mon Jul 20 07:20:07 PDT 2009


On Sun, Jul 19, 2009 at 9:32 AM, Sasha Khapyorsky<sashak at voltaire.com> wrote:
> On 19:25 Wed 15 Jul     , Hal Rosenstock wrote:
>> On Wed, Jul 15, 2009 at 7:06 PM, Sasha Khapyorsky<sashak at voltaire.com> wrote:
>> > On 10:04 Tue 14 Jul ?? ?? , Hal Rosenstock wrote:
>> >>
>> >> Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
>> >> ---
>> >> diff --git a/opensm/opensm/osm_perfmgr.c b/opensm/opensm/osm_perfmgr.c
>> >> index ecfdbda..0437d47 100644
>> >> --- a/opensm/opensm/osm_perfmgr.c
>> >> +++ b/opensm/opensm/osm_perfmgr.c
>> >> @@ -376,7 +376,8 @@ static ib_api_status_t perfmgr_send_pc_mad(osm_perfmgr_t * perfmgr,
>> >> ?? ?? ?? port_counter = (ib_port_counters_t *) & pm_mad->data;
>> >> ?? ?? ?? memset(port_counter, 0, sizeof(*port_counter));
>> >> ?? ?? ?? port_counter->port_select = port;
>> >> - ?? ?? port_counter->counter_select = 0xFFFF;
>> >> + ?? ?? if (mad_method == IB_MAD_METHOD_SET)
>> >> + ?? ?? ?? ?? ?? ?? port_counter->counter_select = 0xFFFF;
>> >
>> > Could you explain why?
>>
>> CounterSelect is only valid on a Set.
>
> Then what was wrong with an initialization on a Get?

Your words not mine :-) I didn't say anything was wrong. Both are
right but why initialize something that doesn't need it. Also, this is
future looking as I expect more of such shortly so at what point is it
worth it ?

-- Hal

> Sasha
>



More information about the general mailing list