Skip to content

Commit 1e9e10d

Browse files
Jakub Kicinskidavem330
authored andcommitted
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: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e31230f commit 1e9e10d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net_common.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,15 @@ static void nfp_net_set_rx_mode(struct net_device *netdev)
22292229
nn->ctrl = new_ctrl;
22302230
}
22312231

2232+
static void nfp_net_rss_init_itbl(struct nfp_net *nn)
2233+
{
2234+
int i;
2235+
2236+
for (i = 0; i < sizeof(nn->rss_itbl); i++)
2237+
nn->rss_itbl[i] =
2238+
ethtool_rxfh_indir_default(i, nn->num_rx_rings);
2239+
}
2240+
22322241
static int
22332242
nfp_net_ring_swap_enable(struct nfp_net *nn,
22342243
struct nfp_net_ring_set *rx,
@@ -2707,13 +2716,9 @@ void nfp_net_netdev_free(struct nfp_net *nn)
27072716
*/
27082717
static void nfp_net_rss_init(struct nfp_net *nn)
27092718
{
2710-
int i;
2711-
27122719
netdev_rss_key_fill(nn->rss_key, NFP_NET_CFG_RSS_KEY_SZ);
27132720

2714-
for (i = 0; i < sizeof(nn->rss_itbl); i++)
2715-
nn->rss_itbl[i] =
2716-
ethtool_rxfh_indir_default(i, nn->num_rx_rings);
2721+
nfp_net_rss_init_itbl(nn);
27172722

27182723
/* Enable IPv4/IPv6 TCP by default */
27192724
nn->rss_cfg = NFP_NET_CFG_RSS_IPV4_TCP |

0 commit comments

Comments
 (0)