All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ethtool: Declare netdev_rss_key as __read_mostly.
@ 2016-02-02  3:51 Kim Jones
  2016-02-06  8:14 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kim Jones @ 2016-02-02  3:51 UTC (permalink / raw)
  To: davem, netdev; +Cc: Kim Jones, Alan Carey

netdev_rss_key is written to once and thereafter is read by
drivers when they are initialising. The fact that it is mostly
read and not written to makes it a candidate for a __read_mostly
declaration.

Signed-off-by: Kim Jones <kim-marie.jones@intel.com>
Signed-off-by: Alan Carey <alan.carey@intel.com>
Acked-by: Rami Rosen <rami.rosen@intel.com>
---
 include/linux/netdevice.h | 2 +-
 net/core/ethtool.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5ac140d..ec184a2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3742,7 +3742,7 @@ void netdev_lower_state_changed(struct net_device *lower_dev,
 
 /* RSS keys are 40 or 52 bytes long */
 #define NETDEV_RSS_KEY_LEN 52
-extern u8 netdev_rss_key[NETDEV_RSS_KEY_LEN];
+extern u8 netdev_rss_key[NETDEV_RSS_KEY_LEN] __read_mostly;
 void netdev_rss_key_fill(void *buffer, size_t len);
 
 int dev_get_nest_level(struct net_device *dev,
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index daf0470..453c803 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -632,7 +632,7 @@ static int ethtool_copy_validate_indir(u32 *indir, void __user *useraddr,
 	return 0;
 }
 
-u8 netdev_rss_key[NETDEV_RSS_KEY_LEN];
+u8 netdev_rss_key[NETDEV_RSS_KEY_LEN] __read_mostly;
 
 void netdev_rss_key_fill(void *buffer, size_t len)
 {
-- 
2.1.0

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ethtool: Declare netdev_rss_key as __read_mostly.
  2016-02-02  3:51 [PATCH net-next] ethtool: Declare netdev_rss_key as __read_mostly Kim Jones
@ 2016-02-06  8:14 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-02-06  8:14 UTC (permalink / raw)
  To: kim-marie.jones; +Cc: netdev, alan.carey

From: Kim Jones <kim-marie.jones@intel.com>
Date: Tue,  2 Feb 2016 03:51:16 +0000

> netdev_rss_key is written to once and thereafter is read by
> drivers when they are initialising. The fact that it is mostly
> read and not written to makes it a candidate for a __read_mostly
> declaration.
> 
> Signed-off-by: Kim Jones <kim-marie.jones@intel.com>
> Signed-off-by: Alan Carey <alan.carey@intel.com>
> Acked-by: Rami Rosen <rami.rosen@intel.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-06  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-02  3:51 [PATCH net-next] ethtool: Declare netdev_rss_key as __read_mostly Kim Jones
2016-02-06  8:14 ` David Miller

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.