Author: hselasky
Date: Fri Mar 30 18:28:22 2018
New Revision: 331778
URL: https://svnweb.freebsd.org/changeset/base/331778

Log:
  MFC r330495:
  Map type of service, TOS, to IB or VLAN service level 1:1 in ibcore.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c
==============================================================================
--- stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Mar 30 18:27:24 
2018        (r331777)
+++ stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Mar 30 18:28:22 
2018        (r331778)
@@ -2422,8 +2422,17 @@ static int cma_resolve_iw_route(struct rdma_id_private
 
 static int iboe_tos_to_sl(struct net_device *ndev, int tos)
 {
-       /* TODO: Implement this function */
-       return 0;
+       /* get service level, SL, from type of service, TOS */
+       int sl = tos;
+
+       /* range check input argument and map 1:1 */
+       if (sl > 255)
+               sl = 255;
+       else if (sl < 0)
+               sl = 0;
+
+       /* final mappings are done by the vendor specific drivers */
+       return sl;
 }
 
 static enum ib_gid_type cma_route_gid_type(enum rdma_network_type network_type,
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to