We used to depend on real_num_rx_queues as a upper bound for sanity
checks.  For AF_XDP it's useful if drivers can trust the stack never
to try to install UMEM for queues which are not configured.  Update
dev->real_num_rx_queues even without sysfs compiled, otherwise it
would always stay equal dev->num_rx_queues.

Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com>
Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com>
---
 include/linux/netdevice.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c1295c7a452e..6717dc7e8fbf 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3433,6 +3433,7 @@ int netif_set_real_num_rx_queues(struct net_device *dev, 
unsigned int rxq);
 static inline int netif_set_real_num_rx_queues(struct net_device *dev,
                                                unsigned int rxq)
 {
+       dev->real_num_rx_queues = rxqs;
        return 0;
 }
 #endif
-- 
2.17.1

Reply via email to