Skip to contentSkip to conversation

tg3: Nullify RSS for loopback test

PATCH In review Matt Carlson 1 participant 1 message Apr 20, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/9 tg3: Nullify RSS for loopback test

The loopback test assumes all traffic goes to the first rx queue. There is a 1 in 4 chance this won't be true if RSS is enabled though. This patch reprograms the RSS indirection table to route all rx packets to the first queue.

---
 drivers/net/tg3.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/net/tg3.c +9 -0
index 4aecb0a..1f233c4 100644
@@ -11269,6 +11269,15 @@ static int tg3_test_loopback(struct tg3 *tp)
 		goto done;
 	}
 
+	if (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) {
+		int i;
+
+		/* Reroute all rx packets to the 1st queue */
+		for (i = MAC_RSS_INDIR_TBL_0;
+		     i < MAC_RSS_INDIR_TBL_0 + TG3_RSS_INDIR_TBL_SIZE; i += 4)
+			tw32(i, 0x0);
+	}
+
 	/* Turn off gphy autopowerdown. */
 	if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
 		tg3_phy_toggle_apd(tp, false);
Signature · 1 line
1.7.3.4