From: Wei Lin Guay Date: Mon, 30 Oct 2017 09:45:56 +0000 (+0100) Subject: net/rds: Assign the correct service level X-Git-Tag: v4.1.12-124.31.3~720 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d6c8d3ed5ccc454ef8ccbb53fc75f35973ea0da8;p=users%2Fjedix%2Flinux-maple.git net/rds: Assign the correct service level 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 Reported-by: Håkon Bugge Reviewed-by: Yuval Shaia Signed-off-by: Somasundaram Krishnasamy (cherry picked from commit 8305552e624618c7196575d5a6ae64c0c024fc20 repo uek5) Signed-off-by: Håkon Bugge Reviewed-by: Zhu Yanjun Signed-off-by: Brian Maly --- diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index bc1f793e1df3d..80f6a05517d76 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c @@ -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 { diff --git a/net/rds/rdma_transport.h b/net/rds/rdma_transport.h index 065fb17ed4971..ed08a41f1699b 100644 --- a/net/rds/rdma_transport.h +++ b/net/rds/rdma_transport.h @@ -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);