From owner-svn-src-all@FreeBSD.ORG Wed Jul 23 05:40:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5223E5DA; Wed, 23 Jul 2014 05:40:29 +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 3F10920D5; Wed, 23 Jul 2014 05:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6N5eTiW040877; Wed, 23 Jul 2014 05:40:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6N5eTDS040876; Wed, 23 Jul 2014 05:40:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407230540.s6N5eTDS040876@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Jul 2014 05:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269009 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2014 05:40:29 -0000 Author: adrian Date: Wed Jul 23 05:40:28 2014 New Revision: 269009 URL: http://svnweb.freebsd.org/changeset/base/269009 Log: Fix the igb(4) redirection table to correctly populate. This is similar to the ixgbe(4) fix. Tested: * Intel I350 gigabit adapter Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Jul 23 04:28:51 2014 (r269008) +++ head/sys/dev/e1000/if_igb.c Wed Jul 23 05:40:28 2014 (r269009) @@ -4569,12 +4569,8 @@ igb_initialise_rss_mapping(struct adapte struct e1000_hw *hw = &adapter->hw; int i; int queue_id; - + u32 reta; u32 rss_key[10], mrqc, shift = 0; - union igb_reta { - u32 dword; - u8 bytes[4]; - } reta; /* XXX? */ if (adapter->hw.mac.type == e1000_82575) @@ -4594,6 +4590,7 @@ igb_initialise_rss_mapping(struct adapte */ /* Warning FM follows */ + reta = 0; for (i = 0; i < 128; i++) { #ifdef RSS queue_id = rss_get_indirection_to_bucket(i); @@ -4614,14 +4611,21 @@ igb_initialise_rss_mapping(struct adapte #else queue_id = (i % adapter->num_queues); #endif - reta.bytes[i & 3] = queue_id << shift; + /* Adjust if required */ + queue_id = queue_id << shift; - if ((i & 3) == 3) - E1000_WRITE_REG(hw, - E1000_RETA(i >> 2), reta.dword); + /* + * The low 8 bits are for hash value (n+0); + * The next 8 bits are for hash value (n+1), etc. + */ + reta = reta >> 8; + reta = reta | ( ((uint32_t) queue_id) << 24); + if ((i & 3) == 3) { + E1000_WRITE_REG(hw, E1000_RETA(i >> 2), reta); + reta = 0; + } } - /* Now fill in hash table */ /* XXX This means RSS enable + 8 queues for my igb (82580.) */