All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH 5/6] sky2: used fixed RSS key
Date: Wed, 16 Nov 2011 15:42:59 -0800	[thread overview]
Message-ID: <20111116234344.909500366@vyatta.com> (raw)
In-Reply-To: 20111116234254.319625694@vyatta.com

[-- Attachment #1: sky2-fixed-key.patch --]
[-- Type: text/plain, Size: 1294 bytes --]

Rather than generating a different RSS key on each boot, just use
a predetermined value that will map same flow to same value on
every device.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/ethernet/marvell/sky2.c	2011-11-16 15:19:40.990692544 -0800
+++ b/drivers/net/ethernet/marvell/sky2.c	2011-11-16 15:19:42.254721076 -0800
@@ -1275,6 +1275,14 @@ static void rx_set_checksum(struct 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)
 {
@@ -1290,12 +1298,9 @@ static void rx_set_rss(struct net_device
 
 	/* 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),

  parent reply	other threads:[~2011-11-16 23:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 23:42 [PATCH 0/6] sky2 patches for net-next Stephen Hemminger
2011-11-16 23:42 ` [PATCH 1/6] sky2: fix hang on shutdown (and other irq issues) Stephen Hemminger
2011-11-17  8:46   ` Sven Joachim
2011-11-17 17:01     ` Stephen Hemminger
2011-11-17 18:37       ` Sven Joachim
2011-11-17 19:18         ` Stephen Hemminger
2011-11-17 20:57           ` Sven Joachim
2011-11-18  0:37     ` [PATCH net-next] sky2: fix hang in napi_disable Stephen Hemminger
2011-11-18  1:52       ` David Miller
2011-11-18  2:10         ` Stephen Hemminger
2011-11-18  2:15           ` David Miller
2011-11-18  2:44       ` David Miller
2011-11-16 23:42 ` [PATCH 2/6] sky2: pci posting issues Stephen Hemminger
2011-11-16 23:42 ` [PATCH 3/6] sky2: rename up/down functions Stephen Hemminger
2011-11-16 23:42 ` [PATCH 4/6] sky2: reduce default Tx ring size Stephen Hemminger
2011-11-17 21:07   ` Sven Joachim
2011-11-17 22:41     ` Stephen Hemminger
2011-11-18  0:37     ` [PATCH net-next] sky2: enforce minimum " Stephen Hemminger
2011-11-18  2:44       ` David Miller
2011-11-16 23:42 ` Stephen Hemminger [this message]
2011-11-16 23:43 ` [PATCH 6/6] sky2: version 1.30 Stephen Hemminger
2011-11-17  1:36 ` [PATCH 0/6] sky2 patches for net-next David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111116234344.909500366@vyatta.com \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.