[ofa-general] Re: [PATCH] infiniband-diags/ibroute: Add support for MulticastFDBTop
Sasha Khapyorsky
sashak at voltaire.com
Sun Aug 30 04:53:16 PDT 2009
On 10:03 Wed 26 Aug , Hal Rosenstock wrote:
>
> Add support for SwitchInfo:MulticastFDBTop
> Added by MgtWG errata #4505-4508 and #4640
>
> If MulticastFDBTop is set to other than 0, only fetch MulticastForwardingTable
> blocks up through MulticastFDBTop rather than MulticastFDBCap
>
> If MulticastFDBTop is set to 0xbfff, this means no entries (per #4640)
>
> Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
> ---
> diff --git a/infiniband-diags/src/ibroute.c b/infiniband-diags/src/ibroute.c
> index 106c934..f3ebe56 100644
> --- a/infiniband-diags/src/ibroute.c
> +++ b/infiniband-diags/src/ibroute.c
> @@ -1,5 +1,6 @@
> /*
> * Copyright (c) 2004-2008 Voltaire Inc. All rights reserved.
> + * Copyright (c) 2009 Mellanox Technologies LTD. All rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms of the GNU
> @@ -140,16 +141,24 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
> char *s;
> uint64_t nodeguid;
> uint32_t mod;
> - unsigned block, i, j, e, nports, cap, chunks, startblock, lastblock;
> + unsigned block, i, j, e, nports, cap, top, chunks,
> + startblock, lastblock;
> int n = 0;
>
> if ((s = check_switch(portid, &nports, &nodeguid, sw, nd)))
> return s;
>
> mad_decode_field(sw, IB_SW_MCAST_FDB_CAP_F, &cap);
> + mad_decode_field(sw, IB_SW_MCAST_FDB_TOP_F, &top);
>
> if (!endlid || endlid > IB_MIN_MCAST_LID + cap - 1)
> endlid = IB_MIN_MCAST_LID + cap - 1;
> + if (!dump_all && top && top < endlid) {
> + if (top < IB_MIN_MCAST_LID - 1 || top == 0xffff)
I don't understand what does this "top == 0xffff" check?
Shouldn't be something like
(top > IB_MIN_MCAST_LID + cap - 1 && top != 0xbfff)
instead?
> + IBWARN("illegal top mlid %x", top);
> + else
> + endlid = top;
> + }
And where is the case of "no entries" (top = 0xbfff) handled (as
declared in change log)?
Sasha
>
> if (!startlid)
> startlid = IB_MIN_MCAST_LID;
> @@ -187,7 +196,8 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
> printf(" MLid\n");
> }
> if (ibverbose)
> - printf("Switch multicast mlid capability is %d\n", cap);
> + printf("Switch multicast mlid capability is %d top is %d\n",
> + cap, top);
>
> chunks = ALIGN(nports + 1, 16) / 16;
>
>
More information about the general
mailing list