netdev
[Top] [All Lists]

Re: [2/2] [NET] Add skb_header_cloned and use it in e1000/tg3

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [2/2] [NET] Add skb_header_cloned and use it in e1000/tg3
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Wed, 23 Feb 2005 19:51:37 -0800
Cc: kuznet@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20050215202453.GA4355@xxxxxxxxxxxxxxxxxxx>
References: <20050122170533.GB11499@xxxxxxxxxxxxxxx> <20050123071027.GA20296@xxxxxxxxxxxxxxxxxxx> <20050126110043.GA29950@xxxxxxxxxxxxxxx> <20050126222522.GA21670@xxxxxxxxxxxxxxxxxxx> <20050127110946.GA20494@xxxxxxxxxxxxxxxxxxx> <20050127111201.GB20494@xxxxxxxxxxxxxxxxxxx> <20050128202542.GA23670@xxxxxxxxxxxxxxx> <20050129031740.GA6130@xxxxxxxxxxxxxxxxxxx> <20050129032210.GA7424@xxxxxxxxxxxxxxxxxxx> <20050215103312.6178385f.davem@xxxxxxxxxxxxx> <20050215202453.GA4355@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 16 Feb 2005 07:24:53 +1100
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:

> On Tue, Feb 15, 2005 at 10:33:12AM -0800, David S. Miller wrote:
> > 
> > The tg3 version creates an SKB leak.  If pskb_expand_head() fails, we just
> > unlock and return NETDEV_TX_OK.  The upper layer assumes the driver took
> > ownership of the SKB in such a case.  I would recommend just kfree_skb()'ing
> > the thing when this happens.
> 
> Indeed.  Here is the corrected version.
> 
> This patch adds skb_header_cloned which tells us whether we need to
> copy the data before we can modify the header part of the skb.  Again,
> what constitutes the header is left up to the users of the skb to define.
> 
> This patch then uses this function in e1000/tg3 to copy the data before
> the TCP/IP header is modified.
> 
> Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Also queued to 2.6.12, thanks.  Someone should cook up the versions
for other drivers supporting TSO.

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