Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inital merge from Linux source tree 2.6.31.9 to 2.6.32 for aNCR #1

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/linux/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ enum
NET_TCP_ALLOWED_CONG_CONTROL=123,
NET_TCP_MAX_SSTHRESH=124,
NET_TCP_FRTO_RESPONSE=125,
NET_TCP_REORDER=126,
NET_TCP_AVAIL_REORDER=127,
NET_TCP_ALLOWED_REORDER=128,
};

enum {
Expand Down
27 changes: 21 additions & 6 deletions include/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct tcphdr {
fin:1;
#else
#error "Adjust your <asm/byteorder.h> defines"
#endif
#endif
__be16 window;
__sum16 check;
__be16 urg_ptr;
Expand All @@ -61,14 +61,14 @@ struct tcphdr {
* (union is compatible to any of its members)
* This means this part of the code is -fstrict-aliasing safe now.
*/
union tcp_word_hdr {
union tcp_word_hdr {
struct tcphdr hdr;
__be32 words[5];
};
};

#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])

enum {
enum {
TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
TCP_FLAG_URG = __cpu_to_be32(0x00200000),
Expand All @@ -79,7 +79,7 @@ enum {
TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
};
};

/* TCP socket options */
#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
Expand All @@ -96,6 +96,8 @@ enum {
#define TCP_QUICKACK 12 /* Block/reenable quick acks */
#define TCP_CONGESTION 13 /* Congestion control algorithm */
#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
#define TCP_REORDER 15 /* Reordering Algorithm */
#define TCP_REORDER_MODE 16 /* meaning of "mode" depends on reorder module */

#define TCPI_OPT_TIMESTAMPS 1
#define TCPI_OPT_SACK 2
Expand Down Expand Up @@ -157,6 +159,11 @@ struct tcp_info
__u32 tcpi_rcv_space;

__u32 tcpi_total_retrans;
__u32 tcpi_total_fast_retrans;
__u32 tcpi_total_rto_retrans;
__u32 tcpi_total_dsacks;
__u32 tcpi_dupthresh;
__u32 tcpi_last_reor_sample;
};

/* for TCP_MD5SIG socket option */
Expand Down Expand Up @@ -244,6 +251,13 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
return (struct tcp_request_sock *)req;
}

struct reorder_sample {
struct list_head list;
u32 seq;
int factor;
int sample;
};

struct tcp_sock {
/* inet_connection_sock has to be the first member of tcp_sock */
struct inet_connection_sock inet_conn;
Expand Down Expand Up @@ -330,6 +344,7 @@ struct tcp_sock {
u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
u32 snd_cwnd_used;
u32 snd_cwnd_stamp;
u32 current_cwnd;

u32 rcv_wnd; /* Current receiver window */
u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
Expand Down
8 changes: 8 additions & 0 deletions include/net/inet_connection_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ struct inet_connection_sock {
__u32 icsk_rto;
__u32 icsk_pmtu_cookie;
const struct tcp_congestion_ops *icsk_ca_ops;
const struct tcp_reorder_ops *icsk_ro_ops;
const struct inet_connection_sock_af_ops *icsk_af_ops;
unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
__u8 icsk_ca_state;
Expand Down Expand Up @@ -126,7 +127,9 @@ struct inet_connection_sock {
int probe_size;
} icsk_mtup;
u32 icsk_ca_priv[16];
u32 icsk_ro_priv[5];
#define ICSK_CA_PRIV_SIZE (16 * sizeof(u32))
#define ICSK_RO_PRIV_SIZE (5 * sizeof(u32))
};

#define ICSK_TIME_RETRANS 1 /* Retransmit timer */
Expand All @@ -144,6 +147,11 @@ static inline void *inet_csk_ca(const struct sock *sk)
return (void *)inet_csk(sk)->icsk_ca_priv;
}

static inline void *inet_csk_ro(const struct sock *sk)
{
return (void *)inet_csk(sk)->icsk_ro_priv;
}

extern struct sock *inet_csk_clone(struct sock *sk,
const struct request_sock *req,
const gfp_t priority);
Expand Down
68 changes: 66 additions & 2 deletions include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,11 @@ extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
int nonagle);
extern int tcp_may_send_now(struct sock *sk);
extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
extern int tcp_retransmit_skb(struct sock *, struct sk_buff *, int fast_rexmit);
//extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
extern void tcp_retransmit_timer(struct sock *sk);
extern void tcp_xmit_retransmit_queue(struct sock *);
extern void tcp_xmit_retransmit_queue(struct sock *, int fast_rexmit);
//extern void tcp_xmit_retransmit_queue(struct sock *);
extern void tcp_simple_retransmit(struct sock *);
extern int tcp_trim_head(struct sock *, struct sk_buff *, u32);
extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int);
Expand Down Expand Up @@ -653,6 +655,68 @@ static inline int tcp_skb_mss(const struct sk_buff *skb)
return skb_shinfo(skb)->gso_size;
}

/*
* Interface for adding new TCP segment reordering handlers
*/
#define TCP_REORDER_NAME_MAX 16
#define TCP_REORDER_MAX 128
#define TCP_REORDER_BUF_MAX (TCP_REORDER_NAME_MAX*TCP_REORDER_MAX)

#define TCP_REORDER_NON_RESTRICTED 0x1

struct tcp_reorder_ops {
struct list_head list;
unsigned long flags;

/* initialize private data (optional) */
void (*init)(struct sock *sk);
/* cleanup private data (optional) */
void (*release)(struct sock *sk);

/* return dupack threshold (required) */
u32 (*dupthresh)(struct sock *sk);
u32 (*moddupthresh)(struct sock *sk);
/* update the mode of operation (required) */
void (*update_mode)(struct sock *sk, int val);
/* allow cwnd moderation in disorder state [bool] (required) */
int allow_moderation;
/* allow head timeout to trigger fast recovery [bool] (required) */
int allow_head_to;

/* a new sack'ed segment (optional) */
void (*new_sack)(struct sock *sk);
/* a non-retransmitted SACK hole was filled (optional) */
void (*sack_hole_filled)(struct sock *sk, int flag);
/* state machine will start now (optional) */
void (*sm_starts)(struct sock *sk, int flag, int acked);
/* recovery phase starts (optional) */
void (*recovery_starts)(struct sock *sk, int flag);
void (*recovery_ends)(struct sock *sk, int flag);
/* reordering event with a certain degree was detected (optional) */
void (*reorder_detected)(struct sock *sk, int length);
/* reordering event with a certain factor was detected (optional) */
void (*reorder_detected_factor)(struct sock *sk, int factor);
/* a RTO timeout happened (optional) */
void (*rto_happened)(struct sock *sk);

char name[TCP_REORDER_NAME_MAX];
struct module *owner;
};

extern int tcp_register_reorder(struct tcp_reorder_ops *ro);
extern void tcp_unregister_reorder(struct tcp_reorder_ops *ro);
extern void tcp_init_reorder(struct sock *sk);
extern void tcp_cleanup_reorder(struct sock *sk);
extern int tcp_set_default_reorder(const char *name);
extern void tcp_get_default_reorder(char *name);
extern void tcp_get_available_reorder(char *buf, size_t maxlen);
extern void tcp_get_allowed_reorder(char *buf, size_t maxlen);
extern int tcp_set_allowed_reorder(char *val);
extern int tcp_set_reorder(struct sock *sk, const char *name);
extern u32 tcp_native_dupthresh(struct sock *sk);
extern struct tcp_reorder_ops tcp_init_reorder_ops;
extern struct tcp_reorder_ops tcp_native;

/* Events passed to congestion control interface */
enum tcp_ca_event {
CA_EVENT_TX_START, /* first transmit when no packets in flight */
Expand Down
3 changes: 3 additions & 0 deletions kernel/sysctl_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ static const struct trans_ctl_table trans_net_ipv4_table[] = {
{ NET_TCP_ALLOWED_CONG_CONTROL, "tcp_allowed_congestion_control" },
{ NET_TCP_MAX_SSTHRESH, "tcp_max_ssthresh" },
{ NET_TCP_FRTO_RESPONSE, "tcp_frto_response" },
{ NET_TCP_REORDER, "tcp_reorder"}
{ NET_TCP_AVAIL_REORDER, "tcp_available_reorder"}
{ NET_TCP_ALLOWED_REORDER, "tcp_allowed_reorder"}
{ 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" },
{}
};
Expand Down
26 changes: 26 additions & 0 deletions nameonly.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
This file contains the list of files that were originally added/modified to the
linux source tree for aNCR implementation

config-meshnode
config-vmeshnode-pae
include/linux/sysctl.h
include/linux/tcp.h
include/net/inet_connection_sock.h
include/net/tcp.h
kernel/sysctl_check.c
net/ipv4/Kconfig
net/ipv4/Makefile
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp.c
net/ipv4/tcp_ancr.c
net/ipv4/tcp_cong.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_leungma.c
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_ncr.c
net/ipv4/tcp_noreor.c
net/ipv4/tcp_output.c
net/ipv4/tcp_reorder.c
net/ipv4/tcp_timer.c
net/ipv6/tcp_ipv6.c
71 changes: 71 additions & 0 deletions net/ipv4/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -627,3 +627,74 @@ config TCP_MD5SIG

If unsure, say N.

menuconfig TCP_REORDER_ADVANCED
bool "TCP: advanced reordering algorithms"
---help---
Support for selection of various TCP reordering algorithms.

Nearly all users can safely say no here, and a safe default
selection will be made (native Linux algorithm).

If unsure, say N.

if TCP_REORDER_ADVANCED

config TCP_REORDER_NCR
tristate "TCP-NCR"
depends on EXPERIMENTAL
default n
---help---
TCP-NCR improves the robustness of TCP to non-congestion events.
The algorithm is described in RFC4653

For further details see:
http://tools.ietf.org/html/rfc4653

config TCP_REORDER_ANCR
tristate "TCP-ANCR"
depends on EXPERIMENTAL
default n
---help---
TCP-ANCR improves the robustness of TCP to reordering.
It is based on TCP-NCR (http://tools.ietf.org/html/rfc4653)
and the native Linux behavior.

config TCP_REORDER_LEUNGMA
tristate "TCP-LEUNGMA"
depends on EXPERIMENTAL
default n
---help---
TCP-LEUNGMA is based on this paper by Leung
and Ma (http://www.eee.hku.hk/~kcleung/papers/journals/
TCP_reordering:JCN_2005/JCN04-3-107.pdf)

choice
prompt "Default TCP reordering algorithm"
default DEFAULT_REORDER_NATIVE
help
Select the TCP reordering algorithm that will be used by default
for all connections.

config DEFAULT_REORDER_NCR
bool "ncr" if TCP_REORDER_NCR=y

config DEFAULT_REORDER_ANCR
bool "ancr" if TCP_REORDER_ANCR=y

config DEFAULT_REORDER_LEUNGMA
bool "leungma" if TCP_REORDER_LEUNGMA=y

config DEFAULT_REORDER_NATIVE
bool "native"

endchoice

endif

config DEFAULT_TCP_REORDER
string
default "ncr" if DEFAULT_REORDER_NCR
default "ancr" if DEFAULT_REORDER_ANCR
default "leungma" if DEFAULT_REORDER_LEUNGMA
default "native"

6 changes: 5 additions & 1 deletion net/ipv4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ obj-y := route.o inetpeer.o protocol.o \
ip_output.o ip_sockglue.o inet_hashtables.o \
inet_timewait_sock.o inet_connection_sock.o \
tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \
tcp_minisocks.o tcp_cong.o \
tcp_minisocks.o tcp_cong.o tcp_reorder.o \
datagram.o raw.o udp.o udplite.o \
arp.o icmp.o devinet.o af_inet.o igmp.o \
fib_frontend.o fib_semantics.o \
Expand Down Expand Up @@ -48,6 +48,10 @@ obj-$(CONFIG_TCP_CONG_SCALABLE) += tcp_scalable.o
obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o
obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o
obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o
obj-$(CONFIG_TCP_REORDER_NCR) += tcp_ncr.o
obj-$(CONFIG_TCP_REORDER_ANCR) += tcp_ancr.o
obj-$(CONFIG_TCP_REORDER_LEUNGMA) += tcp_leungma.o
#obj-$(CONFIG_TCP_REORDER_NONE) += tcp_noreor.o
obj-$(CONFIG_NETLABEL) += cipso_ipv4.o

obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \
Expand Down
Loading