diff options
Diffstat (limited to 'release/src/linux/linux/include/net')
-rw-r--r-- | release/src/linux/linux/include/net/pkt_cls.h | 6 | ||||
-rw-r--r-- | release/src/linux/linux/include/net/pkt_sched.h | 15 | ||||
-rw-r--r-- | release/src/linux/linux/include/net/sock.h | 14 | ||||
-rw-r--r-- | release/src/linux/linux/include/net/tcp.h | 59 |
4 files changed, 87 insertions, 7 deletions
diff --git a/release/src/linux/linux/include/net/pkt_cls.h b/release/src/linux/linux/include/net/pkt_cls.h index cb2bde23..0926f823 100644 --- a/release/src/linux/linux/include/net/pkt_cls.h +++ b/release/src/linux/linux/include/net/pkt_cls.h @@ -77,7 +77,11 @@ static inline int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, struct return -1; } - +static inline void tcf_destroy(struct tcf_proto *tp) +{ + tp->ops->destroy(tp); + kfree(tp); +} extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); diff --git a/release/src/linux/linux/include/net/pkt_sched.h b/release/src/linux/linux/include/net/pkt_sched.h index a9027b90..7b91dac6 100644 --- a/release/src/linux/linux/include/net/pkt_sched.h +++ b/release/src/linux/linux/include/net/pkt_sched.h @@ -198,6 +198,7 @@ typedef long psched_tdiff_t; #define PSCHED_GET_TIME(stamp) do_gettimeofday(&(stamp)) #define PSCHED_US2JIFFIE(usecs) (((usecs)+(1000000/HZ-1))/(1000000/HZ)) +#define PSCHED_JIFFIE2US(delay) ((delay)*(1000000/HZ)) #define PSCHED_EXPORTLIST EXPORT_SYMBOL(psched_tod_diff); @@ -212,12 +213,16 @@ extern psched_time_t psched_time_base; #if PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES -#if HZ == 100 +#if HZ < 96 +#define PSCHED_JSCALE 14 +#elif HZ >= 96 && HZ < 192 #define PSCHED_JSCALE 13 -#elif HZ == 1024 +#elif HZ >= 192 && HZ < 384 +#define PSCHED_JSCALE 12 +#elif HZ >= 384 && HZ < 768 +#define PSCHED_JSCALE 11 +#elif HZ >= 768 #define PSCHED_JSCALE 10 -#else -#define PSCHED_JSCALE 0 #endif #define PSCHED_EXPORTLIST_2 @@ -242,6 +247,7 @@ extern PSCHED_WATCHER psched_time_mark; #endif #define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE) +#define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE) #elif PSCHED_CLOCK_SOURCE == PSCHED_CPU @@ -252,6 +258,7 @@ extern int psched_clock_scale; EXPORT_SYMBOL(psched_clock_scale); #define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz) +#define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz) #ifdef CONFIG_X86_TSC diff --git a/release/src/linux/linux/include/net/sock.h b/release/src/linux/linux/include/net/sock.h index 0482a102..a2824afb 100644 --- a/release/src/linux/linux/include/net/sock.h +++ b/release/src/linux/linux/include/net/sock.h @@ -417,7 +417,19 @@ struct tcp_opt { unsigned int keepalive_intvl; /* time interval between keep alive probes */ int linger2; - unsigned long last_synq_overflow; + unsigned long last_synq_overflow; + +/* Vegas variables */ + struct { + __u32 beg_snd_nxt; /* right edge during last RTT */ + __u32 beg_snd_una; /* left edge during last RTT */ + __u32 beg_snd_cwnd; /* saves the size of the cwnd */ + __u8 do_vegas; /* do vegas for this connection */ + __u8 doing_vegas_now;/* if true, do vegas for this RTT */ + __u16 cntRTT; /* # of RTTs measured within last RTT */ + __u32 minRTT; /* min of RTTs measured within last RTT (in usec) */ + __u32 baseRTT; /* the min of all Vegas RTT measurements seen (in usec) */ + } vegas; }; diff --git a/release/src/linux/linux/include/net/tcp.h b/release/src/linux/linux/include/net/tcp.h index 6571f4b2..e9a9e254 100644 --- a/release/src/linux/linux/include/net/tcp.h +++ b/release/src/linux/linux/include/net/tcp.h @@ -456,6 +456,10 @@ extern int sysctl_tcp_rmem[3]; extern int sysctl_tcp_app_win; extern int sysctl_tcp_adv_win_scale; extern int sysctl_tcp_tw_reuse; +extern int sysctl_tcp_vegas_cong_avoid; +extern int sysctl_tcp_vegas_alpha; +extern int sysctl_tcp_vegas_beta; +extern int sysctl_tcp_vegas_gamma; extern atomic_t tcp_memory_allocated; extern atomic_t tcp_sockets_allocated; @@ -1070,6 +1074,59 @@ static inline __u32 tcp_recalc_ssthresh(struct tcp_opt *tp) return max(tp->snd_cwnd >> 1U, 2U); } +/* Stop taking Vegas samples for now. */ +#define tcp_vegas_disable(__tp) ((__tp)->vegas.doing_vegas_now = 0) + +/* Is this TCP connection using Vegas (regardless of whether it is taking + * Vegas measurements at the current time)? + */ +#define tcp_is_vegas(__tp) ((__tp)->vegas.do_vegas) + +static inline void tcp_vegas_enable(struct tcp_opt *tp) +{ + /* There are several situations when we must "re-start" Vegas: + * + * o when a connection is established + * o after an RTO + * o after fast recovery + * o when we send a packet and there is no outstanding + * unacknowledged data (restarting an idle connection) + * + * In these circumstances we cannot do a Vegas calculation at the + * end of the first RTT, because any calculation we do is using + * stale info -- both the saved cwnd and congestion feedback are + * stale. + * + * Instead we must wait until the completion of an RTT during + * which we actually receive ACKs. + */ + + /* Begin taking Vegas samples next time we send something. */ + tp->vegas.doing_vegas_now = 1; + + /* Set the beginning of the next send window. */ + tp->vegas.beg_snd_nxt = tp->snd_nxt; + + tp->vegas.cntRTT = 0; + tp->vegas.minRTT = 0x7fffffff; +} + +/* Should we be taking Vegas samples right now? */ +#define tcp_vegas_enabled(__tp) ((__tp)->vegas.doing_vegas_now) + +extern void tcp_vegas_init(struct tcp_opt *tp); + +static inline void tcp_set_ca_state(struct tcp_opt *tp, u8 ca_state) +{ + if (tcp_is_vegas(tp)) { + if (ca_state == TCP_CA_Open) + tcp_vegas_enable(tp); + else + tcp_vegas_disable(tp); + } + tp->ca_state = ca_state; +} + /* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. * The exception is rate halving phase, when cwnd is decreasing towards * ssthresh. @@ -1129,7 +1186,7 @@ static inline void tcp_enter_cwr(struct tcp_opt *tp) tp->prior_ssthresh = 0; if (tp->ca_state < TCP_CA_CWR) { __tcp_enter_cwr(tp); - tp->ca_state = TCP_CA_CWR; + tcp_set_ca_state(tp, TCP_CA_CWR); } } |