From 0434b969dbdae6e78ad254621bec0b5ae8eddc40 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Wed, 18 Sep 2002 20:39:33 +0000 Subject: *** empty log message *** --- br-nf-bds/linux2.5/net/ipv4/ip_output.c | 22 ++++++++++++++++------ br-nf-bds/linux2.5/net/ipv4/netfilter/ip_tables.c | 11 +++++------ 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'br-nf-bds/linux2.5') diff --git a/br-nf-bds/linux2.5/net/ipv4/ip_output.c b/br-nf-bds/linux2.5/net/ipv4/ip_output.c index 0915f26..288bef6 100644 --- a/br-nf-bds/linux2.5/net/ipv4/ip_output.c +++ b/br-nf-bds/linux2.5/net/ipv4/ip_output.c @@ -5,7 +5,7 @@ * * The Internet Protocol (IP) output module. * - * Version: $Id: ip_output.c,v 1.3 2002/09/18 18:32:12 bdschuym Exp $ + * Version: $Id: ip_output.c,v 1.4 2002/09/18 20:39:33 bdschuym Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -306,10 +306,20 @@ static inline int ip_queue_xmit2(struct sk_buff *skb) iph = skb->nh.iph; } - if (skb->len > rt->u.dst.pmtu) - goto fragment; + if (skb->len > rt->u.dst.pmtu) { + unsigned int hlen; + if (!(sk->route_caps&NETIF_F_TSO)) + goto fragment; + + /* Hack zone: all this must be done by TCP. */ + hlen = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); + skb_shinfo(skb)->tso_size = rt->u.dst.pmtu - hlen; + skb_shinfo(skb)->tso_segs = + (skb->len - hlen + skb_shinfo(skb)->tso_size - 1)/ + skb_shinfo(skb)->tso_size - 1; + } - ip_select_ident(iph, &rt->u.dst, sk); + ip_select_ident_more(iph, &rt->u.dst, sk, skb_shinfo(skb)->tso_segs); /* Add an IP checksum. */ ip_send_check(iph); @@ -371,7 +381,7 @@ int ip_queue_xmit(struct sk_buff *skb) sk->bound_dev_if)) goto no_route; __sk_dst_set(sk, &rt->u.dst); - sk->route_caps = rt->u.dst.dev->features; + tcp_v4_setup_caps(sk, &rt->u.dst); } skb->dst = dst_clone(&rt->u.dst); @@ -577,7 +587,7 @@ static int ip_build_xmit_slow(struct sock *sk, * for packets without DF or having * been fragmented. */ - __ip_select_ident(iph, &rt->u.dst); + __ip_select_ident(iph, &rt->u.dst, 0); id = iph->id; } diff --git a/br-nf-bds/linux2.5/net/ipv4/netfilter/ip_tables.c b/br-nf-bds/linux2.5/net/ipv4/netfilter/ip_tables.c index 0b8d07c..f1c7016 100644 --- a/br-nf-bds/linux2.5/net/ipv4/netfilter/ip_tables.c +++ b/br-nf-bds/linux2.5/net/ipv4/netfilter/ip_tables.c @@ -68,13 +68,12 @@ static DECLARE_MUTEX(ipt_mutex); #define inline #endif -/* Locking is simple: we assume at worst case there will be one packet - in user context and one from bottom halves (or soft irq if Alexey's - softnet patch was applied). - +/* We keep a set of rules for each CPU, so we can avoid write-locking - them; doing a readlock_bh() stops packets coming through if we're - in user context. + them in the softirq when updating the counters and therefore + only need to read-lock in the softirq; doing a write_lock_bh() in user + context stops packets coming through and allows user context to read + the counters or update the rules. To be cache friendly on SMP, we arrange them like so: [ n-entries ] -- cgit v1.2.3