svn commit: r339717 - head/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Thu Oct 25 14:37:28 UTC 2018


Author: np
Date: Thu Oct 25 14:37:26 2018
New Revision: 339717
URL: https://svnweb.freebsd.org/changeset/base/339717

Log:
  cxgbe(4): Allow "pass" filters to distribute matching traffic using a
  subset of a VI's RSS indirection table.
  
  This makes it possible to make groups out of rx queues and steer
  different kinds of traffic to different groups.  For example, an
  interface with 8 rx queues could have all non-TCP traffic delivered to
  queues 0-3 and all TCP traffic to queues 4-7.
  
  Note that it is already possible for filters to steer traffic to a
  particular queue or to distribute it using the full indirection table
  (much like normal rx does).
  
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_filter.c
  head/sys/dev/cxgbe/t4_ioctl.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_filter.c
==============================================================================
--- head/sys/dev/cxgbe/t4_filter.c	Thu Oct 25 14:36:56 2018	(r339716)
+++ head/sys/dev/cxgbe/t4_filter.c	Thu Oct 25 14:37:26 2018	(r339717)
@@ -864,8 +864,8 @@ set_filter(struct adapter *sc, struct t4_filter *t)
 	if (t->fs.val.iport >= sc->params.nports)
 		return (EINVAL);
 
-	/* Can't specify an iq if not steering to it */
-	if (!t->fs.dirsteer && t->fs.iq)
+	/* Can't specify an iqid/rss_info if not steering. */
+	if (!t->fs.dirsteer && !t->fs.dirsteerhash && !t->fs.maskhash && t->fs.iq)
 		return (EINVAL);
 
 	/* Validate against the global filter mode and ingress config */

Modified: head/sys/dev/cxgbe/t4_ioctl.h
==============================================================================
--- head/sys/dev/cxgbe/t4_ioctl.h	Thu Oct 25 14:36:56 2018	(r339716)
+++ head/sys/dev/cxgbe/t4_ioctl.h	Thu Oct 25 14:37:26 2018	(r339717)
@@ -209,7 +209,7 @@ struct t4_filter_specification {
 	uint32_t rpttid:1;	/* report TID in RSS hash field */
 	uint32_t dirsteer:1;	/* 0 => RSS, 1 => steer to iq */
 	uint32_t iq:10;		/* ingress queue */
-	uint32_t maskhash:1;	/* dirsteer=0: store RSS hash in TCB */
+	uint32_t maskhash:1;	/* dirsteer=0: steer to an RSS sub-region */
 	uint32_t dirsteerhash:1;/* dirsteer=1: 0 => TCB contains RSS hash */
 				/*             1 => TCB contains IQ ID */
 

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Thu Oct 25 14:36:56 2018	(r339716)
+++ head/sys/dev/cxgbe/t4_main.c	Thu Oct 25 14:37:26 2018	(r339717)
@@ -4156,6 +4156,11 @@ set_params__post_init(struct adapter *sc)
 	if (t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &param, &val) == 0)
 		sc->params.port_caps32 = 1;
 
+	/* Let filter + maskhash steer to a part of the VI's RSS region. */
+	val = 1 << (G_MASKSIZE(t4_read_reg(sc, A_TP_RSS_CONFIG_TNL)) - 1);
+	t4_set_reg_field(sc, A_TP_RSS_CONFIG_TNL, V_MASKFILTER(M_MASKFILTER),
+	    V_MASKFILTER(val - 1));
+
 #ifdef TCP_OFFLOAD
 	/*
 	 * Override the TOE timers with user provided tunables.  This is not the


More information about the svn-src-all mailing list