[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 07 Jul 2012 16:27:36 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: ming.lei@...onical.com
Cc: eric.dumazet@...il.com, netdev@...r.kernel.org,
gregkh@...uxfoundation.org, allan@...x.com.tw, trond@...omium.org,
grundler@...omium.org
Subject: Re: [PATCH net-next] asix: avoid copies in tx path
From: Ming Lei <ming.lei@...onical.com>
Date: Fri, 6 Jul 2012 09:16:32 +0800
> On Thu, Jul 5, 2012 at 10:31 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
>> From: Eric Dumazet <edumazet@...gle.com>
>>
>> I noticed excess calls to skb_copy_expand() or memmove() in asix driver.
>>
>> This driver needs to push 4 bytes in front of frame (packet_len)
>> and maybe add 4 bytes after the end (if padlen is 4)
>>
>> So it should set needed_headroom & needed_tailroom to avoid
>> copies. But its not enough, because many packets are cloned
>> before entering asix_tx_fixup() and this driver use skb_cloned()
>> as a lazy way to check if it can push and put additional bytes in frame.
>>
>> Avoid skb_copy_expand() expensive call, using following rules :
>>
>> - We are allowed to push 4 bytes in headroom if skb_header_cloned()
>> is false (and if we have 4 bytes of headroom)
>>
>> - We are allowed to put 4 bytes at tail if skb_cloned()
>> is false (and if we have 4 bytes of tailroom)
>>
>> TCP packets for example are cloned, but skb_header_release()
>> was called in tcp stack, allowing us to use headroom for our needs.
>>
>> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
...
> Tested-by: Ming Lei <ming.lei@...onical.com>
Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists