Skip to content

Commit a57fe23

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
igb: Simplify how we populate the RSS key
Instead of storing the RSS key as a character array we can simplify the configuration by making it a u32 array. This allows us to just write one value per register without any unnecessary operations to construct the value. This change will produce the same exact key, the only difference is that I translated the u8 array to a u32 array which will be correctly ordered on writes to hardware by the cpu_to_le32 operations that are built into the writel calls. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 797fd4b commit a57fe23

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,20 +2835,14 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
28352835
struct e1000_hw *hw = &adapter->hw;
28362836
u32 mrqc, rxcsum;
28372837
u32 j, num_rx_queues, shift = 0;
2838-
static const u8 rsshash[40] = {
2839-
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, 0x41, 0x67,
2840-
0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, 0xd0, 0xca, 0x2b, 0xcb,
2841-
0xae, 0x7b, 0x30, 0xb4, 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30,
2842-
0xf2, 0x0c, 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa };
2838+
static const u32 rsskey[10] = { 0xDA565A6D, 0xC20E5B25, 0x3D256741,
2839+
0xB08FA343, 0xCB2BCAD0, 0xB4307BAE,
2840+
0xA32DCB77, 0x0CF23080, 0x3BB7426A,
2841+
0xFA01ACBE };
28432842

28442843
/* Fill out hash function seeds */
2845-
for (j = 0; j < 10; j++) {
2846-
u32 rsskey = rsshash[(j * 4)];
2847-
rsskey |= rsshash[(j * 4) + 1] << 8;
2848-
rsskey |= rsshash[(j * 4) + 2] << 16;
2849-
rsskey |= rsshash[(j * 4) + 3] << 24;
2850-
array_wr32(E1000_RSSRK(0), j, rsskey);
2851-
}
2844+
for (j = 0; j < 10; j++)
2845+
wr32(E1000_RSSRK(j), rsskey[j]);
28522846

28532847
num_rx_queues = adapter->rss_queues;
28542848

0 commit comments

Comments
 (0)