aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2011-12-13 22:35:03 -0500
committerOlof Johansson <olof@lixom.net>2011-12-13 22:35:03 -0500
commit2da994e687f7991cc76e3270c423bf6500b9424a (patch)
tree437d685035c2a39395f14c233831422ed636c016 /include/net
parent00e929808a1cb410f45a620c0fc79d8d0a2506b1 (diff)
parentdb33f4de9952af112b0d4f2436ce931ae632aba0 (diff)
Merge branch 'orion/devel' into next/devel
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dst.h7
-rw-r--r--include/net/dst_ops.h2
-rw-r--r--include/net/inet_sock.h2
-rw-r--r--include/net/inetpeer.h1
-rw-r--r--include/net/netfilter/nf_conntrack_ecache.h19
-rw-r--r--include/net/netns/conntrack.h2
-rw-r--r--include/net/red.h15
-rw-r--r--include/net/route.h4
8 files changed, 25 insertions, 27 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 4fb6c4381791..6faec1a60216 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -205,12 +205,7 @@ dst_feature(const struct dst_entry *dst, u32 feature)
205 205
206static inline u32 dst_mtu(const struct dst_entry *dst) 206static inline u32 dst_mtu(const struct dst_entry *dst)
207{ 207{
208 u32 mtu = dst_metric_raw(dst, RTAX_MTU); 208 return dst->ops->mtu(dst);
209
210 if (!mtu)
211 mtu = dst->ops->default_mtu(dst);
212
213 return mtu;
214} 209}
215 210
216/* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */ 211/* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
index 9adb99845a56..e1c2ee0eef47 100644
--- a/include/net/dst_ops.h
+++ b/include/net/dst_ops.h
@@ -17,7 +17,7 @@ struct dst_ops {
17 int (*gc)(struct dst_ops *ops); 17 int (*gc)(struct dst_ops *ops);
18 struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); 18 struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
19 unsigned int (*default_advmss)(const struct dst_entry *); 19 unsigned int (*default_advmss)(const struct dst_entry *);
20 unsigned int (*default_mtu)(const struct dst_entry *); 20 unsigned int (*mtu)(const struct dst_entry *);
21 u32 * (*cow_metrics)(struct dst_entry *, unsigned long); 21 u32 * (*cow_metrics)(struct dst_entry *, unsigned long);
22 void (*destroy)(struct dst_entry *); 22 void (*destroy)(struct dst_entry *);
23 void (*ifdown)(struct dst_entry *, 23 void (*ifdown)(struct dst_entry *,
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index b897d6e6d0a5..f941964a9931 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -31,6 +31,7 @@
31/** struct ip_options - IP Options 31/** struct ip_options - IP Options
32 * 32 *
33 * @faddr - Saved first hop address 33 * @faddr - Saved first hop address
34 * @nexthop - Saved nexthop address in LSRR and SSRR
34 * @is_data - Options in __data, rather than skb 35 * @is_data - Options in __data, rather than skb
35 * @is_strictroute - Strict source route 36 * @is_strictroute - Strict source route
36 * @srr_is_hit - Packet destination addr was our one 37 * @srr_is_hit - Packet destination addr was our one
@@ -41,6 +42,7 @@
41 */ 42 */
42struct ip_options { 43struct ip_options {
43 __be32 faddr; 44 __be32 faddr;
45 __be32 nexthop;
44 unsigned char optlen; 46 unsigned char optlen;
45 unsigned char srr; 47 unsigned char srr;
46 unsigned char rr; 48 unsigned char rr;
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 78c83e62218f..e9ff3fc5e688 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -35,6 +35,7 @@ struct inet_peer {
35 35
36 u32 metrics[RTAX_MAX]; 36 u32 metrics[RTAX_MAX];
37 u32 rate_tokens; /* rate limiting for ICMP */ 37 u32 rate_tokens; /* rate limiting for ICMP */
38 int redirect_genid;
38 unsigned long rate_last; 39 unsigned long rate_last;
39 unsigned long pmtu_expires; 40 unsigned long pmtu_expires;
40 u32 pmtu_orig; 41 u32 pmtu_orig;
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h
index 4283508b3e18..a88fb6939387 100644
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -67,18 +67,18 @@ struct nf_ct_event_notifier {
67 int (*fcn)(unsigned int events, struct nf_ct_event *item); 67 int (*fcn)(unsigned int events, struct nf_ct_event *item);
68}; 68};
69 69
70extern struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; 70extern int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *nb);
71extern int nf_conntrack_register_notifier(struct nf_ct_event_notifier *nb); 71extern void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *nb);
72extern void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *nb);
73 72
74extern void nf_ct_deliver_cached_events(struct nf_conn *ct); 73extern void nf_ct_deliver_cached_events(struct nf_conn *ct);
75 74
76static inline void 75static inline void
77nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) 76nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
78{ 77{
78 struct net *net = nf_ct_net(ct);
79 struct nf_conntrack_ecache *e; 79 struct nf_conntrack_ecache *e;
80 80
81 if (nf_conntrack_event_cb == NULL) 81 if (net->ct.nf_conntrack_event_cb == NULL)
82 return; 82 return;
83 83
84 e = nf_ct_ecache_find(ct); 84 e = nf_ct_ecache_find(ct);
@@ -95,11 +95,12 @@ nf_conntrack_eventmask_report(unsigned int eventmask,
95 int report) 95 int report)
96{ 96{
97 int ret = 0; 97 int ret = 0;
98 struct net *net = nf_ct_net(ct);
98 struct nf_ct_event_notifier *notify; 99 struct nf_ct_event_notifier *notify;
99 struct nf_conntrack_ecache *e; 100 struct nf_conntrack_ecache *e;
100 101
101 rcu_read_lock(); 102 rcu_read_lock();
102 notify = rcu_dereference(nf_conntrack_event_cb); 103 notify = rcu_dereference(net->ct.nf_conntrack_event_cb);
103 if (notify == NULL) 104 if (notify == NULL)
104 goto out_unlock; 105 goto out_unlock;
105 106
@@ -164,9 +165,8 @@ struct nf_exp_event_notifier {
164 int (*fcn)(unsigned int events, struct nf_exp_event *item); 165 int (*fcn)(unsigned int events, struct nf_exp_event *item);
165}; 166};
166 167
167extern struct nf_exp_event_notifier __rcu *nf_expect_event_cb; 168extern int nf_ct_expect_register_notifier(struct net *net, struct nf_exp_event_notifier *nb);
168extern int nf_ct_expect_register_notifier(struct nf_exp_event_notifier *nb); 169extern void nf_ct_expect_unregister_notifier(struct net *net, struct nf_exp_event_notifier *nb);
169extern void nf_ct_expect_unregister_notifier(struct nf_exp_event_notifier *nb);
170 170
171static inline void 171static inline void
172nf_ct_expect_event_report(enum ip_conntrack_expect_events event, 172nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
@@ -174,11 +174,12 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
174 u32 pid, 174 u32 pid,
175 int report) 175 int report)
176{ 176{
177 struct net *net = nf_ct_exp_net(exp);
177 struct nf_exp_event_notifier *notify; 178 struct nf_exp_event_notifier *notify;
178 struct nf_conntrack_ecache *e; 179 struct nf_conntrack_ecache *e;
179 180
180 rcu_read_lock(); 181 rcu_read_lock();
181 notify = rcu_dereference(nf_expect_event_cb); 182 notify = rcu_dereference(net->ct.nf_expect_event_cb);
182 if (notify == NULL) 183 if (notify == NULL)
183 goto out_unlock; 184 goto out_unlock;
184 185
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 0249399e51a7..7a911eca0f18 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -18,6 +18,8 @@ struct netns_ct {
18 struct hlist_nulls_head unconfirmed; 18 struct hlist_nulls_head unconfirmed;
19 struct hlist_nulls_head dying; 19 struct hlist_nulls_head dying;
20 struct ip_conntrack_stat __percpu *stat; 20 struct ip_conntrack_stat __percpu *stat;
21 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
22 struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
21 int sysctl_events; 23 int sysctl_events;
22 unsigned int sysctl_events_retry_timeout; 24 unsigned int sysctl_events_retry_timeout;
23 int sysctl_acct; 25 int sysctl_acct;
diff --git a/include/net/red.h b/include/net/red.h
index 3319f16b3beb..b72a3b833936 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -116,7 +116,7 @@ struct red_parms {
116 u32 qR; /* Cached random number */ 116 u32 qR; /* Cached random number */
117 117
118 unsigned long qavg; /* Average queue length: A scaled */ 118 unsigned long qavg; /* Average queue length: A scaled */
119 psched_time_t qidlestart; /* Start of current idle period */ 119 ktime_t qidlestart; /* Start of current idle period */
120}; 120};
121 121
122static inline u32 red_rmask(u8 Plog) 122static inline u32 red_rmask(u8 Plog)
@@ -148,17 +148,17 @@ static inline void red_set_parms(struct red_parms *p,
148 148
149static inline int red_is_idling(struct red_parms *p) 149static inline int red_is_idling(struct red_parms *p)
150{ 150{
151 return p->qidlestart != PSCHED_PASTPERFECT; 151 return p->qidlestart.tv64 != 0;
152} 152}
153 153
154static inline void red_start_of_idle_period(struct red_parms *p) 154static inline void red_start_of_idle_period(struct red_parms *p)
155{ 155{
156 p->qidlestart = psched_get_time(); 156 p->qidlestart = ktime_get();
157} 157}
158 158
159static inline void red_end_of_idle_period(struct red_parms *p) 159static inline void red_end_of_idle_period(struct red_parms *p)
160{ 160{
161 p->qidlestart = PSCHED_PASTPERFECT; 161 p->qidlestart.tv64 = 0;
162} 162}
163 163
164static inline void red_restart(struct red_parms *p) 164static inline void red_restart(struct red_parms *p)
@@ -170,13 +170,10 @@ static inline void red_restart(struct red_parms *p)
170 170
171static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p) 171static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p)
172{ 172{
173 psched_time_t now; 173 s64 delta = ktime_us_delta(ktime_get(), p->qidlestart);
174 long us_idle; 174 long us_idle = min_t(s64, delta, p->Scell_max);
175 int shift; 175 int shift;
176 176
177 now = psched_get_time();
178 us_idle = psched_tdiff_bounded(now, p->qidlestart, p->Scell_max);
179
180 /* 177 /*
181 * The problem: ideally, average length queue recalcultion should 178 * The problem: ideally, average length queue recalcultion should
182 * be done over constant clock intervals. This is too expensive, so 179 * be done over constant clock intervals. This is too expensive, so
diff --git a/include/net/route.h b/include/net/route.h
index db7b3432f07c..91855d185b53 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -71,12 +71,12 @@ struct rtable {
71 struct fib_info *fi; /* for client ref to shared metrics */ 71 struct fib_info *fi; /* for client ref to shared metrics */
72}; 72};
73 73
74static inline bool rt_is_input_route(struct rtable *rt) 74static inline bool rt_is_input_route(const struct rtable *rt)
75{ 75{
76 return rt->rt_route_iif != 0; 76 return rt->rt_route_iif != 0;
77} 77}
78 78
79static inline bool rt_is_output_route(struct rtable *rt) 79static inline bool rt_is_output_route(const struct rtable *rt)
80{ 80{
81 return rt->rt_route_iif == 0; 81 return rt->rt_route_iif == 0;
82} 82}