Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netdev: Move next_sched into struct netdev_queue.

We schedule queues, not the device, for output queue processing in BH.

Signed-off-by: David S. Miller <davem@davemloft.net>

+9 -11
+2 -3
include/linux/netdevice.h
··· 454 454 struct Qdisc *qdisc; 455 455 struct Qdisc *qdisc_sleeping; 456 456 struct list_head qdisc_list; 457 + struct netdev_queue *next_sched; 457 458 }; 458 459 459 460 /* ··· 545 544 #define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM) 546 545 #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) 547 546 #define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) 548 - 549 - struct net_device *next_sched; 550 547 551 548 /* Interface index. Unique device identifier */ 552 549 int ifindex; ··· 939 940 */ 940 941 struct softnet_data 941 942 { 942 - struct net_device *output_queue; 943 + struct netdev_queue *output_queue; 943 944 struct sk_buff_head input_pkt_queue; 944 945 struct list_head poll_list; 945 946 struct sk_buff *completion_queue;
+7 -8
net/core/dev.c
··· 1323 1323 void __netif_schedule(struct net_device *dev) 1324 1324 { 1325 1325 if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) { 1326 + struct netdev_queue *txq = &dev->tx_queue; 1326 1327 unsigned long flags; 1327 1328 struct softnet_data *sd; 1328 1329 1329 1330 local_irq_save(flags); 1330 1331 sd = &__get_cpu_var(softnet_data); 1331 - dev->next_sched = sd->output_queue; 1332 - sd->output_queue = dev; 1332 + txq->next_sched = sd->output_queue; 1333 + sd->output_queue = txq; 1333 1334 raise_softirq_irqoff(NET_TX_SOFTIRQ); 1334 1335 local_irq_restore(flags); 1335 1336 } ··· 1913 1912 } 1914 1913 1915 1914 if (sd->output_queue) { 1916 - struct net_device *head; 1915 + struct netdev_queue *head; 1917 1916 1918 1917 local_irq_disable(); 1919 1918 head = sd->output_queue; ··· 1921 1920 local_irq_enable(); 1922 1921 1923 1922 while (head) { 1924 - struct net_device *dev = head; 1925 - struct netdev_queue *txq; 1923 + struct netdev_queue *txq = head; 1924 + struct net_device *dev = txq->dev; 1926 1925 head = head->next_sched; 1927 - 1928 - txq = &dev->tx_queue; 1929 1926 1930 1927 smp_mb__before_clear_bit(); 1931 1928 clear_bit(__LINK_STATE_SCHED, &dev->state); ··· 4345 4346 void *ocpu) 4346 4347 { 4347 4348 struct sk_buff **list_skb; 4348 - struct net_device **list_net; 4349 + struct netdev_queue **list_net; 4349 4350 struct sk_buff *skb; 4350 4351 unsigned int cpu, oldcpu = (unsigned long)ocpu; 4351 4352 struct softnet_data *sd, *oldsd;