direct-io.hg

changeset 11113:d48842f924d0

Adjust truesize in netfront to more closely reflect real data payload
plus supervisor overheads but keeping out gross hypervisor overheads.
Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
author ack@localhost.localdomain
date Tue Aug 15 11:13:04 2006 +0100 (2006-08-15)
parents b53b154a5126
children 5de3bc3c6297
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Aug 15 10:06:13 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Aug 15 11:13:04 2006 +0100
     1.3 @@ -1199,7 +1199,28 @@ err:
     1.4  		}
     1.5  
     1.6  		i = xennet_fill_frags(np, skb, &tmpq);
     1.7 -		skb->truesize += skb->data_len;
     1.8 +
     1.9 +        /*
    1.10 +         * Truesize must approximates the size of true data plus
    1.11 +         * any supervisor overheads. Adding hypervisor overheads
    1.12 +         * has been shown to significantly reduce achievable
    1.13 +         * bandwidth with the default receive buffer size. It is
    1.14 +         * therefore not wise to account for it here.
    1.15 +         *
    1.16 +         * After alloc_skb(RX_COPY_THRESHOLD), truesize is set to
    1.17 +         * RX_COPY_THRESHOLD + the supervisor overheads. Here, we
    1.18 +         * add the size of the data pulled in xennet_fill_frags().
    1.19 +         *
    1.20 +         * We also adjust for any unused space in the main data
    1.21 +         * area by subtracting (RX_COPY_THRESHOLD - len). This is
    1.22 +         * especially important with drivers which split incoming
    1.23 +         * packets into header and data, using only 66 bytes of
    1.24 +         * the main data area (see the e1000 driver for example.)
    1.25 +         * On such systems, without this last adjustement, our
    1.26 +         * achievable receive throughout using the standard receive
    1.27 +         * buffer size was cut by 25%(!!!).
    1.28 +         */
    1.29 +		skb->truesize += skb->data_len - (RX_COPY_THRESHOLD - len);
    1.30  		skb->len += skb->data_len;
    1.31  
    1.32  		/*