Skip to contentSkip to conversation

IB/cma: Add default RoCE TOS to CMA configfs

PATCH Applied Leon Romanovsky 2 participants 2 messages Feb 14, 2017 – Feb 15, 2017 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/cma: Add default RoCE TOS to CMA configfs

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add new entry to the RDMA-CM configfs that allows users to select default TOS for RDMA-CM QPs.

This is useful for users that want to control the TOS for legacy applications without changing their code.

Application that sets the TOS explicitly using the rdma_set_option API will continue to work as expected, meaning overriding the configfs value.

---
Changelog v0->v1:
* Convert cma_get_default_roce_tos() function to return int, so it will be able to return negative numbers (error codes).

---
 Documentation/ABI/testing/configfs-rdma_cm |  8 +++++
 drivers/infiniband/core/cma.c              | 54 +++++++++++++++++++++++++++---
 drivers/infiniband/core/cma_configfs.c     | 42 +++++++++++++++++++++++
 drivers/infiniband/core/core_priv.h        |  3 ++
 4 files changed, 102 insertions(+), 5 deletions(-)
Documentation/ABI/testing/configfs-rdma_cm +8 -0
index 5c389aaf5291..74f9506f42e7 100644
@@ -20,3 +20,11 @@ Description: 	RDMA-CM based connections from HCA <hca> at port <port-num>
 		will be initiated with this RoCE type as default.
 		The possible RoCE types are either "IB/RoCE v1" or "RoCE v2".
 		This parameter has RW access.
+
+What: 		/config/rdma_cm/<hca>/ports/<port-num>/default_roce_tos
+Date: 		February 7, 2017
+KernelVersion:  4.11.0
+Description: 	RDMA-CM QPs from HCA <hca> at port <port-num>
+		will be created with this TOS as default.
+		This can be overridden by using the rdma_set_option API.
+		The possible RoCE TOS values are 0-255.
drivers/infiniband/core/cma.c +49 -5

119 lines not on this page · raw message

drivers/infiniband/core/cma_configfs.c +42 -0

50 lines not on this page · raw message

drivers/infiniband/core/core_priv.h +3 -0
index d29372624f3a..912ab4cd6eae 100644
@@ -62,6 +62,9 @@ int cma_get_default_gid_type(struct cma_device *cma_dev,
 int cma_set_default_gid_type(struct cma_device *cma_dev,
 			     unsigned int port,
 			     enum ib_gid_type default_gid_type);
+int cma_get_default_roce_tos(struct cma_device *cma_dev, unsigned int port);
+int cma_set_default_roce_tos(struct cma_device *a_dev, unsigned int port,
+			     u8 default_roce_tos);
 struct ib_device *cma_get_ib_dev(struct cma_device *cma_dev);
 
 int  ib_device_register_sysfs(struct ib_device *device,

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

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

Applied
#2 lore raw
Quoted 13 lines · Leon Romanovsky

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add new entry to the RDMA-CM configfs that allows users to select default TOS for RDMA-CM QPs.

This is useful for users that want to control the TOS for legacy applications without changing their code.

Application that sets the TOS explicitly using the rdma_set_option API will continue to work as expected, meaning overriding the configfs
value.

Quoted 4 lines

Thanks, applied.

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