From owner-svn-src-head@freebsd.org Thu Oct 25 14:37:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D371078F0B; Thu, 25 Oct 2018 14:37:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2B1186135; Thu, 25 Oct 2018 14:37:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9985313264; Thu, 25 Oct 2018 14:37:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PEbRFS047605; Thu, 25 Oct 2018 14:37:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PEbRVe047601; Thu, 25 Oct 2018 14:37:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810251437.w9PEbRVe047601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Oct 2018 14:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339717 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 339717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 14:37:28 -0000 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, ¶m, &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