diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 10 | ||||
-rw-r--r-- | net/core/ethtool.c | 2 | ||||
-rw-r--r-- | net/core/netpoll.c | 2 | ||||
-rw-r--r-- | net/core/netprio_cgroup.c | 15 | ||||
-rw-r--r-- | net/core/sock.c | 7 |
5 files changed, 18 insertions, 18 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 115dee1d985d..6ca32f6b3105 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3500,14 +3500,20 @@ static inline gro_result_t | |||
3500 | __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) | 3500 | __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) |
3501 | { | 3501 | { |
3502 | struct sk_buff *p; | 3502 | struct sk_buff *p; |
3503 | unsigned int maclen = skb->dev->hard_header_len; | ||
3503 | 3504 | ||
3504 | for (p = napi->gro_list; p; p = p->next) { | 3505 | for (p = napi->gro_list; p; p = p->next) { |
3505 | unsigned long diffs; | 3506 | unsigned long diffs; |
3506 | 3507 | ||
3507 | diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev; | 3508 | diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev; |
3508 | diffs |= p->vlan_tci ^ skb->vlan_tci; | 3509 | diffs |= p->vlan_tci ^ skb->vlan_tci; |
3509 | diffs |= compare_ether_header(skb_mac_header(p), | 3510 | if (maclen == ETH_HLEN) |
3510 | skb_gro_mac_header(skb)); | 3511 | diffs |= compare_ether_header(skb_mac_header(p), |
3512 | skb_gro_mac_header(skb)); | ||
3513 | else if (!diffs) | ||
3514 | diffs = memcmp(skb_mac_header(p), | ||
3515 | skb_gro_mac_header(skb), | ||
3516 | maclen); | ||
3511 | NAPI_GRO_CB(p)->same_flow = !diffs; | 3517 | NAPI_GRO_CB(p)->same_flow = !diffs; |
3512 | NAPI_GRO_CB(p)->flush = 0; | 3518 | NAPI_GRO_CB(p)->flush = 0; |
3513 | } | 3519 | } |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 369b41894527..3f79db1b612a 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -1190,6 +1190,8 @@ static noinline_for_stack int ethtool_flash_device(struct net_device *dev, | |||
1190 | if (!dev->ethtool_ops->flash_device) | 1190 | if (!dev->ethtool_ops->flash_device) |
1191 | return -EOPNOTSUPP; | 1191 | return -EOPNOTSUPP; |
1192 | 1192 | ||
1193 | efl.data[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0; | ||
1194 | |||
1193 | return dev->ethtool_ops->flash_device(dev, &efl); | 1195 | return dev->ethtool_ops->flash_device(dev, &efl); |
1194 | } | 1196 | } |
1195 | 1197 | ||
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 556b08298669..ddefc513b44a 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -194,7 +194,7 @@ static void netpoll_poll_dev(struct net_device *dev) | |||
194 | 194 | ||
195 | poll_napi(dev); | 195 | poll_napi(dev); |
196 | 196 | ||
197 | if (dev->priv_flags & IFF_SLAVE) { | 197 | if (dev->flags & IFF_SLAVE) { |
198 | if (dev->npinfo) { | 198 | if (dev->npinfo) { |
199 | struct net_device *bond_dev = dev->master; | 199 | struct net_device *bond_dev = dev->master; |
200 | struct sk_buff *skb; | 200 | struct sk_buff *skb; |
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 3a9fd4826b75..4dacc44637ef 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c | |||
@@ -58,11 +58,12 @@ static int get_prioidx(u32 *prio) | |||
58 | 58 | ||
59 | spin_lock_irqsave(&prioidx_map_lock, flags); | 59 | spin_lock_irqsave(&prioidx_map_lock, flags); |
60 | prioidx = find_first_zero_bit(prioidx_map, sizeof(unsigned long) * PRIOIDX_SZ); | 60 | prioidx = find_first_zero_bit(prioidx_map, sizeof(unsigned long) * PRIOIDX_SZ); |
61 | if (prioidx == sizeof(unsigned long) * PRIOIDX_SZ) { | ||
62 | spin_unlock_irqrestore(&prioidx_map_lock, flags); | ||
63 | return -ENOSPC; | ||
64 | } | ||
61 | set_bit(prioidx, prioidx_map); | 65 | set_bit(prioidx, prioidx_map); |
62 | spin_unlock_irqrestore(&prioidx_map_lock, flags); | 66 | spin_unlock_irqrestore(&prioidx_map_lock, flags); |
63 | if (prioidx == sizeof(unsigned long) * PRIOIDX_SZ) | ||
64 | return -ENOSPC; | ||
65 | |||
66 | atomic_set(&max_prioidx, prioidx); | 67 | atomic_set(&max_prioidx, prioidx); |
67 | *prio = prioidx; | 68 | *prio = prioidx; |
68 | return 0; | 69 | return 0; |
@@ -107,7 +108,7 @@ static void extend_netdev_table(struct net_device *dev, u32 new_len) | |||
107 | static void update_netdev_tables(void) | 108 | static void update_netdev_tables(void) |
108 | { | 109 | { |
109 | struct net_device *dev; | 110 | struct net_device *dev; |
110 | u32 max_len = atomic_read(&max_prioidx); | 111 | u32 max_len = atomic_read(&max_prioidx) + 1; |
111 | struct netprio_map *map; | 112 | struct netprio_map *map; |
112 | 113 | ||
113 | rtnl_lock(); | 114 | rtnl_lock(); |
@@ -270,7 +271,6 @@ static int netprio_device_event(struct notifier_block *unused, | |||
270 | { | 271 | { |
271 | struct net_device *dev = ptr; | 272 | struct net_device *dev = ptr; |
272 | struct netprio_map *old; | 273 | struct netprio_map *old; |
273 | u32 max_len = atomic_read(&max_prioidx); | ||
274 | 274 | ||
275 | /* | 275 | /* |
276 | * Note this is called with rtnl_lock held so we have update side | 276 | * Note this is called with rtnl_lock held so we have update side |
@@ -278,11 +278,6 @@ static int netprio_device_event(struct notifier_block *unused, | |||
278 | */ | 278 | */ |
279 | 279 | ||
280 | switch (event) { | 280 | switch (event) { |
281 | |||
282 | case NETDEV_REGISTER: | ||
283 | if (max_len) | ||
284 | extend_netdev_table(dev, max_len); | ||
285 | break; | ||
286 | case NETDEV_UNREGISTER: | 281 | case NETDEV_UNREGISTER: |
287 | old = rtnl_dereference(dev->priomap); | 282 | old = rtnl_dereference(dev->priomap); |
288 | RCU_INIT_POINTER(dev->priomap, NULL); | 283 | RCU_INIT_POINTER(dev->priomap, NULL); |
diff --git a/net/core/sock.c b/net/core/sock.c index 3e81fd2e3c75..02f8dfe320b7 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1171,13 +1171,10 @@ EXPORT_SYMBOL(sock_update_classid); | |||
1171 | 1171 | ||
1172 | void sock_update_netprioidx(struct sock *sk) | 1172 | void sock_update_netprioidx(struct sock *sk) |
1173 | { | 1173 | { |
1174 | struct cgroup_netprio_state *state; | ||
1175 | if (in_interrupt()) | 1174 | if (in_interrupt()) |
1176 | return; | 1175 | return; |
1177 | rcu_read_lock(); | 1176 | |
1178 | state = task_netprio_state(current); | 1177 | sk->sk_cgrp_prioidx = task_netprioidx(current); |
1179 | sk->sk_cgrp_prioidx = state ? state->prioidx : 0; | ||
1180 | rcu_read_unlock(); | ||
1181 | } | 1178 | } |
1182 | EXPORT_SYMBOL_GPL(sock_update_netprioidx); | 1179 | EXPORT_SYMBOL_GPL(sock_update_netprioidx); |
1183 | #endif | 1180 | #endif |