All of lore.kernel.org
 help / color / mirror / Atom feed
* Misunderstanding of spec?
@ 2021-08-14  3:03 William Kucharski
       [not found] ` <001001d790ef$6d602540$48206fc0$@soft-forge.com>
  2021-08-23 13:30 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: William Kucharski @ 2021-08-14  3:03 UTC (permalink / raw)
  To: linux-rdma

I noticed that under certain circumstances, GID 0 for some interfaces is reported as all 0s, or empty.

This seems to be correlated with code in drivers/infiniband/core/roce_gid_mgmt.c in the routine
ndev_event_link(), which does this:
	
	/*
	 * When a lower netdev is linked to its upper bonding
	 * netdev, delete lower slave netdev's default GIDs.
	 */
	cmds[0] = bonding_default_del_cmd;
	cmds[0].ndev = event_ndev;
	cmds[0].filter_ndev = changeupper_info->upper_dev;

bonding_default_del_cmd will result in a call to del_default_gids().

However, given version 1.2.1 of the IB spec, looking at page 145, line 20:

4.1.1 GID USAGE AND PROPERTIES

1) Each endport shall be assigned at least one unicast GID. The first unicast GID assigned shall be
  created using the manufacturer assigned EUI-64 identifier. This GID is referred to as GID index 0
  and is formed by techniques 3(a) or 3(b) described below.

2) The default GID prefix shall be (0xFE80::0). A packet using the default GID prefix and either a
  manufacturer assigned or SM assigned EUI-64 must always be accepted by an endnode. A packet
  containing a GRH with a destination GID with this prefix must never be forwarded by a router,
  i.e. it is restricted to the local subnet.

3) A unicast GID shall be created using one or more of the following mechanisms:

   a) Concatenation of the default GID prefix with the manufacturer as
      signed EUI-64 identifier associated with an endport. This GID is
      referred to as the default GID.

   b) Concatenation of a subnet manager assigned 64-bit GID prefix and the
      manufacturer assigned EUI-64 identifier associated with an endport.

   c) Assignment of a GID by the subnet manager. The subnet manager creates a
      GID by concatenating the GID prefix (default or assigned) with a set of
      locally assigned EUI-64 values (at GID index 1 or above).

      Each endport must be assigned at least one unicast GID using (a). Additional
      GIDs may be assigned using (b) and/or (c). Note: A subnet 2 shall only have
      one assigned GID prefix (non default) at any given time.

make_default_gid()and add default_gids() seem to have that all taken care of.

What concerns me is the code that removes GID index 0, as page 436, line 35, states:

C10-2: For each GID Table, the first entry in the table shall contain the read-only invariant value of GID index 0.

So is it actually OK to remove GID 0 when removing default GIDs via del_default_gids(), or should it be preserving GID index 0 at all times?

This is because it appears a call to rdma_query_gid() (as in ib_find_gid()) will return -EINVAL for a table if GID 0 has been deleted.

Am I misreading the spec, or is there a bug here?

Thanks,
    William Kucharski


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-23 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-14  3:03 Misunderstanding of spec? William Kucharski
     [not found] ` <001001d790ef$6d602540$48206fc0$@soft-forge.com>
2021-08-14 19:22   ` William Kucharski
2021-08-23 13:30 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.