Skip to content

Commit 0834899

Browse files
arndbdavem330
authored andcommitted
netronome: don't access real_num_rx_queues directly
The netdev->real_num_rx_queues setting is only available if CONFIG_SYSFS is enabled, so we now get a build failure when that is turned off: netronome/nfp/nfp_net_common.c: In function 'nfp_net_ring_swap_enable': netronome/nfp/nfp_net_common.c:2489:18: error: 'struct net_device' has no member named 'real_num_rx_queues'; did you mean 'real_num_tx_queues'? As far as I can tell, the check here is only used as an optimization that we can skip in order to fix the compilation. If sysfs is disabled, the following netif_set_real_num_rx_queues() has no effect. Fixes: 164d1e9 ("nfp: add support for ethtool .set_channels") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 973334a commit 0834899

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,15 +2486,13 @@ nfp_net_ring_swap_enable(struct nfp_net *nn, unsigned int *num_vecs,
24862486
for (r = 0; r < nn->max_r_vecs; r++)
24872487
nfp_net_vector_assign_rings(nn, &nn->r_vecs[r], r);
24882488

2489-
if (nn->netdev->real_num_rx_queues != nn->num_rx_rings) {
2490-
if (!netif_is_rxfh_configured(nn->netdev))
2491-
nfp_net_rss_init_itbl(nn);
2489+
if (!netif_is_rxfh_configured(nn->netdev))
2490+
nfp_net_rss_init_itbl(nn);
24922491

2493-
err = netif_set_real_num_rx_queues(nn->netdev,
2494-
nn->num_rx_rings);
2495-
if (err)
2496-
return err;
2497-
}
2492+
err = netif_set_real_num_rx_queues(nn->netdev,
2493+
nn->num_rx_rings);
2494+
if (err)
2495+
return err;
24982496

24992497
if (nn->netdev->real_num_tx_queues != nn->num_stack_tx_rings) {
25002498
err = netif_set_real_num_tx_queues(nn->netdev,

0 commit comments

Comments
 (0)