Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2014 05:40:29 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269009 - head/sys/dev/e1000
Message-ID:  <201407230540.s6N5eTDS040876@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.) */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407230540.s6N5eTDS040876>