Skip to contentSkip to conversation

IB/cma: Set default gid type to RoCEv2

PATCH In review Leon Romanovsky 2 participants 4 messages May 30, 2017 – Jul 30, 2017 3 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/cma: Set default gid type to RoCEv2

From: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>

RoCEv2 is the preferred RDMA protocol for Ethernet link layer because of its advantages over RoCEv1. For better user experience make it the default choice for RDMA_CM connections if device/port support it.

---
 drivers/infiniband/core/cma.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/infiniband/core/cma.c +7 -2
index 91b7a2fe5a55..5ce3c9e1657e 100644
@@ -72,6 +72,7 @@ MODULE_LICENSE("Dual BSD/GPL");
 #define CMA_MAX_CM_RETRIES 15
 #define CMA_CM_MRA_SETTING (IB_CM_MRA_FLAG_DELAY | 24)
 #define CMA_IBOE_PACKET_LIFETIME 18
+#define CMA_PREFERRED_ROCE_GID_TYPE IB_GID_TYPE_ROCE_UDP_ENCAP
 
 static const char * const cma_events[] = {
 	[RDMA_CM_EVENT_ADDR_RESOLVED]	 = "address resolved",
@@ -4305,8 +4306,12 @@ static void cma_add_one(struct ib_device *device)
 	for (i = rdma_start_port(device); i <= rdma_end_port(device); i++) {
 		supported_gids = roce_gid_type_mask_support(device, i);
 		WARN_ON(!supported_gids);
-		cma_dev->default_gid_type[i - rdma_start_port(device)] =
-			find_first_bit(&supported_gids, BITS_PER_LONG);
+		if (supported_gids & CMA_PREFERRED_ROCE_GID_TYPE)
+			cma_dev->default_gid_type[i - rdma_start_port(device)] =
+				CMA_PREFERRED_ROCE_GID_TYPE;
+		else
+			cma_dev->default_gid_type[i - rdma_start_port(device)] =
+				find_first_bit(&supported_gids, BITS_PER_LONG);
 		cma_dev->default_roce_tos[i - rdma_start_port(device)] = 0;
 	}
 

--
2.12.2

--
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

A message that is not in the archive (sent off-list or not yet received): 20170530064734.4731-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw
Quoted 18 lines · Leon Romanovsky

From: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>

RoCEv2 is the preferred RDMA protocol for Ethernet link layer because of its advantages over RoCEv1. For better user experience make it the default choice for RDMA_CM connections if device/port support it.

---
 drivers/infiniband/core/cma.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/infiniband/core/cma.c +0 -0
index 91b7a2fe5a55..5ce3c9e1657e 100644

drivers/infiniband/core/cma.c MODULE_LICENSE("Dual BSD/GPL"); · line 75

Quoted 4 lines
drivers/infiniband/core/cma.c +1 -0
@@ -72,6 +72,7 @@ MODULE_LICENSE("Dual BSD/GPL");
 #define CMA_MAX_CM_RETRIES 15
 #define CMA_CM_MRA_SETTING (IB_CM_MRA_FLAG_DELAY | 24)
 #define CMA_IBOE_PACKET_LIFETIME 18
+#define CMA_PREFERRED_ROCE_GID_TYPE IB_GID_TYPE_ROCE_UDP_ENCAP

It should be (1 << IB_GID_TYPE_ROCE_UDP_ENCAP) and not as was written above. We will send a fix for that.

Thanks

A message that is not in the archive (sent off-list or not yet received): 20170607090750.GC1127-U/[email protected]

#4 lore raw
Quoted 16 lines · Leon Romanovsky
Quoted 15 lines · Leon Romanovsky

From: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>

RoCEv2 is the preferred RDMA protocol for Ethernet link layer because
of its advantages over RoCEv1. For better user experience make it the
default choice for RDMA_CM connections if device/port support it.

---
 drivers/infiniband/core/cma.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Quoted 13 lines

drivers/infiniband/core/cma.c MODULE_LICENSE("Dual BSD/GPL"); · line 75

Quoted 10 lines
drivers/infiniband/core/cma.c +1 -0
index 91b7a2fe5a55..5ce3c9e1657e 100644
@@ -72,6 +72,7 @@ MODULE_LICENSE("Dual BSD/GPL");
 #define CMA_MAX_CM_RETRIES 15
 #define CMA_CM_MRA_SETTING (IB_CM_MRA_FLAG_DELAY | 24)
 #define CMA_IBOE_PACKET_LIFETIME 18
+#define CMA_PREFERRED_ROCE_GID_TYPE IB_GID_TYPE_ROCE_UDP_ENCAP

It should be (1 << IB_GID_TYPE_ROCE_UDP_ENCAP) and not as was written above. We will send a fix for that.

I didn't see a followup that fixed this, so I took this patch and then created a fix patch myself.

Signature · 8 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 31 lines · Doug Ledford
Quoted 16 lines · Leon Romanovsky
Quoted 15 lines · Leon Romanovsky

From: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>

RoCEv2 is the preferred RDMA protocol for Ethernet link layer because
of its advantages over RoCEv1. For better user experience make it the
default choice for RDMA_CM connections if device/port support it.

---
 drivers/infiniband/core/cma.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Quoted 13 lines

drivers/infiniband/core/cma.c MODULE_LICENSE("Dual BSD/GPL"); · line 75

Quoted 10 lines
drivers/infiniband/core/cma.c +1 -0
index 91b7a2fe5a55..5ce3c9e1657e 100644
@@ -72,6 +72,7 @@ MODULE_LICENSE("Dual BSD/GPL");
 #define CMA_MAX_CM_RETRIES 15
 #define CMA_CM_MRA_SETTING (IB_CM_MRA_FLAG_DELAY | 24)
 #define CMA_IBOE_PACKET_LIFETIME 18
+#define CMA_PREFERRED_ROCE_GID_TYPE IB_GID_TYPE_ROCE_UDP_ENCAP

It should be (1 << IB_GID_TYPE_ROCE_UDP_ENCAP) and not as was written above. We will send a fix for that.

Quoted 2 lines

I didn't see a followup that fixed this, so I took this patch and then created a fix patch myself.

Thanks.

Quoted 10 lines

--
Doug Ledford <[email protected]>

    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
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