aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_sock.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/net/inet_sock.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r--include/net/inet_sock.h56
1 files changed, 40 insertions, 16 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 1989cfd7405f..caaff5f5f39f 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -57,7 +57,15 @@ struct ip_options {
57 unsigned char __data[0]; 57 unsigned char __data[0];
58}; 58};
59 59
60#define optlength(opt) (sizeof(struct ip_options) + opt->optlen) 60struct ip_options_rcu {
61 struct rcu_head rcu;
62 struct ip_options opt;
63};
64
65struct ip_options_data {
66 struct ip_options_rcu opt;
67 char data[40];
68};
61 69
62struct inet_request_sock { 70struct inet_request_sock {
63 struct request_sock req; 71 struct request_sock req;
@@ -78,7 +86,7 @@ struct inet_request_sock {
78 acked : 1, 86 acked : 1,
79 no_srccheck: 1; 87 no_srccheck: 1;
80 kmemcheck_bitfield_end(flags); 88 kmemcheck_bitfield_end(flags);
81 struct ip_options *opt; 89 struct ip_options_rcu *opt;
82}; 90};
83 91
84static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) 92static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
@@ -86,6 +94,23 @@ static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
86 return (struct inet_request_sock *)sk; 94 return (struct inet_request_sock *)sk;
87} 95}
88 96
97struct inet_cork {
98 unsigned int flags;
99 __be32 addr;
100 struct ip_options *opt;
101 unsigned int fragsize;
102 struct dst_entry *dst;
103 int length; /* Total length of all frames */
104 struct page *page;
105 u32 off;
106 u8 tx_flags;
107};
108
109struct inet_cork_full {
110 struct inet_cork base;
111 struct flowi fl;
112};
113
89struct ip_mc_socklist; 114struct ip_mc_socklist;
90struct ipv6_pinfo; 115struct ipv6_pinfo;
91struct rtable; 116struct rtable;
@@ -116,8 +141,9 @@ struct inet_sock {
116 struct ipv6_pinfo *pinet6; 141 struct ipv6_pinfo *pinet6;
117#endif 142#endif
118 /* Socket demultiplex comparisons on incoming packets. */ 143 /* Socket demultiplex comparisons on incoming packets. */
119 __be32 inet_daddr; 144#define inet_daddr sk.__sk_common.skc_daddr
120 __be32 inet_rcv_saddr; 145#define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr
146
121 __be16 inet_dport; 147 __be16 inet_dport;
122 __u16 inet_num; 148 __u16 inet_num;
123 __be32 inet_saddr; 149 __be32 inet_saddr;
@@ -126,7 +152,7 @@ struct inet_sock {
126 __be16 inet_sport; 152 __be16 inet_sport;
127 __u16 inet_id; 153 __u16 inet_id;
128 154
129 struct ip_options *opt; 155 struct ip_options_rcu __rcu *inet_opt;
130 __u8 tos; 156 __u8 tos;
131 __u8 min_ttl; 157 __u8 min_ttl;
132 __u8 mc_ttl; 158 __u8 mc_ttl;
@@ -141,16 +167,8 @@ struct inet_sock {
141 nodefrag:1; 167 nodefrag:1;
142 int mc_index; 168 int mc_index;
143 __be32 mc_addr; 169 __be32 mc_addr;
144 struct ip_mc_socklist *mc_list; 170 struct ip_mc_socklist __rcu *mc_list;
145 struct { 171 struct inet_cork_full cork;
146 unsigned int flags;
147 unsigned int fragsize;
148 struct ip_options *opt;
149 struct dst_entry *dst;
150 int length; /* Total length of all frames */
151 __be32 addr;
152 struct flowi fl;
153 } cork;
154}; 172};
155 173
156#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ 174#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */
@@ -218,7 +236,13 @@ static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops
218 236
219static inline __u8 inet_sk_flowi_flags(const struct sock *sk) 237static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
220{ 238{
221 return inet_sk(sk)->transparent ? FLOWI_FLAG_ANYSRC : 0; 239 __u8 flags = 0;
240
241 if (inet_sk(sk)->transparent)
242 flags |= FLOWI_FLAG_ANYSRC;
243 if (sk->sk_protocol == IPPROTO_TCP)
244 flags |= FLOWI_FLAG_PRECOW_METRICS;
245 return flags;
222} 246}
223 247
224#endif /* _INET_SOCK_H */ 248#endif /* _INET_SOCK_H */