From owner-svn-src-head@FreeBSD.ORG Mon Jan 12 20:59:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DDB131F; Mon, 12 Jan 2015 20:59:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30998C57; Mon, 12 Jan 2015 20:59:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0CKx8r9030578; Mon, 12 Jan 2015 20:59:08 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0CKx8rd030577; Mon, 12 Jan 2015 20:59:08 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201501122059.t0CKx8rd030577@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Mon, 12 Jan 2015 20:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277088 - head/sys/dev/ixl X-SVN-Group: head 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.18-1 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: Mon, 12 Jan 2015 20:59:08 -0000 Author: jfv Date: Mon Jan 12 20:59:07 2015 New Revision: 277088 URL: https://svnweb.freebsd.org/changeset/base/277088 Log: Missing RSS support added, this fixes the build, but the code in the RX side was complicated by recent changes and will need some further tweaking. Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Mon Jan 12 20:27:06 2015 (r277087) +++ head/sys/dev/ixl/ixl_txrx.c Mon Jan 12 20:59:07 2015 (r277088) @@ -65,14 +65,33 @@ ixl_mq_start(struct ifnet *ifp, struct m struct ixl_queue *que; struct tx_ring *txr; int err, i; +#ifdef RSS + u32 bucket_id; +#endif - /* Which queue to use */ - if ((m->m_flags & M_FLOWID) != 0) - i = m->m_pkthdr.flowid % vsi->num_queues; - else + /* + ** Which queue to use: + ** + ** When doing RSS, map it to the same outbound + ** queue as the incoming flow would be mapped to. + ** If everything is setup correctly, it should be + ** the same bucket that the current CPU we're on is. + */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { +#ifdef RSS + if (rss_hash2bucket(m->m_pkthdr.flowid, + M_HASHTYPE_GET(m), &bucket_id) == 0) { + i = bucket_id % vsi->num_queues; + } else +#endif + i = m->m_pkthdr.flowid % vsi->num_queues; + } else i = curcpu % vsi->num_queues; - - /* Check for a hung queue and pick alternative */ + /* + ** This may not be perfect, but until something + ** better comes along it will keep from scheduling + ** on stalled queues. + */ if (((1 << i) & vsi->active_queues) == 0) i = ffsl(vsi->active_queues); @@ -1542,8 +1561,11 @@ ixl_rxeof(struct ixl_queue *que, int cou rxr->bytes += sendmp->m_pkthdr.len; if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) ixl_rx_checksum(sendmp, status, error, ptype); +#ifdef RSS + /* XXX Work in Progress, fix the build for now */ +#endif sendmp->m_pkthdr.flowid = que->msix; - sendmp->m_flags |= M_FLOWID; + M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE); } next_desc: bus_dmamap_sync(rxr->dma.tag, rxr->dma.map,