]> git.hungrycats.org Git - linux/commit
[IPV4/IPV6]: More fragment handling improvements.
authorHideaki Yoshifuji <yoshfuji@linux-ipv6.org>
Wed, 8 Sep 2004 06:23:00 +0000 (23:23 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Wed, 8 Sep 2004 06:23:00 +0000 (23:23 -0700)
commitfb4a020e6ef676c284e8b30d898d2c6b96453712
treee98a915b1f3f0f0e13040124935cd83b2384d1b1
parent8749b1cd0e077a74abb6e1ae1c838e75a40b7d0a
[IPV4/IPV6]: More fragment handling improvements.

Here's the optimization: if we know the remaining data exceeds the
mtu, we do not need to fill up full of it.

skb_prev:
                mtu
+----------+--+-+
|          |  | |
+----------+--+-+
           ^  ^
skb_prev->len |
              maxfraglen

appending data:
           +--------+
           |        |
           +--------+
           --------->
                  length

In this case, we know we need more fragment(s).
So, let's fill up to maxfraglen (instead of mtu)
to avoid needless copy in the next loop.

Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c
net/ipv6/ip6_output.c