[openib-general] [PATCH RFC 5 of 5] IB/sdp: QoS support

Michael S. Tsirkin mst at mellanox.co.il
Mon Jan 22 06:50:48 PST 2007


QoS support according to the proposed LWG2 QoS Annex:
pass socket priority to CMA

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

---

SDP is not upstream, this patch is posted for completeness,
to demonstrate how the new rdma_set_priority call might be used.

diff --git a/drivers/infiniband/ulp/sdp/sdp_cma.c b/drivers/infiniband/ulp/sdp/sdp_cma.c
index 59c8052..50c4e38 100644
--- a/drivers/infiniband/ulp/sdp/sdp_cma.c
+++ b/drivers/infiniband/ulp/sdp/sdp_cma.c
@@ -47,6 +47,11 @@
 #include "sdp_socket.h"
 #include "sdp.h"
 
+static int sdp_qos_support;
+
+module_param_named(qos_support, sdp_qos_support, int, 0644);
+MODULE_PARM_DESC(qos_support, "Enable QoS support if > 0.");
+
 union cma_ip_addr {
         struct in6_addr ip6;
         struct {
@@ -363,6 +368,12 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
 	switch (event->event) {
 	case RDMA_CM_EVENT_ADDR_RESOLVED:
 		sdp_dbg(sk, "RDMA_CM_EVENT_ADDR_RESOLVED\n");
+		if (sdp_qos_support) {
+			rc = rdma_set_priority(id, sk->sk_priority);
+			if (rc)
+				sdp_warn(sk, "rdma_set_priority failed: %d\n", rc);
+		}
+
 		rc = rdma_resolve_route(id, SDP_ROUTE_TIMEOUT);
 		break;
 	case RDMA_CM_EVENT_ADDR_ERROR:


-- 
MST




More information about the general mailing list