[ofa-general] Re: [PATCHv2] infiniband-diags/perfquery.c: Fix issues when checking PerfMgt:ClassPortInfo.CapabilityMask
Sasha Khapyorsky
sashak at voltaire.com
Sat Oct 13 10:32:14 PDT 2007
On 06:30 Fri 12 Oct , Hal Rosenstock wrote:
> infiniband-diags/perfquery.c: Fix issues when checking
> PerfMgt:ClassPortInfo.CapabilityMask
>
> 1. bit 9, if we're counting from 0, will have mask of 0x200,
> not 0x100. mask of 0x100 will be for counter aggregation according
> to IBA 1.2.
>
> 2. If capmask is 16 bit big-endian word, then we're looking
> at the wrong byte on x86, we must ntohs(*pc2) first.
>
> 3. Also, change pointer dereference with memcpy,
> e.g.:
>
> memcpy (&capmask, pc+2, sizeof(capmask));
> capmask = ntohs(capmask);
>
> Those pointer dereferenes are royal pain on ia64 unless you can
> guarantee what pc is always aligned properly.
>
> Found-by: Max Matveev <makc at sgi.com>
>
> Compile tested only
>
> Signed-off-by: Hal Rosenstock <hal at xsigo.com>
Applied. Thanks.
I have the question below (not related directly to specific patch).
>
> diff --git a/infiniband-diags/src/perfquery.c b/infiniband-diags/src/perfquery.c
> index 2ae3281..148e452 100644
> --- a/infiniband-diags/src/perfquery.c
> +++ b/infiniband-diags/src/perfquery.c
> @@ -40,8 +40,9 @@
> #include <unistd.h>
> #include <stdarg.h>
> #include <getopt.h>
> +#include <netinet/in.h>
>
> -#define __BUILD_VERSION_TAG__ 1.2.1
> +#define __BUILD_VERSION_TAG__ 1.2.2
What is the motivation of this change and in general what
__BUILD_VERSION_TAG__ is supposed to show? If it is just unique build
version then I guess t would be better to use infiniband-diags version +
git-describe sequence. If it is per-tool "compat" string, then likely we
don't need to change it each time when tools behavior is not changed.
Sasha
More information about the general
mailing list