]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/netdevice.h
net: Allow changing number of RX queues after device allocation
[mv-sheeva.git] / include / linux / netdevice.h
index f7f1302138af00e4bf2a4f6824e521c5068e175a..b15732e22eeeede81de1210f853f1a54d54cec15 100644 (file)
@@ -976,8 +976,11 @@ struct net_device {
 
        struct netdev_rx_queue  *_rx;
 
-       /* Number of RX queues allocated at alloc_netdev_mq() time  */
+       /* Number of RX queues allocated at register_netdev() time */
        unsigned int            num_rx_queues;
+
+       /* Number of RX queues currently active in device */
+       unsigned int            real_num_rx_queues;
 #endif
 
        rx_handler_func_t       *rx_handler;
@@ -1050,8 +1053,11 @@ struct net_device {
 #endif
 
        /* mid-layer private */
-       void                    *ml_priv;
-
+       union {
+               void                            *ml_priv;
+               struct pcpu_lstats __percpu     *lstats; /* loopback stats */
+               struct pcpu_tstats __percpu     *tstats; /* tunnel stats */
+       };
        /* GARP */
        struct garp_port        *garp_port;
 
@@ -1676,12 +1682,23 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
  */
 static inline int netif_is_multiqueue(const struct net_device *dev)
 {
-       return (dev->num_tx_queues > 1);
+       return dev->num_tx_queues > 1;
 }
 
 extern void netif_set_real_num_tx_queues(struct net_device *dev,
                                         unsigned int txq);
 
+#ifdef CONFIG_RPS
+extern 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)
+{
+       return 0;
+}
+#endif
+
 /* Use this variant when it is known for sure that it
  * is executing from hardware interrupt context or with hardware interrupts
  * disabled.