aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-04-24 01:26:16 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:29:45 -0400
commit164891aadf1721fca4dce473bb0e0998181537c6 (patch)
tree991393ec7306da475cb306fcc7cb084f737ebadc /include/net
parent65d1b4a7e73fe0e1f5275ad7d2d3547981480886 (diff)
[TCP]: Congestion control API update.
Do some simple changes to make congestion control API faster/cleaner. * use ktime_t rather than timeval * merge rtt sampling into existing ack callback this means one indirect call versus two per ack. * use flags bits to store options/settings Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/tcp.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 43910fe3c448..a385797f160a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -629,9 +629,12 @@ enum tcp_ca_event {
629#define TCP_CA_MAX 128 629#define TCP_CA_MAX 128
630#define TCP_CA_BUF_MAX (TCP_CA_NAME_MAX*TCP_CA_MAX) 630#define TCP_CA_BUF_MAX (TCP_CA_NAME_MAX*TCP_CA_MAX)
631 631
632#define TCP_CONG_NON_RESTRICTED 0x1
633#define TCP_CONG_RTT_STAMP 0x2
634
632struct tcp_congestion_ops { 635struct tcp_congestion_ops {
633 struct list_head list; 636 struct list_head list;
634 int non_restricted; 637 unsigned long flags;
635 638
636 /* initialize private data (optional) */ 639 /* initialize private data (optional) */
637 void (*init)(struct sock *sk); 640 void (*init)(struct sock *sk);
@@ -645,8 +648,6 @@ struct tcp_congestion_ops {
645 /* do new cwnd calculation (required) */ 648 /* do new cwnd calculation (required) */
646 void (*cong_avoid)(struct sock *sk, u32 ack, 649 void (*cong_avoid)(struct sock *sk, u32 ack,
647 u32 rtt, u32 in_flight, int good_ack); 650 u32 rtt, u32 in_flight, int good_ack);
648 /* round trip time sample per acked packet (optional) */
649 void (*rtt_sample)(struct sock *sk, u32 usrtt);
650 /* call before changing ca_state (optional) */ 651 /* call before changing ca_state (optional) */
651 void (*set_state)(struct sock *sk, u8 new_state); 652 void (*set_state)(struct sock *sk, u8 new_state);
652 /* call when cwnd event occurs (optional) */ 653 /* call when cwnd event occurs (optional) */
@@ -654,7 +655,7 @@ struct tcp_congestion_ops {
654 /* new value of cwnd after loss (optional) */ 655 /* new value of cwnd after loss (optional) */
655 u32 (*undo_cwnd)(struct sock *sk); 656 u32 (*undo_cwnd)(struct sock *sk);
656 /* hook for packet ack accounting (optional) */ 657 /* hook for packet ack accounting (optional) */
657 void (*pkts_acked)(struct sock *sk, u32 num_acked); 658 void (*pkts_acked)(struct sock *sk, u32 num_acked, ktime_t last);
658 /* get info for inet_diag (optional) */ 659 /* get info for inet_diag (optional) */
659 void (*get_info)(struct sock *sk, u32 ext, struct sk_buff *skb); 660 void (*get_info)(struct sock *sk, u32 ext, struct sk_buff *skb);
660 661