aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/compat.h2
-rw-r--r--include/net/dst.h4
-rw-r--r--include/net/ip.h1
-rw-r--r--include/net/ipv6.h8
-rw-r--r--include/net/llc.h39
-rw-r--r--include/net/llc_conn.h2
-rw-r--r--include/net/neighbour.h7
-rw-r--r--include/net/netfilter/ipv6/nf_conntrack_ipv6.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h4
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/snmp.h50
-rw-r--r--include/net/tcp.h23
-rw-r--r--include/net/wimax.h2
13 files changed, 83 insertions, 63 deletions
diff --git a/include/net/compat.h b/include/net/compat.h
index 3c7d4e38fa1d..28d5428ec6a2 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -46,7 +46,7 @@ extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsi
46extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); 46extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
47extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, 47extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *,
48 unsigned, unsigned, 48 unsigned, unsigned,
49 struct timespec __user *); 49 struct compat_timespec __user *);
50extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); 50extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
51extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); 51extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
52 52
diff --git a/include/net/dst.h b/include/net/dst.h
index 387cb3cfde7e..ce078cda6b74 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -83,8 +83,6 @@ struct dst_entry {
83 * (L1_CACHE_SIZE would be too much) 83 * (L1_CACHE_SIZE would be too much)
84 */ 84 */
85#ifdef CONFIG_64BIT 85#ifdef CONFIG_64BIT
86 long __pad_to_align_refcnt[2];
87#else
88 long __pad_to_align_refcnt[1]; 86 long __pad_to_align_refcnt[1];
89#endif 87#endif
90 /* 88 /*
@@ -113,7 +111,7 @@ dst_metric(const struct dst_entry *dst, int metric)
113static inline u32 111static inline u32
114dst_feature(const struct dst_entry *dst, u32 feature) 112dst_feature(const struct dst_entry *dst, u32 feature)
115{ 113{
116 return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0); 114 return dst_metric(dst, RTAX_FEATURES) & feature;
117} 115}
118 116
119static inline u32 dst_mtu(const struct dst_entry *dst) 117static inline u32 dst_mtu(const struct dst_entry *dst)
diff --git a/include/net/ip.h b/include/net/ip.h
index e6b9d12d5f62..85108cfbb1ae 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -337,6 +337,7 @@ enum ip_defrag_users {
337 IP_DEFRAG_CALL_RA_CHAIN, 337 IP_DEFRAG_CALL_RA_CHAIN,
338 IP_DEFRAG_CONNTRACK_IN, 338 IP_DEFRAG_CONNTRACK_IN,
339 IP_DEFRAG_CONNTRACK_OUT, 339 IP_DEFRAG_CONNTRACK_OUT,
340 IP_DEFRAG_CONNTRACK_BRIDGE_IN,
340 IP_DEFRAG_VS_IN, 341 IP_DEFRAG_VS_IN,
341 IP_DEFRAG_VS_OUT, 342 IP_DEFRAG_VS_OUT,
342 IP_DEFRAG_VS_FWD 343 IP_DEFRAG_VS_FWD
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 92db8617d188..ccab5946c830 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -350,8 +350,16 @@ static inline int ipv6_prefix_equal(const struct in6_addr *a1,
350 350
351struct inet_frag_queue; 351struct inet_frag_queue;
352 352
353enum ip6_defrag_users {
354 IP6_DEFRAG_LOCAL_DELIVER,
355 IP6_DEFRAG_CONNTRACK_IN,
356 IP6_DEFRAG_CONNTRACK_OUT,
357 IP6_DEFRAG_CONNTRACK_BRIDGE_IN,
358};
359
353struct ip6_create_arg { 360struct ip6_create_arg {
354 __be32 id; 361 __be32 id;
362 u32 user;
355 struct in6_addr *src; 363 struct in6_addr *src;
356 struct in6_addr *dst; 364 struct in6_addr *dst;
357}; 365};
diff --git a/include/net/llc.h b/include/net/llc.h
index 7940da1606e7..5503b74ab170 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -16,6 +16,9 @@
16#include <linux/if_ether.h> 16#include <linux/if_ether.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/rculist_nulls.h>
20#include <linux/hash.h>
21#include <linux/jhash.h>
19 22
20#include <asm/atomic.h> 23#include <asm/atomic.h>
21 24
@@ -31,6 +34,12 @@ struct llc_addr {
31#define LLC_SAP_STATE_INACTIVE 1 34#define LLC_SAP_STATE_INACTIVE 1
32#define LLC_SAP_STATE_ACTIVE 2 35#define LLC_SAP_STATE_ACTIVE 2
33 36
37#define LLC_SK_DEV_HASH_BITS 6
38#define LLC_SK_DEV_HASH_ENTRIES (1<<LLC_SK_DEV_HASH_BITS)
39
40#define LLC_SK_LADDR_HASH_BITS 6
41#define LLC_SK_LADDR_HASH_ENTRIES (1<<LLC_SK_LADDR_HASH_BITS)
42
34/** 43/**
35 * struct llc_sap - Defines the SAP component 44 * struct llc_sap - Defines the SAP component
36 * 45 *
@@ -53,18 +62,38 @@ struct llc_sap {
53 struct net_device *orig_dev); 62 struct net_device *orig_dev);
54 struct llc_addr laddr; 63 struct llc_addr laddr;
55 struct list_head node; 64 struct list_head node;
56 struct { 65 spinlock_t sk_lock;
57 rwlock_t lock; 66 int sk_count;
58 struct hlist_head list; 67 struct hlist_nulls_head sk_laddr_hash[LLC_SK_LADDR_HASH_ENTRIES];
59 } sk_list; 68 struct hlist_head sk_dev_hash[LLC_SK_DEV_HASH_ENTRIES];
60}; 69};
61 70
71static inline
72struct hlist_head *llc_sk_dev_hash(struct llc_sap *sap, int ifindex)
73{
74 return &sap->sk_dev_hash[ifindex % LLC_SK_DEV_HASH_ENTRIES];
75}
76
77static inline
78u32 llc_sk_laddr_hashfn(struct llc_sap *sap, const struct llc_addr *laddr)
79{
80 return hash_32(jhash(laddr->mac, sizeof(laddr->mac), 0),
81 LLC_SK_LADDR_HASH_BITS);
82}
83
84static inline
85struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap,
86 const struct llc_addr *laddr)
87{
88 return &sap->sk_laddr_hash[llc_sk_laddr_hashfn(sap, laddr)];
89}
90
62#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */ 91#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */
63#define LLC_DEST_SAP 1 /* Type 1 goes here */ 92#define LLC_DEST_SAP 1 /* Type 1 goes here */
64#define LLC_DEST_CONN 2 /* Type 2 goes here */ 93#define LLC_DEST_CONN 2 /* Type 2 goes here */
65 94
66extern struct list_head llc_sap_list; 95extern struct list_head llc_sap_list;
67extern rwlock_t llc_sap_list_lock; 96extern spinlock_t llc_sap_list_lock;
68 97
69extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, 98extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
70 struct packet_type *pt, struct net_device *orig_dev); 99 struct packet_type *pt, struct net_device *orig_dev);
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h
index e2374e34989f..2f97d8ddce92 100644
--- a/include/net/llc_conn.h
+++ b/include/net/llc_conn.h
@@ -76,6 +76,8 @@ struct llc_sock {
76 u32 rx_pdu_hdr; /* used for saving header of last pdu 76 u32 rx_pdu_hdr; /* used for saving header of last pdu
77 received and caused sending FRMR. 77 received and caused sending FRMR.
78 Used for resending FRMR */ 78 Used for resending FRMR */
79 u32 cmsg_flags;
80 struct hlist_node dev_hash_node;
79}; 81};
80 82
81static inline struct llc_sock *llc_sk(const struct sock *sk) 83static inline struct llc_sock *llc_sk(const struct sock *sk)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 0302f31a2fb7..b0173202cad9 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -88,12 +88,7 @@ struct neigh_statistics {
88 unsigned long unres_discards; /* number of unresolved drops */ 88 unsigned long unres_discards; /* number of unresolved drops */
89}; 89};
90 90
91#define NEIGH_CACHE_STAT_INC(tbl, field) \ 91#define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field)
92 do { \
93 preempt_disable(); \
94 (per_cpu_ptr((tbl)->stats, smp_processor_id())->field)++; \
95 preempt_enable(); \
96 } while (0)
97 92
98struct neighbour { 93struct neighbour {
99 struct neighbour *next; 94 struct neighbour *next;
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
index abc55ad75c2b..1ee717eb5b09 100644
--- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
+++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
@@ -9,7 +9,7 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6;
9 9
10extern int nf_ct_frag6_init(void); 10extern int nf_ct_frag6_init(void);
11extern void nf_ct_frag6_cleanup(void); 11extern void nf_ct_frag6_cleanup(void);
12extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); 12extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user);
13extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, 13extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
14 struct net_device *in, 14 struct net_device *in,
15 struct net_device *out, 15 struct net_device *out,
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 5cf7270e3ffc..a0904adfb8f7 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -293,11 +293,11 @@ extern unsigned int nf_conntrack_htable_size;
293extern unsigned int nf_conntrack_max; 293extern unsigned int nf_conntrack_max;
294 294
295#define NF_CT_STAT_INC(net, count) \ 295#define NF_CT_STAT_INC(net, count) \
296 (per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++) 296 __this_cpu_inc((net)->ct.stat->count)
297#define NF_CT_STAT_INC_ATOMIC(net, count) \ 297#define NF_CT_STAT_INC_ATOMIC(net, count) \
298do { \ 298do { \
299 local_bh_disable(); \ 299 local_bh_disable(); \
300 per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++; \ 300 __this_cpu_inc((net)->ct.stat->count); \
301 local_bh_enable(); \ 301 local_bh_enable(); \
302} while (0) 302} while (0)
303 303
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7571e32723bf..ff3017744711 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -989,7 +989,7 @@ struct sctp_transport {
989 int init_sent_count; 989 int init_sent_count;
990 990
991 /* state : The current state of this destination, 991 /* state : The current state of this destination,
992 * : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKOWN. 992 * : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKNOWN.
993 */ 993 */
994 int state; 994 int state;
995 995
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 8c842e06bec8..f0d756f2ac99 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -136,45 +136,31 @@ struct linux_xfrm_mib {
136#define SNMP_STAT_BHPTR(name) (name[0]) 136#define SNMP_STAT_BHPTR(name) (name[0])
137#define SNMP_STAT_USRPTR(name) (name[1]) 137#define SNMP_STAT_USRPTR(name) (name[1])
138 138
139#define SNMP_INC_STATS_BH(mib, field) \ 139#define SNMP_INC_STATS_BH(mib, field) \
140 (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field]++) 140 __this_cpu_inc(mib[0]->mibs[field])
141#define SNMP_INC_STATS_USER(mib, field) \ 141#define SNMP_INC_STATS_USER(mib, field) \
142 do { \ 142 this_cpu_inc(mib[1]->mibs[field])
143 per_cpu_ptr(mib[1], get_cpu())->mibs[field]++; \ 143#define SNMP_INC_STATS(mib, field) \
144 put_cpu(); \ 144 this_cpu_inc(mib[!in_softirq()]->mibs[field])
145 } while (0) 145#define SNMP_DEC_STATS(mib, field) \
146#define SNMP_INC_STATS(mib, field) \ 146 this_cpu_dec(mib[!in_softirq()]->mibs[field])
147 do { \ 147#define SNMP_ADD_STATS_BH(mib, field, addend) \
148 per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]++; \ 148 __this_cpu_add(mib[0]->mibs[field], addend)
149 put_cpu(); \ 149#define SNMP_ADD_STATS_USER(mib, field, addend) \
150 } while (0) 150 this_cpu_add(mib[1]->mibs[field], addend)
151#define SNMP_DEC_STATS(mib, field) \
152 do { \
153 per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]--; \
154 put_cpu(); \
155 } while (0)
156#define SNMP_ADD_STATS(mib, field, addend) \
157 do { \
158 per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field] += addend; \
159 put_cpu(); \
160 } while (0)
161#define SNMP_ADD_STATS_BH(mib, field, addend) \
162 (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field] += addend)
163#define SNMP_ADD_STATS_USER(mib, field, addend) \
164 do { \
165 per_cpu_ptr(mib[1], get_cpu())->mibs[field] += addend; \
166 put_cpu(); \
167 } while (0)
168#define SNMP_UPD_PO_STATS(mib, basefield, addend) \ 151#define SNMP_UPD_PO_STATS(mib, basefield, addend) \
169 do { \ 152 do { \
170 __typeof__(mib[0]) ptr = per_cpu_ptr(mib[!in_softirq()], get_cpu());\ 153 __typeof__(mib[0]) ptr; \
154 preempt_disable(); \
155 ptr = this_cpu_ptr((mib)[!in_softirq()]); \
171 ptr->mibs[basefield##PKTS]++; \ 156 ptr->mibs[basefield##PKTS]++; \
172 ptr->mibs[basefield##OCTETS] += addend;\ 157 ptr->mibs[basefield##OCTETS] += addend;\
173 put_cpu(); \ 158 preempt_enable(); \
174 } while (0) 159 } while (0)
175#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ 160#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \
176 do { \ 161 do { \
177 __typeof__(mib[0]) ptr = per_cpu_ptr(mib[!in_softirq()], raw_smp_processor_id());\ 162 __typeof__(mib[0]) ptr = \
163 __this_cpu_ptr((mib)[!in_softirq()]); \
178 ptr->mibs[basefield##PKTS]++; \ 164 ptr->mibs[basefield##PKTS]++; \
179 ptr->mibs[basefield##OCTETS] += addend;\ 165 ptr->mibs[basefield##OCTETS] += addend;\
180 } while (0) 166 } while (0)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 0248c181a92c..788c99f98597 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -408,8 +408,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
408extern void tcp_parse_options(struct sk_buff *skb, 408extern void tcp_parse_options(struct sk_buff *skb,
409 struct tcp_options_received *opt_rx, 409 struct tcp_options_received *opt_rx,
410 u8 **hvpp, 410 u8 **hvpp,
411 int estab, 411 int estab);
412 struct dst_entry *dst);
413 412
414extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); 413extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
415 414
@@ -857,13 +856,6 @@ static inline void tcp_check_probe_timer(struct sock *sk)
857 icsk->icsk_rto, TCP_RTO_MAX); 856 icsk->icsk_rto, TCP_RTO_MAX);
858} 857}
859 858
860static inline void tcp_push_pending_frames(struct sock *sk)
861{
862 struct tcp_sock *tp = tcp_sk(sk);
863
864 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle);
865}
866
867static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq) 859static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq)
868{ 860{
869 tp->snd_wl1 = seq; 861 tp->snd_wl1 = seq;
@@ -973,7 +965,8 @@ static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
973/* Determine a window scaling and initial window to offer. */ 965/* Determine a window scaling and initial window to offer. */
974extern void tcp_select_initial_window(int __space, __u32 mss, 966extern void tcp_select_initial_window(int __space, __u32 mss,
975 __u32 *rcv_wnd, __u32 *window_clamp, 967 __u32 *rcv_wnd, __u32 *window_clamp,
976 int wscale_ok, __u8 *rcv_wscale); 968 int wscale_ok, __u8 *rcv_wscale,
969 __u32 init_rcv_wnd);
977 970
978static inline int tcp_win_from_space(int space) 971static inline int tcp_win_from_space(int space)
979{ 972{
@@ -1261,7 +1254,6 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu
1261#define tcp_for_write_queue_from_safe(skb, tmp, sk) \ 1254#define tcp_for_write_queue_from_safe(skb, tmp, sk) \
1262 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) 1255 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
1263 1256
1264
1265static inline struct sk_buff *tcp_send_head(struct sock *sk) 1257static inline struct sk_buff *tcp_send_head(struct sock *sk)
1266{ 1258{
1267 return sk->sk_send_head; 1259 return sk->sk_send_head;
@@ -1344,6 +1336,15 @@ static inline int tcp_write_queue_empty(struct sock *sk)
1344 return skb_queue_empty(&sk->sk_write_queue); 1336 return skb_queue_empty(&sk->sk_write_queue);
1345} 1337}
1346 1338
1339static inline void tcp_push_pending_frames(struct sock *sk)
1340{
1341 if (tcp_send_head(sk)) {
1342 struct tcp_sock *tp = tcp_sk(sk);
1343
1344 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle);
1345 }
1346}
1347
1347/* Start sequence of the highest skb with SACKed bit, valid only if 1348/* Start sequence of the highest skb with SACKed bit, valid only if
1348 * sacked > 0 or when the caller has ensured validity by itself. 1349 * sacked > 0 or when the caller has ensured validity by itself.
1349 */ 1350 */
diff --git a/include/net/wimax.h b/include/net/wimax.h
index d69c4a7a1267..3461aa1df1e0 100644
--- a/include/net/wimax.h
+++ b/include/net/wimax.h
@@ -79,7 +79,7 @@
79 * drivers have to only report state changes due to external 79 * drivers have to only report state changes due to external
80 * conditions. 80 * conditions.
81 * 81 *
82 * All API operations are 'atomic', serialized thorough a mutex in the 82 * All API operations are 'atomic', serialized through a mutex in the
83 * `struct wimax_dev`. 83 * `struct wimax_dev`.
84 * 84 *
85 * EXPORTING TO USER SPACE THROUGH GENERIC NETLINK 85 * EXPORTING TO USER SPACE THROUGH GENERIC NETLINK