diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-12-17 19:04:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 20:15:26 -0500 |
commit | 8376d0bccde3cf739649ea8559f7bedb4b5583b7 (patch) | |
tree | 1dd7f238e66f77efd1f6f36c33173233049c74b5 | |
parent | 6582c665d6b882dad8329e05749fbcf119f1ab88 (diff) |
bnx2x: use prandom_bytes()
Use prandom_bytes() to fill rss key with pseudo-random bytes.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: David Laight <david.laight@aculab.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Michel Lespinasse <walken@google.com>
Cc: Robert Love <robert.w.love@intel.com>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index a2998bea5d4b..01588b66a38c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -1832,7 +1832,6 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, | |||
1832 | bool config_hash) | 1832 | bool config_hash) |
1833 | { | 1833 | { |
1834 | struct bnx2x_config_rss_params params = {NULL}; | 1834 | struct bnx2x_config_rss_params params = {NULL}; |
1835 | int i; | ||
1836 | 1835 | ||
1837 | /* Although RSS is meaningless when there is a single HW queue we | 1836 | /* Although RSS is meaningless when there is a single HW queue we |
1838 | * still need it enabled in order to have HW Rx hash generated. | 1837 | * still need it enabled in order to have HW Rx hash generated. |
@@ -1864,9 +1863,7 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, | |||
1864 | 1863 | ||
1865 | if (config_hash) { | 1864 | if (config_hash) { |
1866 | /* RSS keys */ | 1865 | /* RSS keys */ |
1867 | for (i = 0; i < sizeof(params.rss_key) / 4; i++) | 1866 | prandom_bytes(params.rss_key, sizeof(params.rss_key)); |
1868 | params.rss_key[i] = random32(); | ||
1869 | |||
1870 | __set_bit(BNX2X_RSS_SET_SRCH, ¶ms.rss_flags); | 1867 | __set_bit(BNX2X_RSS_SET_SRCH, ¶ms.rss_flags); |
1871 | } | 1868 | } |
1872 | 1869 | ||