* [PATCH net-next] sky2: use new netdev_rss_key_fill() helper
@ 2014-11-19 9:06 Ian Morris
2014-11-19 15:28 ` Eric Dumazet
2014-11-19 22:04 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Ian Morris @ 2014-11-19 9:06 UTC (permalink / raw)
To: netdev; +Cc: Ian Morris, Mirko Lindner, Stephen Hemminger, Eric Dumazet
Switch to a random RSS key rather than a fixed one.
Using netdev_rss_key_fill helper also ensures that all ports share
a common key.
See also commit 960fb622f85180f36d3aff82af53e2be3db2f888.
Signed-off-by: Ian Morris <ipm@chirality.org.uk>
Cc: Mirko Lindner <mlindner@marvell.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Eric Dumazet <edumazet@google.com>
---
drivers/net/ethernet/marvell/sky2.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index bd33662..53a1cc5 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -1290,14 +1290,6 @@ 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, netdev_features_t features)
{
@@ -1313,9 +1305,12 @@ static void rx_set_rss(struct net_device *dev, netdev_features_t features)
/* Program RSS initial values */
if (features & NETIF_F_RXHASH) {
+ u32 rss_key[10];
+
+ netdev_rss_key_fill(rss_key, sizeof(rss_key));
for (i = 0; i < nkeys; i++)
sky2_write32(hw, SK_REG(sky2->port, RSS_KEY + i * 4),
- rss_init_key[i]);
+ rss_key[i]);
/* Need to turn on (undocumented) flag to make hashing work */
sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T),
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] sky2: use new netdev_rss_key_fill() helper
2014-11-19 9:06 [PATCH net-next] sky2: use new netdev_rss_key_fill() helper Ian Morris
@ 2014-11-19 15:28 ` Eric Dumazet
2014-11-19 22:04 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2014-11-19 15:28 UTC (permalink / raw)
To: Ian Morris; +Cc: netdev, Mirko Lindner, Stephen Hemminger, Eric Dumazet
On Wed, 2014-11-19 at 09:06 +0000, Ian Morris wrote:
> Switch to a random RSS key rather than a fixed one.
> Using netdev_rss_key_fill helper also ensures that all ports share
> a common key.
>
> See also commit 960fb622f85180f36d3aff82af53e2be3db2f888.
>
> Signed-off-by: Ian Morris <ipm@chirality.org.uk>
> Cc: Mirko Lindner <mlindner@marvell.com>
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Eric Dumazet <edumazet@google.com>
> ---
> drivers/net/ethernet/marvell/sky2.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
Nice catch, this one escaped from my scan ;)
(Another one is in drivers/net/ethernet/cisco/enic/enic_main.c )
Acked-by: Eric Dumazet <edumazet@google.com>
Nit : When referring a commit, use 12 digit sha1 followed by patch
title.
In this particular case you could have say :
See also commit 960fb622f851 ("net: provide a per host RSS key generic
infrastructure").
Or something like that.
Thanks Ian !
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] sky2: use new netdev_rss_key_fill() helper
2014-11-19 9:06 [PATCH net-next] sky2: use new netdev_rss_key_fill() helper Ian Morris
2014-11-19 15:28 ` Eric Dumazet
@ 2014-11-19 22:04 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-11-19 22:04 UTC (permalink / raw)
To: ipm; +Cc: netdev, mlindner, stephen, edumazet
From: Ian Morris <ipm@chirality.org.uk>
Date: Wed, 19 Nov 2014 09:06:51 +0000
> Switch to a random RSS key rather than a fixed one.
> Using netdev_rss_key_fill helper also ensures that all ports share
> a common key.
>
> See also commit 960fb622f85180f36d3aff82af53e2be3db2f888.
>
> Signed-off-by: Ian Morris <ipm@chirality.org.uk>
Applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-19 22:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 9:06 [PATCH net-next] sky2: use new netdev_rss_key_fill() helper Ian Morris
2014-11-19 15:28 ` Eric Dumazet
2014-11-19 22:04 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).