diff options
author | David S. Miller <davem@davemloft.net> | 2014-07-16 17:09:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-16 17:09:34 -0400 |
commit | 1a98c69af1ecd97bfd1f4e4539924a9192434e36 (patch) | |
tree | a243defcf921ea174f8e43fce11d06830a6a9c36 /net/core/dev.c | |
parent | 7a575f6b907ea5d207d2b5010293c189616eae34 (diff) | |
parent | b6603fe574af289dbe9eb9fb4c540bca04f5a053 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 2c98f10ee62a..138ab897de7d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -148,6 +148,9 @@ struct list_head ptype_all __read_mostly; /* Taps */ | |||
148 | static struct list_head offload_base __read_mostly; | 148 | static struct list_head offload_base __read_mostly; |
149 | 149 | ||
150 | static int netif_rx_internal(struct sk_buff *skb); | 150 | static int netif_rx_internal(struct sk_buff *skb); |
151 | static int call_netdevice_notifiers_info(unsigned long val, | ||
152 | struct net_device *dev, | ||
153 | struct netdev_notifier_info *info); | ||
151 | 154 | ||
152 | /* | 155 | /* |
153 | * The @dev_base_head list is protected by @dev_base_lock and the rtnl | 156 | * The @dev_base_head list is protected by @dev_base_lock and the rtnl |
@@ -1214,7 +1217,11 @@ EXPORT_SYMBOL(netdev_features_change); | |||
1214 | void netdev_state_change(struct net_device *dev) | 1217 | void netdev_state_change(struct net_device *dev) |
1215 | { | 1218 | { |
1216 | if (dev->flags & IFF_UP) { | 1219 | if (dev->flags & IFF_UP) { |
1217 | call_netdevice_notifiers(NETDEV_CHANGE, dev); | 1220 | struct netdev_notifier_change_info change_info; |
1221 | |||
1222 | change_info.flags_changed = 0; | ||
1223 | call_netdevice_notifiers_info(NETDEV_CHANGE, dev, | ||
1224 | &change_info.info); | ||
1218 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0, GFP_KERNEL); | 1225 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0, GFP_KERNEL); |
1219 | } | 1226 | } |
1220 | } | 1227 | } |
@@ -4234,9 +4241,8 @@ static int process_backlog(struct napi_struct *napi, int quota) | |||
4234 | #endif | 4241 | #endif |
4235 | napi->weight = weight_p; | 4242 | napi->weight = weight_p; |
4236 | local_irq_disable(); | 4243 | local_irq_disable(); |
4237 | while (work < quota) { | 4244 | while (1) { |
4238 | struct sk_buff *skb; | 4245 | struct sk_buff *skb; |
4239 | unsigned int qlen; | ||
4240 | 4246 | ||
4241 | while ((skb = __skb_dequeue(&sd->process_queue))) { | 4247 | while ((skb = __skb_dequeue(&sd->process_queue))) { |
4242 | local_irq_enable(); | 4248 | local_irq_enable(); |
@@ -4250,24 +4256,24 @@ static int process_backlog(struct napi_struct *napi, int quota) | |||
4250 | } | 4256 | } |
4251 | 4257 | ||
4252 | rps_lock(sd); | 4258 | rps_lock(sd); |
4253 | qlen = skb_queue_len(&sd->input_pkt_queue); | 4259 | if (skb_queue_empty(&sd->input_pkt_queue)) { |
4254 | if (qlen) | ||
4255 | skb_queue_splice_tail_init(&sd->input_pkt_queue, | ||
4256 | &sd->process_queue); | ||
4257 | |||
4258 | if (qlen < quota - work) { | ||
4259 | /* | 4260 | /* |
4260 | * Inline a custom version of __napi_complete(). | 4261 | * Inline a custom version of __napi_complete(). |
4261 | * only current cpu owns and manipulates this napi, | 4262 | * only current cpu owns and manipulates this napi, |
4262 | * and NAPI_STATE_SCHED is the only possible flag set on backlog. | 4263 | * and NAPI_STATE_SCHED is the only possible flag set |
4263 | * we can use a plain write instead of clear_bit(), | 4264 | * on backlog. |
4265 | * We can use a plain write instead of clear_bit(), | ||
4264 | * and we dont need an smp_mb() memory barrier. | 4266 | * and we dont need an smp_mb() memory barrier. |
4265 | */ | 4267 | */ |
4266 | list_del(&napi->poll_list); | 4268 | list_del(&napi->poll_list); |
4267 | napi->state = 0; | 4269 | napi->state = 0; |
4270 | rps_unlock(sd); | ||
4268 | 4271 | ||
4269 | quota = work + qlen; | 4272 | break; |
4270 | } | 4273 | } |
4274 | |||
4275 | skb_queue_splice_tail_init(&sd->input_pkt_queue, | ||
4276 | &sd->process_queue); | ||
4271 | rps_unlock(sd); | 4277 | rps_unlock(sd); |
4272 | } | 4278 | } |
4273 | local_irq_enable(); | 4279 | local_irq_enable(); |