]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/rds: Assign the correct service level
authorWei Lin Guay <wei.lin.guay@oracle.com>
Mon, 30 Oct 2017 09:45:56 +0000 (10:45 +0100)
committerBrian Maly <brian.maly@oracle.com>
Mon, 11 Jun 2018 20:20:29 +0000 (16:20 -0400)
Commit 2bbf6158c769 ("net/rds: remove the RDS specific path record
caching") has changed the service level (SL) to TOS mapping to be
1:1. Nevertheless, it has assigned the SL to be a 8-bit value even though
IB specification section 7.7.3 mentioned that the SL is only a 4-bit
field. Thus, this patch assigns the SL correctly.

Orabug: 27607213

Signed-off-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reported-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
(cherry picked from commit 8305552e624618c7196575d5a6ae64c0c024fc20
repo uek5)

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/rds/rdma_transport.c
net/rds/rdma_transport.h

index bc1f793e1df3dc474128341ded75fc470eebcf15..80f6a05517d76829dba3bab0ff99e2cea6298b89 100644 (file)
@@ -164,7 +164,7 @@ int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
                                 * needs to update the sl manually. As for now, RDS is assuming
                                 * that it is a 1:1 in tos to sl mapping.
                                 */
-                               cm_id->route.path_rec[0].sl = conn->c_tos;
+                               cm_id->route.path_rec[0].sl = TOS_TO_SL(conn->c_tos);
                                cm_id->route.path_rec[0].qos_class = conn->c_tos;
                                ret = trans->cm_initiate_connect(cm_id, isv6);
                        } else {
index 065fb17ed4971e5bf4f193b7de4e1be92eed69d2..ed08a41f1699bfc8b2bd395222c1491ebb781305 100644 (file)
@@ -7,6 +7,9 @@
 
 #define RDS_RDMA_RESOLVE_TIMEOUT_MS     5000
 
+/* Per IB specification 7.7.3, service level is a 4-bit field. */
+#define TOS_TO_SL(tos) ((tos) & 0xF)
+
 int rds_rdma_conn_connect(struct rds_connection *conn);
 int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
                              struct rdma_cm_event *event);