Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 May 2018 19:09:41 +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: r333887 - stable/11/sys/contrib/rdma/krping
Message-ID:  <201805191909.w4JJ9fqE083557@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sat May 19 19:09:41 2018
New Revision: 333887
URL: https://svnweb.freebsd.org/changeset/base/333887

Log:
  MFC r333623:
  Add support for setting type of service, TOS, for outgoing RDMA connections
  in the krping kernel test utility.
  
  Approved by:	re (gjb)
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/contrib/rdma/krping/krping.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/contrib/rdma/krping/krping.c
==============================================================================
--- stable/11/sys/contrib/rdma/krping/krping.c	Sat May 19 19:00:04 2018	(r333886)
+++ stable/11/sys/contrib/rdma/krping/krping.c	Sat May 19 19:09:41 2018	(r333887)
@@ -96,6 +96,7 @@ static const struct krping_option krping_opts[] = {
  	{"rlat", OPT_NOPARAM, 'L'},
  	{"bw", OPT_NOPARAM, 'B'},
  	{"duplex", OPT_NOPARAM, 'd'},
+	{"tos", OPT_INT, 't'},
  	{"txdepth", OPT_INT, 'T'},
  	{"poll", OPT_NOPARAM, 'P'},
  	{"local_dma_lkey", OPT_NOPARAM, 'Z'},
@@ -234,6 +235,7 @@ struct krping_cb {
 	int txdepth;			/* SQ depth */
 	int local_dma_lkey;		/* use 0 for lkey */
 	int frtest;			/* reg test */
+	int tos;			/* type of service */
 
 	/* CM stuff */
 	struct rdma_cm_id *cm_id;	/* connection on client side,*/
@@ -1918,6 +1920,10 @@ static void krping_run_client(struct krping_cb *cb)
 	struct ib_recv_wr *bad_wr;
 	int ret;
 
+	/* set type of service, if any */
+	if (cb->tos != 0)
+		rdma_set_service_type(cb->cm_id, cb->tos);
+
 	ret = krping_bind_client(cb);
 	if (ret)
 		return;
@@ -2096,6 +2102,10 @@ int krping_doit(char *cmd)
 			break;
 		case 'I':
 			cb->server_invalidate = 1;
+			break;
+		case 't':
+			cb->tos = optint;
+			DEBUG_LOG("type of service, tos=%d\n", (int) cb->tos);
 			break;
 		case 'T':
 			cb->txdepth = optint;



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