Commit 3d0213fb authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/sparc-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 9dd8f18b 49082d39
......@@ -281,6 +281,14 @@ tcp_rfc1337 - BOOLEAN
assassination.
Default: 0
tcp_low_latency - BOOLEAN
If set, the TCP stack makes decisions that prefer lower
latency as opposed to higher throughput. By default, this
option is not set meaning that higher throughput is preferred.
An example of an application where this default should be
changed would be a Beowulf compute cluster.
Default: 0
ip_local_port_range - 2 INTEGERS
Defines the local port range that is used by TCP and UDP to
choose the local port. The first number is the first, the
......
......@@ -962,11 +962,10 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
if (ppp->pass_filter.filter
&& sk_run_filter(skb, ppp->pass_filter.filter,
ppp->pass_filter.len) == 0) {
if (ppp->debug & 1) {
if (ppp->debug & 1)
printk(KERN_DEBUG "PPP: outbound frame not passed\n");
kfree_skb(skb);
return;
}
kfree_skb(skb);
return;
}
/* if this packet passes the active filter, record the time */
if (!(ppp->active_filter.filter
......
......@@ -305,7 +305,8 @@ enum
NET_IPV4_ICMP_RATELIMIT=89,
NET_IPV4_ICMP_RATEMASK=90,
NET_TCP_TW_REUSE=91,
NET_TCP_FRTO=92
NET_TCP_FRTO=92,
NET_TCP_LOW_LATENCY=93
};
enum {
......
......@@ -96,7 +96,7 @@ extern int ip_mc_output(struct sk_buff *skb);
extern int ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*));
extern int ip_do_nat(struct sk_buff *skb);
extern void ip_send_check(struct iphdr *ip);
extern int ip_queue_xmit(struct sk_buff *skb);
extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok);
extern void ip_init(void);
extern int ip_append_data(struct sock *sk,
int getfrag(void *from, char *to, int offset, int len,
......
......@@ -167,7 +167,7 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst,
ip_rt_put(*rp);
*rp = NULL;
}
return ip_route_output_flow(rp, &fl, sk, 0);
return ip_route_output_flow(rp, &fl, sk, 1);
}
static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport,
......
......@@ -474,6 +474,7 @@ extern int sysctl_tcp_app_win;
extern int sysctl_tcp_adv_win_scale;
extern int sysctl_tcp_tw_reuse;
extern int sysctl_tcp_frto;
extern int sysctl_tcp_low_latency;
extern atomic_t tcp_memory_allocated;
extern atomic_t tcp_sockets_allocated;
......@@ -566,7 +567,8 @@ static inline void tcp_openreq_free(struct open_request *req)
*/
struct tcp_func {
int (*queue_xmit) (struct sk_buff *skb);
int (*queue_xmit) (struct sk_buff *skb,
int ipfragok);
void (*send_check) (struct sock *sk,
struct tcphdr *th,
......@@ -1348,7 +1350,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
{
struct tcp_opt *tp = tcp_sk(sk);
if (tp->ucopy.task) {
if (!sysctl_tcp_low_latency && tp->ucopy.task) {
__skb_queue_tail(&tp->ucopy.prequeue, skb);
tp->ucopy.memory += skb->truesize;
if (tp->ucopy.memory > sk->rcvbuf) {
......
......@@ -280,6 +280,8 @@ int ah_input(struct xfrm_state *x, struct sk_buff *skb)
pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
goto out;
skb->ip_summed = CHECKSUM_NONE;
ah = (struct ip_auth_hdr*)skb->data;
iph = skb->nh.iph;
......
......@@ -481,6 +481,8 @@ int esp_input(struct xfrm_state *x, struct sk_buff *skb)
if ((nfrags = skb_cow_data(skb, 0, &trailer)) < 0)
goto out;
skb->ip_summed = CHECKSUM_NONE;
esph = (struct ip_esp_hdr*)skb->data;
iph = skb->nh.iph;
......
......@@ -941,7 +941,7 @@ static __inline__ struct fib_node *fib_get_next(struct seq_file *seq)
if (!iter->zone)
goto out;
if (iter->zone->fz_next);
if (iter->zone->fz_next)
break;
}
......
......@@ -280,7 +280,7 @@ int ip_output(struct sk_buff *skb)
return ip_finish_output(skb);
}
int ip_queue_xmit(struct sk_buff *skb)
int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
{
struct sock *sk = skb->sk;
struct inet_opt *inet = inet_sk(sk);
......@@ -337,7 +337,7 @@ int ip_queue_xmit(struct sk_buff *skb)
iph = (struct iphdr *) skb_push(skb, sizeof(struct iphdr) + (opt ? opt->optlen : 0));
*((__u16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff));
iph->tot_len = htons(skb->len);
if (ip_dont_fragment(sk, &rt->u.dst))
if (ip_dont_fragment(sk, &rt->u.dst) && !ipfragok)
iph->frag_off = htons(IP_DF);
else
iph->frag_off = 0;
......
......@@ -223,6 +223,8 @@ ctl_table ipv4_table[] = {
&sysctl_tcp_tw_reuse, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_TCP_FRTO, "tcp_frto",
&sysctl_tcp_frto, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_TCP_LOW_LATENCY, "tcp_low_latency",
&sysctl_tcp_low_latency, sizeof(int), 0644, NULL, &proc_dointvec},
{0}
};
......
......@@ -75,6 +75,7 @@
extern int sysctl_ip_dynaddr;
extern int sysctl_ip_default_ttl;
int sysctl_tcp_tw_reuse;
int sysctl_tcp_low_latency;
/* Check TCP sequence numbers in ICMP packets. */
#define ICMP_MIN_LENGTH 8
......@@ -86,11 +87,11 @@ void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len,
struct sk_buff *skb);
struct tcp_hashinfo __cacheline_aligned tcp_hashinfo = {
.__tcp_lhash_lock = RW_LOCK_UNLOCKED,
.__tcp_lhash_users = ATOMIC_INIT(0),
.__tcp_lhash_lock = RW_LOCK_UNLOCKED,
.__tcp_lhash_users = ATOMIC_INIT(0),
.__tcp_lhash_wait
= __WAIT_QUEUE_HEAD_INITIALIZER(tcp_hashinfo.__tcp_lhash_wait),
.__tcp_portalloc_lock = SPIN_LOCK_UNLOCKED
.__tcp_portalloc_lock = SPIN_LOCK_UNLOCKED
};
/*
......@@ -1410,11 +1411,11 @@ static inline struct ip_options *tcp_v4_save_options(struct sock *sk,
int sysctl_max_syn_backlog = 256;
struct or_calltable or_ipv4 = {
.family = PF_INET,
.rtx_syn_ack = tcp_v4_send_synack,
.send_ack = tcp_v4_or_send_ack,
.destructor = tcp_v4_or_free,
.send_reset = tcp_v4_send_reset,
.family = PF_INET,
.rtx_syn_ack = tcp_v4_send_synack,
.send_ack = tcp_v4_or_send_ack,
.destructor = tcp_v4_or_free,
.send_reset = tcp_v4_send_reset,
};
int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
......@@ -2047,17 +2048,17 @@ int tcp_v4_tw_remember_stamp(struct tcp_tw_bucket *tw)
}
struct tcp_func ipv4_specific = {
.queue_xmit = ip_queue_xmit,
.send_check = tcp_v4_send_check,
.rebuild_header =tcp_v4_rebuild_header,
.conn_request = tcp_v4_conn_request,
.syn_recv_sock =tcp_v4_syn_recv_sock,
.remember_stamp =tcp_v4_remember_stamp,
.net_header_len =sizeof(struct iphdr),
.setsockopt = ip_setsockopt,
.getsockopt = ip_getsockopt,
.addr2sockaddr =v4_addr2sockaddr,
.sockaddr_len = sizeof(struct sockaddr_in),
.queue_xmit = ip_queue_xmit,
.send_check = tcp_v4_send_check,
.rebuild_header = tcp_v4_rebuild_header,
.conn_request = tcp_v4_conn_request,
.syn_recv_sock = tcp_v4_syn_recv_sock,
.remember_stamp = tcp_v4_remember_stamp,
.net_header_len = sizeof(struct iphdr),
.setsockopt = ip_setsockopt,
.getsockopt = ip_getsockopt,
.addr2sockaddr = v4_addr2sockaddr,
.sockaddr_len = sizeof(struct sockaddr_in),
};
/* NOTE: A lot of things set to zero explicitly by call to
......@@ -2543,10 +2544,10 @@ static int tcp_seq_show(struct seq_file *seq, void *v)
}
static struct seq_operations tcp_seq_ops = {
.start = tcp_seq_start,
.next = tcp_seq_next,
.stop = tcp_seq_stop,
.show = tcp_seq_show,
.start = tcp_seq_start,
.next = tcp_seq_next,
.stop = tcp_seq_stop,
.show = tcp_seq_show,
};
static int tcp_seq_open(struct inode *inode, struct file *file)
......@@ -2571,10 +2572,10 @@ static int tcp_seq_open(struct inode *inode, struct file *file)
}
static struct file_operations tcp_seq_fops = {
.open = tcp_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = ip_seq_release,
.open = tcp_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = ip_seq_release,
};
int __init tcp_proc_init(void)
......@@ -2596,23 +2597,23 @@ void __init tcp_proc_exit(void)
#endif /* CONFIG_PROC_FS */
struct proto tcp_prot = {
.name = "TCP",
.close = tcp_close,
.connect = tcp_v4_connect,
.disconnect = tcp_disconnect,
.accept = tcp_accept,
.ioctl = tcp_ioctl,
.init = tcp_v4_init_sock,
.destroy = tcp_v4_destroy_sock,
.shutdown = tcp_shutdown,
.setsockopt = tcp_setsockopt,
.getsockopt = tcp_getsockopt,
.sendmsg = tcp_sendmsg,
.recvmsg = tcp_recvmsg,
.backlog_rcv = tcp_v4_do_rcv,
.hash = tcp_v4_hash,
.unhash = tcp_unhash,
.get_port = tcp_v4_get_port,
.name = "TCP",
.close = tcp_close,
.connect = tcp_v4_connect,
.disconnect = tcp_disconnect,
.accept = tcp_accept,
.ioctl = tcp_ioctl,
.init = tcp_v4_init_sock,
.destroy = tcp_v4_destroy_sock,
.shutdown = tcp_shutdown,
.setsockopt = tcp_setsockopt,
.getsockopt = tcp_getsockopt,
.sendmsg = tcp_sendmsg,
.recvmsg = tcp_recvmsg,
.backlog_rcv = tcp_v4_do_rcv,
.hash = tcp_v4_hash,
.unhash = tcp_unhash,
.get_port = tcp_v4_get_port,
};
......
......@@ -952,6 +952,12 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN))
goto embryonic_reset;
/* ACK sequence verified above, just make sure ACK is
* set. If ACK not set, just silently drop the packet.
*/
if (!(flg & TCP_FLAG_ACK))
return NULL;
/* If TCP_DEFER_ACCEPT is set, drop bare ACK. */
if (tp->defer_accept && TCP_SKB_CB(skb)->end_seq == req->rcv_isn+1) {
req->acked = 1;
......
......@@ -276,7 +276,7 @@ int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
TCP_INC_STATS(TcpOutSegs);
err = tp->af_specific->queue_xmit(skb);
err = tp->af_specific->queue_xmit(skb, 0);
if (err <= 0)
return err;
......@@ -786,13 +786,13 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
/* Ok. We will be able to collapse the packet. */
__skb_unlink(next_skb, next_skb->list);
memcpy(skb_put(skb, next_skb_size), next_skb->data, next_skb_size);
if (next_skb->ip_summed == CHECKSUM_HW)
skb->ip_summed = CHECKSUM_HW;
if (skb->ip_summed != CHECKSUM_HW) {
memcpy(skb_put(skb, next_skb_size), next_skb->data, next_skb_size);
if (skb->ip_summed != CHECKSUM_HW)
skb->csum = csum_block_add(skb->csum, next_skb->csum, skb_size);
}
/* Update sequence range on original skb. */
TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(next_skb)->end_seq;
......
......@@ -276,9 +276,11 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr)
copy_to_user_state(x, p);
if (x->aalg)
RTA_PUT(skb, XFRMA_ALG_AUTH, sizeof(*(x->aalg)), x->aalg);
RTA_PUT(skb, XFRMA_ALG_AUTH,
sizeof(*(x->aalg))+(x->aalg->alg_key_len+7)/8, x->aalg);
if (x->ealg)
RTA_PUT(skb, XFRMA_ALG_CRYPT, sizeof(*(x->ealg)), x->ealg);
RTA_PUT(skb, XFRMA_ALG_CRYPT,
sizeof(*(x->ealg))+(x->ealg->alg_key_len+7)/8, x->ealg);
if (x->calg)
RTA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg);
......@@ -655,6 +657,7 @@ static int xfrm_dump_policy(struct sk_buff *skb, struct netlink_callback *cb)
info.in_skb = cb->skb;
info.out_skb = skb;
info.nlmsg_seq = cb->nlh->nlmsg_seq;
info.this_idx = 0;
info.start_idx = cb->args[0];
(void) xfrm_policy_walk(dump_one_policy, &info);
cb->args[0] = info.this_idx;
......@@ -752,7 +755,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *err
{
struct rtattr *xfrma[XFRMA_MAX];
struct xfrm_link *link;
int type, min_len, kind;
int type, min_len;
if (!(nlh->nlmsg_flags & NLM_F_REQUEST))
return 0;
......@@ -768,7 +771,6 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *err
goto err_einval;
type -= XFRM_MSG_BASE;
kind = (type & 3);
link = &xfrm_dispatch[type];
/* All operations require privileges, even GET */
......@@ -777,7 +779,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *err
return -1;
}
if (kind == 2 && (nlh->nlmsg_flags & NLM_F_DUMP)) {
if ((type == 2 || type == 5) && (nlh->nlmsg_flags & NLM_F_DUMP)) {
u32 rlen;
if (link->dump == NULL)
......
......@@ -934,11 +934,11 @@ static void tcp_v6_or_free(struct open_request *req)
}
static struct or_calltable or_ipv6 = {
AF_INET6,
tcp_v6_send_synack,
tcp_v6_or_send_ack,
tcp_v6_or_free,
tcp_v6_send_reset
.family = AF_INET6,
.rtx_syn_ack = tcp_v6_send_synack,
.send_ack = tcp_v6_or_send_ack,
.destructor = tcp_v6_or_free,
.send_reset = tcp_v6_send_reset
};
static int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
......@@ -1746,7 +1746,7 @@ static int tcp_v6_rebuild_header(struct sock *sk)
return 0;
}
static int tcp_v6_xmit(struct sk_buff *skb)
static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
{
struct sock *sk = skb->sk;
struct inet_opt *inet = inet_sk(sk);
......@@ -1812,18 +1812,18 @@ static int tcp_v6_remember_stamp(struct sock *sk)
}
static struct tcp_func ipv6_specific = {
tcp_v6_xmit,
tcp_v6_send_check,
tcp_v6_rebuild_header,
tcp_v6_conn_request,
tcp_v6_syn_recv_sock,
tcp_v6_remember_stamp,
sizeof(struct ipv6hdr),
ipv6_setsockopt,
ipv6_getsockopt,
v6_addr2sockaddr,
sizeof(struct sockaddr_in6)
.queue_xmit = tcp_v6_xmit,
.send_check = tcp_v6_send_check,
.rebuild_header = tcp_v6_rebuild_header,
.conn_request = tcp_v6_conn_request,
.syn_recv_sock = tcp_v6_syn_recv_sock,
.remember_stamp = tcp_v6_remember_stamp,
.net_header_len = sizeof(struct ipv6hdr),
.setsockopt = ipv6_setsockopt,
.getsockopt = ipv6_getsockopt,
.addr2sockaddr = v6_addr2sockaddr,
.sockaddr_len = sizeof(struct sockaddr_in6)
};
/*
......@@ -1831,18 +1831,18 @@ static struct tcp_func ipv6_specific = {
*/
static struct tcp_func ipv6_mapped = {
ip_queue_xmit,
tcp_v4_send_check,
tcp_v4_rebuild_header,
tcp_v6_conn_request,
tcp_v6_syn_recv_sock,
tcp_v4_remember_stamp,
sizeof(struct iphdr),
ipv6_setsockopt,
ipv6_getsockopt,
v6_addr2sockaddr,
sizeof(struct sockaddr_in6)
.queue_xmit = ip_queue_xmit,
.send_check = tcp_v4_send_check,
.rebuild_header = tcp_v4_rebuild_header,
.conn_request = tcp_v6_conn_request,
.syn_recv_sock = tcp_v6_syn_recv_sock,
.remember_stamp = tcp_v4_remember_stamp,
.net_header_len = sizeof(struct iphdr),
.setsockopt = ipv6_setsockopt,
.getsockopt = ipv6_getsockopt,
.addr2sockaddr = v6_addr2sockaddr,
.sockaddr_len = sizeof(struct sockaddr_in6)
};
......@@ -2157,23 +2157,23 @@ int tcp6_get_info(char *buffer, char **start, off_t offset, int length)
}
struct proto tcpv6_prot = {
.name = "TCPv6",
.close = tcp_close,
.connect = tcp_v6_connect,
.disconnect = tcp_disconnect,
.accept = tcp_accept,
.ioctl = tcp_ioctl,
.init = tcp_v6_init_sock,
.destroy = tcp_v6_destroy_sock,
.shutdown = tcp_shutdown,
.setsockopt = tcp_setsockopt,
.getsockopt = tcp_getsockopt,
.sendmsg = tcp_sendmsg,
.recvmsg = tcp_recvmsg,
.backlog_rcv = tcp_v6_do_rcv,
.hash = tcp_v6_hash,
.unhash = tcp_unhash,
.get_port = tcp_v6_get_port,
.name = "TCPv6",
.close = tcp_close,
.connect = tcp_v6_connect,
.disconnect = tcp_disconnect,
.accept = tcp_accept,
.ioctl = tcp_ioctl,
.init = tcp_v6_init_sock,
.destroy = tcp_v6_destroy_sock,
.shutdown = tcp_shutdown,
.setsockopt = tcp_setsockopt,
.getsockopt = tcp_getsockopt,
.sendmsg = tcp_sendmsg,
.recvmsg = tcp_recvmsg,
.backlog_rcv = tcp_v6_do_rcv,
.hash = tcp_v6_hash,
.unhash = tcp_unhash,
.get_port = tcp_v6_get_port,
};
static struct inet6_protocol tcpv6_protocol = {
......@@ -2184,13 +2184,13 @@ static struct inet6_protocol tcpv6_protocol = {
extern struct proto_ops inet6_stream_ops;
static struct inet_protosw tcpv6_protosw = {
.type = SOCK_STREAM,
.protocol = IPPROTO_TCP,
.prot = &tcpv6_prot,
.ops = &inet6_stream_ops,
.capability =-1,
.no_check = 0,
.flags = INET_PROTOSW_PERMANENT,
.type = SOCK_STREAM,
.protocol = IPPROTO_TCP,
.prot = &tcpv6_prot,
.ops = &inet6_stream_ops,
.capability = -1,
.no_check = 0,
.flags = INET_PROTOSW_PERMANENT,
};
void __init tcpv6_init(void)
......
......@@ -248,6 +248,8 @@ EXPORT_SYMBOL(inet_unregister_protosw);
EXPORT_SYMBOL(ip_route_output_key);
EXPORT_SYMBOL(ip_route_input);
EXPORT_SYMBOL(icmp_send);
EXPORT_SYMBOL(icmp_statistics);
EXPORT_SYMBOL(icmp_err_convert);
EXPORT_SYMBOL(ip_options_compile);
EXPORT_SYMBOL(ip_options_undo);
EXPORT_SYMBOL(arp_send);
......@@ -427,6 +429,7 @@ EXPORT_SYMBOL(sysctl_tcp_wmem);
EXPORT_SYMBOL(sysctl_tcp_ecn);
EXPORT_SYMBOL(tcp_cwnd_application_limited);
EXPORT_SYMBOL(tcp_sendpage);
EXPORT_SYMBOL(sysctl_tcp_low_latency);
EXPORT_SYMBOL(tcp_write_xmit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment