Skip to contentSkip to conversation

IB/cma: Add default RoCE TOS to CMA configfs

PATCH New Leon Romanovsky 1 participant 1 message Jan 25, 2017 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.

---
 Documentation/ABI/testing/configfs-rdma_cm |  8 +++++
 drivers/infiniband/core/cma.c              | 56 +++++++++++++++++++++++++++---
 drivers/infiniband/core/cma_configfs.c     | 42 ++++++++++++++++++++++
 drivers/infiniband/core/core_priv.h        |  3 ++
 4 files changed, 104 insertions(+), 5 deletions(-)
Documentation/ABI/testing/configfs-rdma_cm +8 -0
index 5c389aaf5291..89fa006ee88d 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: 		December 20, 2016
+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 +51 -5

121 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..b9ebea6da8b9 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);
+u8 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,
Signature · 6 lines
2.11.0

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