aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-11 02:56:33 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-11 02:56:33 -0400
commit04c9f416e371cff076a8b3279fb213628915d059 (patch)
tree2b64cb835cbc9d19d2d06f1e7618615d40ada0af /net/core
parentc278fa53c123282f753b2264fc62c0e9502a32fa (diff)
parentc1f5163de417dab01fa9daaf09a74bbb19303f3c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: net/batman-adv/bridge_loop_avoidance.c net/batman-adv/bridge_loop_avoidance.h net/batman-adv/soft-interface.c net/mac80211/mlme.c With merge help from Antonio Quartulli (batman-adv) and Stephen Rothwell (drivers/net/usb/qmi_wwan.c). The net/mac80211/mlme.c conflict seemed easy enough, accounting for a conversion to some new tracing macros. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c8
-rw-r--r--net/core/netprio_cgroup.c7
2 files changed, 10 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 5ab6f4b37c0c..73e87c7b4377 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2457,8 +2457,12 @@ static void skb_update_prio(struct sk_buff *skb)
2457{ 2457{
2458 struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap); 2458 struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap);
2459 2459
2460 if ((!skb->priority) && (skb->sk) && map) 2460 if (!skb->priority && skb->sk && map) {
2461 skb->priority = map->priomap[skb->sk->sk_cgrp_prioidx]; 2461 unsigned int prioidx = skb->sk->sk_cgrp_prioidx;
2462
2463 if (prioidx < map->priomap_len)
2464 skb->priority = map->priomap[prioidx];
2465 }
2462} 2466}
2463#else 2467#else
2464#define skb_update_prio(skb) 2468#define skb_update_prio(skb)
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index 5b8aa2fae48b..3e953eaddbfc 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -49,8 +49,9 @@ static int get_prioidx(u32 *prio)
49 return -ENOSPC; 49 return -ENOSPC;
50 } 50 }
51 set_bit(prioidx, prioidx_map); 51 set_bit(prioidx, prioidx_map);
52 if (atomic_read(&max_prioidx) < prioidx)
53 atomic_set(&max_prioidx, prioidx);
52 spin_unlock_irqrestore(&prioidx_map_lock, flags); 54 spin_unlock_irqrestore(&prioidx_map_lock, flags);
53 atomic_set(&max_prioidx, prioidx);
54 *prio = prioidx; 55 *prio = prioidx;
55 return 0; 56 return 0;
56} 57}
@@ -141,7 +142,7 @@ static void cgrp_destroy(struct cgroup *cgrp)
141 rtnl_lock(); 142 rtnl_lock();
142 for_each_netdev(&init_net, dev) { 143 for_each_netdev(&init_net, dev) {
143 map = rtnl_dereference(dev->priomap); 144 map = rtnl_dereference(dev->priomap);
144 if (map) 145 if (map && cs->prioidx < map->priomap_len)
145 map->priomap[cs->prioidx] = 0; 146 map->priomap[cs->prioidx] = 0;
146 } 147 }
147 rtnl_unlock(); 148 rtnl_unlock();
@@ -165,7 +166,7 @@ static int read_priomap(struct cgroup *cont, struct cftype *cft,
165 rcu_read_lock(); 166 rcu_read_lock();
166 for_each_netdev_rcu(&init_net, dev) { 167 for_each_netdev_rcu(&init_net, dev) {
167 map = rcu_dereference(dev->priomap); 168 map = rcu_dereference(dev->priomap);
168 priority = map ? map->priomap[prioidx] : 0; 169 priority = (map && prioidx < map->priomap_len) ? map->priomap[prioidx] : 0;
169 cb->fill(cb, dev->name, priority); 170 cb->fill(cb, dev->name, priority);
170 } 171 }
171 rcu_read_unlock(); 172 rcu_read_unlock();