net: update real_num_rx_queues even when !CONFIG_SYSFS
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 31 Jul 2018 03:43:51 +0000 (20:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Jul 2018 16:48:21 +0000 (09:48 -0700)
We used to depend on real_num_rx_queues as a upper bound for sanity
checks.  For AF_XDP socket validation it's useful if the check behaves
the same regardless of CONFIG_SYSFS setting.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h

index 9c917467a2c75d54b754195fdb2f4f3f207c57ce..3bf7e93c9e96816ce9a82ac25c6eb069a78e760b 100644 (file)
@@ -3431,8 +3431,9 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
 int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
 #else
 static inline int netif_set_real_num_rx_queues(struct net_device *dev,
-                                               unsigned int rxq)
+                                               unsigned int rxqs)
 {
+       dev->real_num_rx_queues = rxqs;
        return 0;
 }
 #endif