From owner-freebsd-net@FreeBSD.ORG Sat Oct 11 22:21:33 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D5C24F0; Sat, 11 Oct 2014 22:21:33 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 56667EF6; Sat, 11 Oct 2014 22:21:32 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id BDE197300B; Sun, 12 Oct 2014 00:24:57 +0200 (CEST) Date: Sun, 12 Oct 2014 00:24:57 +0200 From: Luigi Rizzo To: Adrian Chadd Subject: Re: individual queue blocking entire rx unit on ixgbe (Re: How do I balance bandwidth over several virtual NICs?) Message-ID: <20141011222457.GA11694@onelab2.iet.unipi.it> References: <20141001203223.GA12122@onelab2.iet.unipi.it> <20141001234926.GC13187@onelab2.iet.unipi.it> <20141001235312.GA14593@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: "freebsd-net@freebsd.org" , Elof Ofel , "Alexander V. Chernikov" , Jack Vogel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Oct 2014 22:21:33 -0000 On Sat, Oct 11, 2014 at 03:03:13PM -0700, Adrian Chadd wrote: > Ping, > > Luigi - would you mind sending through a diff ? I'd like to get this > into -HEAD on both igb and ixgbe. here it is. As a result of this patch, ixgbe_rx_enable_drop() and the disable function become useless and should be removed. Probably the code (or the commit log) should also mention that the DROP_EN bit is only read when the rx unit is started, this is why the code should go here and not in the sysctl handler. cheers luigi Index: ixgbe.c =================================================================== --- ixgbe.c (revision 272603) +++ ixgbe.c (working copy) @@ -4377,6 +4377,19 @@ srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; srrctl |= bufsz; srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; + /* + * Set DROP_EN iff we have no flow control and >1 queue. + * Note that srrctl was cleared shortly before during reset, + * so we do not need to clear the bit, but do it just in case + * this code is moved elsewhere. + */ + if (adapter->num_queues > 1 && + adapter->hw.fc.requested_mode == ixgbe_fc_none) { + srrctl |= IXGBE_SRRCTL_DROP_EN; + } else { + srrctl &= ~IXGBE_SRRCTL_DROP_EN; + } + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); /* Setup the HW Rx Head and Tail Descriptor Pointers */