Skip to content

Commit

Permalink
ethtool: Declare netdev_rss_key as __read_mostly.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Alan Carey <[email protected]>
Acked-by: Rami Rosen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kimmariejones authored and davem330 committed Feb 6, 2016
1 parent ef44967 commit ba905f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -3744,7 +3744,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,
Expand Down
2 changes: 1 addition & 1 deletion net/core/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit ba905f5

Please sign in to comment.