Commit 9d53fa12 authored by Matt Carlson's avatar Matt Carlson Committed by David S. Miller

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: default avatarMatt Carlson <mcarlson@broadcom.com>
Reviewed-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5baa5e9a
...@@ -8723,15 +8723,24 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) ...@@ -8723,15 +8723,24 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
udelay(100); udelay(100);
if (tg3_flag(tp, ENABLE_RSS)) { if (tg3_flag(tp, ENABLE_RSS)) {
int i = 0;
u32 reg = MAC_RSS_INDIR_TBL_0; u32 reg = MAC_RSS_INDIR_TBL_0;
u8 *ent = (u8 *)&val;
/* Setup the indirection table */ if (tp->irq_cnt == 2) {
for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++) { for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i += 8) {
int idx = i % sizeof(val); tw32(reg, 0x0);
reg += 4;
}
} else {
u32 val;
ent[idx] = i % (tp->irq_cnt - 1); while (i < TG3_RSS_INDIR_TBL_SIZE) {
if (idx == sizeof(val) - 1) { val = i % (tp->irq_cnt - 1);
i++;
for (; i % 8; i++) {
val <<= 4;
val |= (i % (tp->irq_cnt - 1));
}
tw32(reg, val); tw32(reg, val);
reg += 4; reg += 4;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment