svn commit: r339809 - head/usr.sbin/cxgbetool

Navdeep Parhar np at FreeBSD.org
Sat Oct 27 05:26:11 UTC 2018


Author: np
Date: Sat Oct 27 05:26:09 2018
New Revision: 339809
URL: https://svnweb.freebsd.org/changeset/base/339809

Log:
  cxgbetool(8): Add a subaction (tcbrss <n>) that can be used with "pass"
  action to distribute traffic using the half of the VI's RSS indirection
  table.
  
  The value specified should either be the start of the VI's RSS slice
  (available at dev.<ifname>.<inst>.rss_base since r339700) or the
  midpoint (rss_base + rss_size/2).  The traffic that hits the filter will
  use the first or second half of the indirection table respectively.
  The indirection table can be populated in different ways to achieve
  different kinds of traffic/load distributions.  For example, r339749
  allows a netmap interface to have half the rx queues in the first half
  of the table and the rest in the other.
  
  Sponsored by:	Chelsio Communications

Modified:
  head/usr.sbin/cxgbetool/cxgbetool.c

Modified: head/usr.sbin/cxgbetool/cxgbetool.c
==============================================================================
--- head/usr.sbin/cxgbetool/cxgbetool.c	Sat Oct 27 04:59:35 2018	(r339808)
+++ head/usr.sbin/cxgbetool/cxgbetool.c	Sat Oct 27 05:26:09 2018	(r339809)
@@ -924,7 +924,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t 
 		if (t->fs.dirsteer == 0) {
 			printf("RSS");
 			if (t->fs.maskhash)
-				printf("(TCB=hash)");
+				printf("(region %d)", t->fs.iq << 1);
 		} else {
 			printf("%d", t->fs.iq);
 			if (t->fs.dirsteerhash == 0)
@@ -1263,11 +1263,19 @@ set_filter(uint32_t idx, int argc, const char *argv[],
 		} else if (!parse_val("rpttid", args, &val)) {
 			t.fs.rpttid = 1;
 		} else if (!parse_val("queue", args, &val)) {
-			t.fs.dirsteer = 1;
-			t.fs.iq = val;
+			t.fs.dirsteer = 1;	/* direct steer */
+			t.fs.iq = val;		/* to the iq with this cntxt_id */
 		} else if (!parse_val("tcbhash", args, &val)) {
-			t.fs.maskhash = 1;
-			t.fs.dirsteerhash = 1;
+			t.fs.dirsteerhash = 1;	/* direct steer */
+			/* XXX: use (val << 1) as the rss_hash? */
+			t.fs.iq = val;
+		} else if (!parse_val("tcbrss", args, &val)) {
+			t.fs.maskhash = 1;	/* steer to RSS region */
+			/*
+			 * val = start idx of the region but the internal TCB
+			 * field is 10b only and is left shifted by 1 before use.
+			 */
+			t.fs.iq = val >> 1;
 		} else if (!parse_val("eport", args, &val)) {
 			t.fs.eport = val;
 		} else if (!parse_val("swapmac", args, &val)) {


More information about the svn-src-all mailing list