Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275729
b: refs/heads/master
c: 00427a7
h: refs/heads/master
i:
  275727: 3445801
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Nov 17, 2011
1 parent b6274b0 commit d254f88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1cb82566242fbb54d5c655e23995a8f7bd37ecf
refs/heads/master: 00427a7387a1c91ddb6b69e50916173d8aca66e0
13 changes: 9 additions & 4 deletions trunk/drivers/net/ethernet/marvell/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,14 @@ static void rx_set_checksum(struct sky2_port *sky2)
? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM);
}

/*
* Fixed initial key as seed to RSS.
*/
static const uint32_t rss_init_key[10] = {
0x7c3351da, 0x51c5cf4e, 0x44adbdd1, 0xe8d38d18, 0x48897c43,
0xb1d60e7e, 0x6a3dd760, 0x01a2e453, 0x16f46f13, 0x1a0e7b30
};

/* Enable/disable receive hash calculation (RSS) */
static void rx_set_rss(struct net_device *dev, u32 features)
{
Expand All @@ -1290,12 +1298,9 @@ static void rx_set_rss(struct net_device *dev, u32 features)

/* Program RSS initial values */
if (features & NETIF_F_RXHASH) {
u32 key[nkeys];

get_random_bytes(key, nkeys * sizeof(u32));
for (i = 0; i < nkeys; i++)
sky2_write32(hw, SK_REG(sky2->port, RSS_KEY + i * 4),
key[i]);
rss_init_key[i]);

/* Need to turn on (undocumented) flag to make hashing work */
sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T),
Expand Down

0 comments on commit d254f88

Please sign in to comment.