diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 18:40:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 18:40:17 -0400 |
commit | e37a72de84d27ee8bc0e7dbb5c2f1774ed306dbb (patch) | |
tree | f9da35cbd79b52a5bd08d4a0f960bde6af741da0 /net/ipv4 | |
parent | 93fdf10d4c28edaa1b9f80e7f9c3002359186d00 (diff) | |
parent | f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[IPV6]: Added GSO support for TCPv6
[NET]: Generalise TSO-specific bits from skb_setup_caps
[IPV6]: Added GSO support for TCPv6
[IPV6]: Remove redundant length check on input
[NETFILTER]: SCTP conntrack: fix crash triggered by packet without chunks
[TG3]: Update version and reldate
[TG3]: Add TSO workaround using GSO
[TG3]: Turn on hw fix for ASF problems
[TG3]: Add rx BD workaround
[TG3]: Add tg3_netif_stop() in vlan functions
[TCP]: Reset gso_segs if packet is dodgy
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_output.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_proto_sctp.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 17 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 9 |
5 files changed, 20 insertions, 14 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 0c872fd0849d..ca0e714613fb 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -743,7 +743,7 @@ static inline int ip_ufo_append_data(struct sock *sk, | |||
743 | if (!err) { | 743 | if (!err) { |
744 | /* specify the length of each IP datagram fragment*/ | 744 | /* specify the length of each IP datagram fragment*/ |
745 | skb_shinfo(skb)->gso_size = mtu - fragheaderlen; | 745 | skb_shinfo(skb)->gso_size = mtu - fragheaderlen; |
746 | skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4; | 746 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; |
747 | __skb_queue_tail(&sk->sk_write_queue, skb); | 747 | __skb_queue_tail(&sk->sk_write_queue, skb); |
748 | 748 | ||
749 | return 0; | 749 | return 0; |
@@ -1088,7 +1088,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page, | |||
1088 | if ((sk->sk_protocol == IPPROTO_UDP) && | 1088 | if ((sk->sk_protocol == IPPROTO_UDP) && |
1089 | (rt->u.dst.dev->features & NETIF_F_UFO)) { | 1089 | (rt->u.dst.dev->features & NETIF_F_UFO)) { |
1090 | skb_shinfo(skb)->gso_size = mtu - fragheaderlen; | 1090 | skb_shinfo(skb)->gso_size = mtu - fragheaderlen; |
1091 | skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4; | 1091 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | 1094 | ||
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c index 0416073c5600..2d3612cd5f18 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c | |||
@@ -254,7 +254,7 @@ static int do_basic_checks(struct ip_conntrack *conntrack, | |||
254 | } | 254 | } |
255 | 255 | ||
256 | DEBUGP("Basic checks passed\n"); | 256 | DEBUGP("Basic checks passed\n"); |
257 | return 0; | 257 | return count == 0; |
258 | } | 258 | } |
259 | 259 | ||
260 | static int new_state(enum ip_conntrack_dir dir, | 260 | static int new_state(enum ip_conntrack_dir dir, |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index a97450e9eb34..804458712d88 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -642,7 +642,7 @@ static inline int select_size(struct sock *sk, struct tcp_sock *tp) | |||
642 | int tmp = tp->mss_cache; | 642 | int tmp = tp->mss_cache; |
643 | 643 | ||
644 | if (sk->sk_route_caps & NETIF_F_SG) { | 644 | if (sk->sk_route_caps & NETIF_F_SG) { |
645 | if (sk->sk_route_caps & NETIF_F_TSO) | 645 | if (sk_can_gso(sk)) |
646 | tmp = 0; | 646 | tmp = 0; |
647 | else { | 647 | else { |
648 | int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); | 648 | int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); |
@@ -2165,13 +2165,19 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2165 | if (!pskb_may_pull(skb, thlen)) | 2165 | if (!pskb_may_pull(skb, thlen)) |
2166 | goto out; | 2166 | goto out; |
2167 | 2167 | ||
2168 | segs = NULL; | ||
2169 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) | ||
2170 | goto out; | ||
2171 | |||
2172 | oldlen = (u16)~skb->len; | 2168 | oldlen = (u16)~skb->len; |
2173 | __skb_pull(skb, thlen); | 2169 | __skb_pull(skb, thlen); |
2174 | 2170 | ||
2171 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) { | ||
2172 | /* Packet is from an untrusted source, reset gso_segs. */ | ||
2173 | int mss = skb_shinfo(skb)->gso_size; | ||
2174 | |||
2175 | skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss; | ||
2176 | |||
2177 | segs = NULL; | ||
2178 | goto out; | ||
2179 | } | ||
2180 | |||
2175 | segs = skb_segment(skb, features); | 2181 | segs = skb_segment(skb, features); |
2176 | if (IS_ERR(segs)) | 2182 | if (IS_ERR(segs)) |
2177 | goto out; | 2183 | goto out; |
@@ -2208,6 +2214,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2208 | out: | 2214 | out: |
2209 | return segs; | 2215 | return segs; |
2210 | } | 2216 | } |
2217 | EXPORT_SYMBOL(tcp_tso_segment); | ||
2211 | 2218 | ||
2212 | extern void __skb_cb_too_small_for_tcp(int, int); | 2219 | extern void __skb_cb_too_small_for_tcp(int, int); |
2213 | extern struct tcp_congestion_ops tcp_reno; | 2220 | extern struct tcp_congestion_ops tcp_reno; |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index e02a84cf9a53..8355b729fa95 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -241,6 +241,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
241 | goto failure; | 241 | goto failure; |
242 | 242 | ||
243 | /* OK, now commit destination to socket. */ | 243 | /* OK, now commit destination to socket. */ |
244 | sk->sk_gso_type = SKB_GSO_TCPV4; | ||
244 | sk_setup_caps(sk, &rt->u.dst); | 245 | sk_setup_caps(sk, &rt->u.dst); |
245 | 246 | ||
246 | if (!tp->write_seq) | 247 | if (!tp->write_seq) |
@@ -883,6 +884,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
883 | if (!newsk) | 884 | if (!newsk) |
884 | goto exit; | 885 | goto exit; |
885 | 886 | ||
887 | newsk->sk_gso_type = SKB_GSO_TCPV4; | ||
886 | sk_setup_caps(newsk, dst); | 888 | sk_setup_caps(newsk, dst); |
887 | 889 | ||
888 | newtp = tcp_sk(newsk); | 890 | newtp = tcp_sk(newsk); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 5a7cb4a9c867..5c08ea20a18d 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -510,8 +510,7 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
510 | 510 | ||
511 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) | 511 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) |
512 | { | 512 | { |
513 | if (skb->len <= mss_now || | 513 | if (skb->len <= mss_now || !sk_can_gso(sk)) { |
514 | !(sk->sk_route_caps & NETIF_F_TSO)) { | ||
515 | /* Avoid the costly divide in the normal | 514 | /* Avoid the costly divide in the normal |
516 | * non-TSO case. | 515 | * non-TSO case. |
517 | */ | 516 | */ |
@@ -525,7 +524,7 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned | |||
525 | factor /= mss_now; | 524 | factor /= mss_now; |
526 | skb_shinfo(skb)->gso_segs = factor; | 525 | skb_shinfo(skb)->gso_segs = factor; |
527 | skb_shinfo(skb)->gso_size = mss_now; | 526 | skb_shinfo(skb)->gso_size = mss_now; |
528 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | 527 | skb_shinfo(skb)->gso_type = sk->sk_gso_type; |
529 | } | 528 | } |
530 | } | 529 | } |
531 | 530 | ||
@@ -824,9 +823,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed) | |||
824 | 823 | ||
825 | mss_now = tp->mss_cache; | 824 | mss_now = tp->mss_cache; |
826 | 825 | ||
827 | if (large_allowed && | 826 | if (large_allowed && sk_can_gso(sk) && !tp->urg_mode) |
828 | (sk->sk_route_caps & NETIF_F_TSO) && | ||
829 | !tp->urg_mode) | ||
830 | doing_tso = 1; | 827 | doing_tso = 1; |
831 | 828 | ||
832 | if (dst) { | 829 | if (dst) { |