diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index a3ab11f34153..434220d093aa 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1080,6 +1080,70 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) | |||
1080 | rcu_read_unlock(); | 1080 | rcu_read_unlock(); |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | |||
1084 | void __netif_schedule(struct net_device *dev) | ||
1085 | { | ||
1086 | if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) { | ||
1087 | unsigned long flags; | ||
1088 | struct softnet_data *sd; | ||
1089 | |||
1090 | local_irq_save(flags); | ||
1091 | sd = &__get_cpu_var(softnet_data); | ||
1092 | dev->next_sched = sd->output_queue; | ||
1093 | sd->output_queue = dev; | ||
1094 | raise_softirq_irqoff(NET_TX_SOFTIRQ); | ||
1095 | local_irq_restore(flags); | ||
1096 | } | ||
1097 | } | ||
1098 | EXPORT_SYMBOL(__netif_schedule); | ||
1099 | |||
1100 | void __netif_rx_schedule(struct net_device *dev) | ||
1101 | { | ||
1102 | unsigned long flags; | ||
1103 | |||
1104 | local_irq_save(flags); | ||
1105 | dev_hold(dev); | ||
1106 | list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); | ||
1107 | if (dev->quota < 0) | ||
1108 | dev->quota += dev->weight; | ||
1109 | else | ||
1110 | dev->quota = dev->weight; | ||
1111 | __raise_softirq_irqoff(NET_RX_SOFTIRQ); | ||
1112 | local_irq_restore(flags); | ||
1113 | } | ||
1114 | EXPORT_SYMBOL(__netif_rx_schedule); | ||
1115 | |||
1116 | void dev_kfree_skb_any(struct sk_buff *skb) | ||
1117 | { | ||
1118 | if (in_irq() || irqs_disabled()) | ||
1119 | dev_kfree_skb_irq(skb); | ||
1120 | else | ||
1121 | dev_kfree_skb(skb); | ||
1122 | } | ||
1123 | EXPORT_SYMBOL(dev_kfree_skb_any); | ||
1124 | |||
1125 | |||
1126 | /* Hot-plugging. */ | ||
1127 | void netif_device_detach(struct net_device *dev) | ||
1128 | { | ||
1129 | if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) && | ||
1130 | netif_running(dev)) { | ||
1131 | netif_stop_queue(dev); | ||
1132 | } | ||
1133 | } | ||
1134 | EXPORT_SYMBOL(netif_device_detach); | ||
1135 | |||
1136 | void netif_device_attach(struct net_device *dev) | ||
1137 | { | ||
1138 | if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && | ||
1139 | netif_running(dev)) { | ||
1140 | netif_wake_queue(dev); | ||
1141 | __netdev_watchdog_up(dev); | ||
1142 | } | ||
1143 | } | ||
1144 | EXPORT_SYMBOL(netif_device_attach); | ||
1145 | |||
1146 | |||
1083 | /* | 1147 | /* |
1084 | * Invalidate hardware checksum when packet is to be mangled, and | 1148 | * Invalidate hardware checksum when packet is to be mangled, and |
1085 | * complete checksum manually on outgoing path. | 1149 | * complete checksum manually on outgoing path. |