Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Mar 2018 18:28:22 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331778 - stable/11/sys/ofed/drivers/infiniband/core
Message-ID:  <201803301828.w2UISMY6072468@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803301828.w2UISMY6072468>