Author: hselasky
Date: Mon Mar  5 11:59:54 2018
New Revision: 330495
URL: https://svnweb.freebsd.org/changeset/base/330495

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

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_cma.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/ib_cma.c      Mon Mar  5 11:58:37 
2018        (r330494)
+++ head/sys/ofed/drivers/infiniband/core/ib_cma.c      Mon Mar  5 11:59:54 
2018        (r330495)
@@ -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