aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-06-05 06:19:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-06-05 06:19:04 -0400
commit4d3797d7e1861ac1af150a6189315786c5e1c820 (patch)
treeaa7eff5dc1e297e1560eaa85d1fac5735e0650c1 /include
parent844ce9f2044723a9da0f4bce588cca410e774d24 (diff)
parent5343a7f8be11951cb3095b91e8e4eb506cfacc0f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix timeouts with direct mode authentication in mac80211, from Stanislaw Gruszka. 2) Aggregation sessions can deadlock in ath9k, from Felix Fietkau. 3) Netfilter's xt_addrtype doesn't work with ipv6 due to route lookups creating undesirable cache entries, from Florian Westphal. 4) Fix netfilter's ipt_ULOG from generating non-NULL terminated strings. 5) Fix netdev transmit queue crashes in mac80211, from Johannes Berg. 6) Fix copy and paste error in 802.11 stack that broke reporting of 64-bit station tx statistics, from Felix Fietkau. 7) When qlge_probe fails, it leaks the netdev. Fix from Wei Yongjun. 8) SKB control block (where we store the IP options information, amongst other things) must be cleared properly otherwise ICMP sending can crash for IP tunnels. Fix from Eric Dumazet. 9) Verification of Energy Efficient Ether support was coded wrongly, the test was inversed. Fix from Giuseppe CAVALLARO. 10) TCP handles redirects improperly because the wrong flow key is used for the route lookup. From Michal Kubecek. 11) Don't interpret MSG_CMSG_COMPAT from userspace, fix from Andy Lutomirski. 12) The new AF_VSOCK was missing from the lockdep string table, fix from Federico Vaga. 13) be2net doesn't handle checksumming of IP fragments properly, from Somnath Kotur. 14) Fix several bugs in the device address list code that lead to crashes and other misbehaviors. From Jay Vosburgh. 15) Fix ipv6 segmentation handling of fragmented GRE tunnel traffic, from Pravin B Shalr. 16) Fix usage of stale policies in IPSEC layer, from Paul Moore. 17) Fix team driver dump of ports when there are a large number of them, from Jiri Pirko. 18) Fix softlockups in UDP ipv4 socket lookup causes by and error in the hlist_nulls_for_each_entry_rcu() macro. From Eric Dumazet. 19) Fix several regressions added by the high rate accuracy changes to the htb packet scheduler. From Eric Dumazet. 20) Fix DMA'ing onto the stack in esd_usb2 and peak_usb CAN drivers, from Olivier Sobrie and Marc Kleine-Budde. 21) Fix unremovable network devices due to missing route pointer installation in the per-device ipv6 address list entries. From Gao feng. 22) Apply the tg3 5719 DMA workaround on 5720 chips as well, otherwise we get stalls. From Nithin Sujir. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (68 commits) net_sched: htb: do not mix 1ns and 64ns time units net: fix sk_buff head without data area tg3: Add read dma workaround for 5720 net: ethernet: xilinx_emaclite: set protocol selector bits when writing ANAR bnx2x: Fix bridged GSO for 57710/57711 chips net: fec: add fallback to random MAC address bnx2x: fix TCP offload for tunneling ipv4 over ipv6 ipv6: assign rt6_info to inet6_ifaddr in init_loopback net/mlx4_core: Keep VF assigned MAC in the PF admin table net/mlx4_en: Handle unassigned VF MAC address correctly net/mlx4_core: Return -EPROBE_DEFER when a VF is probed before PF is sufficiently initialized net/mlx4_en: Fix adaptive moderation cq update net: can: peak_usb: Do not do dma on the stack net: can: esd_usb2: Do not do dma on the stack net: can: kvaser_usb: fix reception on "USBcan Pro" and "USBcan R" type hardware. net_sched: restore "overhead xxx" handling net: force a reload of first item in hlist_nulls_for_each_entry_rcu hyperv: Fix vlan_proto setting in netvsc_recv_callback() team: fix port list dump for big number of ports list: introduce list_first_entry_or_null ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/list.h11
-rw-r--r--include/linux/netfilter_ipv6.h16
-rw-r--r--include/linux/rculist_nulls.h7
-rw-r--r--include/linux/skbuff.h15
-rw-r--r--include/net/addrconf.h2
-rw-r--r--include/net/sch_generic.h18
-rw-r--r--include/net/xfrm.h5
7 files changed, 65 insertions, 9 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 6a1f8df9144b..b83e5657365a 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -362,6 +362,17 @@ static inline void list_splice_tail_init(struct list_head *list,
362 list_entry((ptr)->next, type, member) 362 list_entry((ptr)->next, type, member)
363 363
364/** 364/**
365 * list_first_entry_or_null - get the first element from a list
366 * @ptr: the list head to take the element from.
367 * @type: the type of the struct this is embedded in.
368 * @member: the name of the list_struct within the struct.
369 *
370 * Note that if the list is empty, it returns NULL.
371 */
372#define list_first_entry_or_null(ptr, type, member) \
373 (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL)
374
375/**
365 * list_for_each - iterate over a list 376 * list_for_each - iterate over a list
366 * @pos: the &struct list_head to use as a loop cursor. 377 * @pos: the &struct list_head to use as a loop cursor.
367 * @head: the head for your list. 378 * @head: the head for your list.
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 98ffb54988b6..2d4df6ce043e 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -17,6 +17,22 @@ extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
17 17
18extern int ipv6_netfilter_init(void); 18extern int ipv6_netfilter_init(void);
19extern void ipv6_netfilter_fini(void); 19extern void ipv6_netfilter_fini(void);
20
21/*
22 * Hook functions for ipv6 to allow xt_* modules to be built-in even
23 * if IPv6 is a module.
24 */
25struct nf_ipv6_ops {
26 int (*chk_addr)(struct net *net, const struct in6_addr *addr,
27 const struct net_device *dev, int strict);
28};
29
30extern const struct nf_ipv6_ops __rcu *nf_ipv6_ops;
31static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void)
32{
33 return rcu_dereference(nf_ipv6_ops);
34}
35
20#else /* CONFIG_NETFILTER */ 36#else /* CONFIG_NETFILTER */
21static inline int ipv6_netfilter_init(void) { return 0; } 37static inline int ipv6_netfilter_init(void) { return 0; }
22static inline void ipv6_netfilter_fini(void) { return; } 38static inline void ipv6_netfilter_fini(void) { return; }
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h
index 2ae13714828b..1c33dd7da4a7 100644
--- a/include/linux/rculist_nulls.h
+++ b/include/linux/rculist_nulls.h
@@ -105,9 +105,14 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n,
105 * @head: the head for your list. 105 * @head: the head for your list.
106 * @member: the name of the hlist_nulls_node within the struct. 106 * @member: the name of the hlist_nulls_node within the struct.
107 * 107 *
108 * The barrier() is needed to make sure compiler doesn't cache first element [1],
109 * as this loop can be restarted [2]
110 * [1] Documentation/atomic_ops.txt around line 114
111 * [2] Documentation/RCU/rculist_nulls.txt around line 146
108 */ 112 */
109#define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ 113#define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \
110 for (pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ 114 for (({barrier();}), \
115 pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \
111 (!is_a_nulls(pos)) && \ 116 (!is_a_nulls(pos)) && \
112 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ 117 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \
113 pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) 118 pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos)))
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2e0ced1af3b1..9c676eae3968 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2852,6 +2852,21 @@ static inline int skb_tnl_header_len(const struct sk_buff *inner_skb)
2852 SKB_GSO_CB(inner_skb)->mac_offset; 2852 SKB_GSO_CB(inner_skb)->mac_offset;
2853} 2853}
2854 2854
2855static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra)
2856{
2857 int new_headroom, headroom;
2858 int ret;
2859
2860 headroom = skb_headroom(skb);
2861 ret = pskb_expand_head(skb, extra, 0, GFP_ATOMIC);
2862 if (ret)
2863 return ret;
2864
2865 new_headroom = skb_headroom(skb);
2866 SKB_GSO_CB(skb)->mac_offset += (new_headroom - headroom);
2867 return 0;
2868}
2869
2855static inline bool skb_is_gso(const struct sk_buff *skb) 2870static inline bool skb_is_gso(const struct sk_buff *skb)
2856{ 2871{
2857 return skb_shinfo(skb)->gso_size; 2872 return skb_shinfo(skb)->gso_size;
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 84a6440f1f19..21f702704f24 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -65,7 +65,7 @@ extern int addrconf_set_dstaddr(struct net *net,
65 65
66extern int ipv6_chk_addr(struct net *net, 66extern int ipv6_chk_addr(struct net *net,
67 const struct in6_addr *addr, 67 const struct in6_addr *addr,
68 struct net_device *dev, 68 const struct net_device *dev,
69 int strict); 69 int strict);
70 70
71#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 71#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index f10818fc8804..e7f4e21cc3e1 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -679,22 +679,26 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask,
679#endif 679#endif
680 680
681struct psched_ratecfg { 681struct psched_ratecfg {
682 u64 rate_bps; 682 u64 rate_bps;
683 u32 mult; 683 u32 mult;
684 u32 shift; 684 u16 overhead;
685 u8 shift;
685}; 686};
686 687
687static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, 688static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
688 unsigned int len) 689 unsigned int len)
689{ 690{
690 return ((u64)len * r->mult) >> r->shift; 691 return ((u64)(len + r->overhead) * r->mult) >> r->shift;
691} 692}
692 693
693extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate); 694extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf);
694 695
695static inline u32 psched_ratecfg_getrate(const struct psched_ratecfg *r) 696static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
697 const struct psched_ratecfg *r)
696{ 698{
697 return r->rate_bps >> 3; 699 memset(res, 0, sizeof(*res));
700 res->rate = r->rate_bps >> 3;
701 res->overhead = r->overhead;
698} 702}
699 703
700#endif 704#endif
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index ae16531d0d35..94ce082b29dc 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1160,6 +1160,8 @@ static inline void xfrm_sk_free_policy(struct sock *sk)
1160 } 1160 }
1161} 1161}
1162 1162
1163extern void xfrm_garbage_collect(struct net *net);
1164
1163#else 1165#else
1164 1166
1165static inline void xfrm_sk_free_policy(struct sock *sk) {} 1167static inline void xfrm_sk_free_policy(struct sock *sk) {}
@@ -1194,6 +1196,9 @@ static inline int xfrm6_policy_check_reverse(struct sock *sk, int dir,
1194{ 1196{
1195 return 1; 1197 return 1;
1196} 1198}
1199static inline void xfrm_garbage_collect(struct net *net)
1200{
1201}
1197#endif 1202#endif
1198 1203
1199static __inline__ 1204static __inline__