Fix returning correct GIDs for RoCE
Status from this message: Applied to for-next thanks
Get series with b4
b4 am [email protected]Versions newest first
Changes in v1 from the cover letter
* Returned zeros when device is not yet bound to cm_id.
* Reordered patches.
* Moved checks of being not-NULL for the sgid, dgid into rdma_read_gids() and made that function ugly like hell.
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | RDMA/cma: Introduce API to read GIDs for multiple transportsdrivers/ include/ | +46 | 0 replies | |
| 2/4 | RDMA/ucma: Use rdma cm API to query GIDdrivers/ | +4 | 0 replies | |
| 3/4 | net/rds: Use rdma_read_gids to read connection GIDsnet/ | +2 | 0 replies | |
| 4/4 | RDMA/core: Simplify rdma_addr_get_sgid() to not support RoCEinclude/ | +7 | 0 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Daniel Jurgens | Santosh Shilimkar |
|---|---|---|
| 1/4 | R-b | |
| 2/4 | R-b | |
| 3/4 | R-b | A-b |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH rdma-next v1 0/4] Fix returning correct GIDs for RoCE
Changelog:
v0 -> v1:
* Returned zeros when device is not yet bound to cm_id.
* Reordered patches.
* Moved checks of being not-NULL for the sgid, dgid into rdma_read_gids() and made that function ugly like hell.
--------------------------------------------------------------------
Quoted 1 line
From Parav:
Currently there are few issues with rdma_addr_get_dgid() and rdma_addr_get_sgid() APIs. They are described below.
1. rdma_addr_get_dgid() returns MAC address for RoCE connections.
2. rdma_addr_get_sgid() returns SGID based on IPv4 address regardless of connection of AF_INET or AF_INET6 type; resulting into returning incorrect SGID.
3. rdma_addr_get_sgid() returns SGID based on the first IP address of the netdevice interface. netdevice can have multiple IP adresses. When connection is established by non first IP address, this results into returning incorrect SGID.
4. rdma_addr_get_sgid() is not actually used in connection establishment APIs such as rdma_resolve_addr(), rdma_resolve_route(), rdma_accept() for RoCE transport.
RoCE specific rdma cm APIs have used ip2gid() API to derive SGID.
Additionally, ULP module such as net/rds accesses some of the internal data structures of the rdma_cm_id, such as rdma_route and rdma_addr structure which might not be the best way to access GIDs.
rdma_ucm module provides GIDs to user space via ucma_query_gid() API. In certain above conditions it returns incorrect GIDs.
Therefore, this patchset introduces a transport agnostic API for existing ULP such as rds and rdma_ucm to query GIDs for a given connection referred by rdma_cm_id.
Since rdma_addr_get_sgid() is not used for RoCE transport during connection establishment phase, iboe_addr_get_sgid() is removed. rdma_addr_get_sgid() is refactored for such simplicity.
rdma_read_gids() new API is introduced that allows to read the SGID and/or DGID of the rdma_cm_id for client and server side connections.
Therefore, this patchset introduces a transport agnostic API for existing ULP such as rds and rdma_ucm to query GIDs for a given connection referred by rdma_cm_id.
Since RoCE support was incrementally added, there is no specific commit id that can be qualified as breaking rdma_addr_get_sgid() API. rdma_addr_get_dgid() was written initially without RoCE transport in consideration. When RoCE support was added incrementally, this API remained broken.
Thanks
Parav Pandit (4):
RDMA/cma: Introduce API to read GIDs for multiple transports RDMA/ucma: Use rdma cm API to query GID
net/rds: Use rdma_read_gids to read connection GIDs RDMA/core: Simplify rdma_addr_get_sgid() to not support RoCE
drivers/infiniband/core/cma.c | 27 +++++++++++++++++++++++++++ drivers/infiniband/core/ucma.c | 8 ++++---- include/rdma/ib_addr.h | 33 +++++++-------------------------- include/rdma/rdma_cm.h | 19 +++++++++++++++++++ net/rds/ib.c | 6 ++---- 5 files changed, 59 insertions(+), 34 deletions(-)
--
2.15.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html