> -----Original Message----- > From: Leon Romanovsky [mailto:leon@xxxxxxxxxx] > Sent: Sunday, May 27, 2018 6:49 AM > To: Doug Ledford <dledford@xxxxxxxxxx>; Jason Gunthorpe > <jgg@xxxxxxxxxxxx> > Cc: Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA mailing list <linux- > rdma@xxxxxxxxxxxxxxx>; Daniel Jurgens <danielj@xxxxxxxxxxxx>; Matan Barak > <matanb@xxxxxxxxxxxx>; Parav Pandit <parav@xxxxxxxxxxxx> > Subject: [PATCH rdma-next 3/4] IB/core: Introduce GID entry reference counts > > From: Parav Pandit <parav@xxxxxxxxxxxx> > > Currently a GID entry can be deleted from the GID table while it is in use by ULPs, > CM modules or user space applications. > It may even get replaced with new attributes and/or GID value which may lead > to undesired traffic in the network. > Previous and new GID entry might be in two different net namespace; this may > lead to send traffic to undesired namespace. > Provider drivers might be working on GID entry while modifying QP or creating > address handle, and GID entry can get modified. > > So this patch introduces GID reference count infrastructure without actually > exposing GID get/put/hold APIs to overcome above issues. > > GID entry reference count is based on standard kref structure. > The GID table entries are re-organized so they are written once before being > added to the table, and then never changed during the lifetime of the entry. > > This patch introduces GID entry state as INVALID, VALID and PENDING_DEL. > GID_TABLE_ENTRY_PENDING_DEL indicates that a given GID entry is marked as > pending for deletion. While it is in pending state, allocator must not reuse such > entry. When GID entry is in PENDING_DEL state, no more new references can be > taken using find operation. This ensures that no new processing starts for such > expiring GID entry. > > For IB port GID table entry location is decided by the HCA provider driver. Which > means that when GID table entries are in use by the users of it, > ib_cache_update() can overwrite the GID entry and attributes for IB link layer. > Therefore, when an entry is deleted/added (RoCE) or replaced (IB) new memory > is allocated to replace the old entry and the old entry lives on via a kref until all > users finally drop it. > > It also adds and uses readable helper functions at multiple places to check GID > entry state such as is_free() and is_valid(). > > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> [..] Mark caught one issue with mlx4 mode that breaks context initialization. Please drop this series. Will send out fix shortly. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html