[Top] [All Lists]

[IPV4/IPV6] Keep wmem accounting separate in ip*_push_pending_frames

To: Evgeniy Polyakov <johnpol@xxxxxxxxxxx>
Subject: [IPV4/IPV6] Keep wmem accounting separate in ip*_push_pending_frames
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 15 May 2005 20:40:16 +1000
Cc: netdev@xxxxxxxxxxx, davem@xxxxxxxxxxxxx
In-reply-to: <E1DXE3h-0002jR-00@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <20050514134834.GA2698@xxxxxxxxxxxxxxxxxxxxxxxx> <E1DXE3h-0002jR-00@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
On Sun, May 15, 2005 at 06:01:09PM +1000, Herbert Xu wrote:
> In fact you've uncovered a couple of bugs elsewhere too.  IPv4's
> ip_push_pending_frames attributes all the data to the first skb
> which breaks when the packet is sent through ip_fragment since
> the latter does not undo the truesize attribution.  skb_linearize
> is broken as well since it ignores truesize/owner altogether.

Here is a patch that addresses the first issue.

Since frag_list skb's constructed by ip*_push_pending_frames are
usually going to be fragmented in ip*_fragment and sent separately,
it makes no sense to account them all in the head skb.  Doing so
means that ip*_fragment would have to undo it all in order to keep
the correct wmem accounting.

In fact as it is IPv4 is attributing all the memory to the head skb
in ip_push_pending_frames and not undoing the attribution correctly
in ip_fragment.  On the fast path it will not undo the work at all
which means that as soon as the head skb is transmitted the quota
which may still be used by the other skb's can be used by new data.
On the slow path it double-charges the skb's which may unnecssarily
delay new data from being sent.

This patch simply leaves the wmem accounting with each skb.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Visit Openswan at
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page:
PGP Key:

Attachment: p
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>