Commit 1e9e10d0 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: move RSS indirection table init into a separate function

We will need to rerun the initialization of the RSS indirection table
after the number of rings is changed.  Move the code to a separate
function.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e31230f9
...@@ -2229,6 +2229,15 @@ static void nfp_net_set_rx_mode(struct net_device *netdev) ...@@ -2229,6 +2229,15 @@ static void nfp_net_set_rx_mode(struct net_device *netdev)
nn->ctrl = new_ctrl; nn->ctrl = new_ctrl;
} }
static void nfp_net_rss_init_itbl(struct nfp_net *nn)
{
int i;
for (i = 0; i < sizeof(nn->rss_itbl); i++)
nn->rss_itbl[i] =
ethtool_rxfh_indir_default(i, nn->num_rx_rings);
}
static int static int
nfp_net_ring_swap_enable(struct nfp_net *nn, nfp_net_ring_swap_enable(struct nfp_net *nn,
struct nfp_net_ring_set *rx, struct nfp_net_ring_set *rx,
...@@ -2707,13 +2716,9 @@ void nfp_net_netdev_free(struct nfp_net *nn) ...@@ -2707,13 +2716,9 @@ void nfp_net_netdev_free(struct nfp_net *nn)
*/ */
static void nfp_net_rss_init(struct nfp_net *nn) static void nfp_net_rss_init(struct nfp_net *nn)
{ {
int i;
netdev_rss_key_fill(nn->rss_key, NFP_NET_CFG_RSS_KEY_SZ); netdev_rss_key_fill(nn->rss_key, NFP_NET_CFG_RSS_KEY_SZ);
for (i = 0; i < sizeof(nn->rss_itbl); i++) nfp_net_rss_init_itbl(nn);
nn->rss_itbl[i] =
ethtool_rxfh_indir_default(i, nn->num_rx_rings);
/* Enable IPv4/IPv6 TCP by default */ /* Enable IPv4/IPv6 TCP by default */
nn->rss_cfg = NFP_NET_CFG_RSS_IPV4_TCP | nn->rss_cfg = NFP_NET_CFG_RSS_IPV4_TCP |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment