aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2011-07-20 06:20:54 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-21 15:36:15 -0400
commit9d53fa129628d4899083b06fa66b7ca10fed8eb4 (patch)
treecfe2b0fec3f5d72fa73eec6689c9ff406b4a5b32 /drivers/net/tg3.c
parent5baa5e9aa28baccd2a1227095c25bb3e999f250d (diff)
tg3: Fix RSS indirection table distribution
The current RSS indirection table is populated such that more traffic will hit the first RSS ring. This patch adjusts the indirection table so that the load is more evenly distributed. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 5110ea0be910..e5c1bc919b4d 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8723,15 +8723,24 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
8723 udelay(100); 8723 udelay(100);
8724 8724
8725 if (tg3_flag(tp, ENABLE_RSS)) { 8725 if (tg3_flag(tp, ENABLE_RSS)) {
8726 int i = 0;
8726 u32 reg = MAC_RSS_INDIR_TBL_0; 8727 u32 reg = MAC_RSS_INDIR_TBL_0;
8727 u8 *ent = (u8 *)&val;
8728 8728
8729 /* Setup the indirection table */ 8729 if (tp->irq_cnt == 2) {
8730 for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++) { 8730 for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i += 8) {
8731 int idx = i % sizeof(val); 8731 tw32(reg, 0x0);
8732 reg += 4;
8733 }
8734 } else {
8735 u32 val;
8732 8736
8733 ent[idx] = i % (tp->irq_cnt - 1); 8737 while (i < TG3_RSS_INDIR_TBL_SIZE) {
8734 if (idx == sizeof(val) - 1) { 8738 val = i % (tp->irq_cnt - 1);
8739 i++;
8740 for (; i % 8; i++) {
8741 val <<= 4;
8742 val |= (i % (tp->irq_cnt - 1));
8743 }
8735 tw32(reg, val); 8744 tw32(reg, val);
8736 reg += 4; 8745 reg += 4;
8737 } 8746 }