Subject: Re: [PATCH 1/2][RFC] vlan: use pskb_copy() when inserting a vlan tag by hand

From: Ben Hutchings <[email-masked]>
Date: Tue, 8 Jul 2008 23:10:17 +0100

Patrick McHardy wrote:
[...]
> Without checking if its actually needed, I would tend to agree because
> a caller can't rely on getting a linearized skb back except when its
> guaranteed to be cloned, in the case it could simply copy it always.
> 
> Anyway, the copy in __vlan_put_tag() is overkill since the header
> is usually writable. See the patch I sent in my second mail, it
> should reduce the overhead significantly.
> 
> Actually there was a small bug in the one I sent, so attached again
> to this mail.

This looks great.  Since our controller doesn't do VLAN tag insertion, I
ran some quick tests and it improved TCP throughput over VLAN devices
without TSO by about 50%.  (With TSO on, the change wasn't so great - I
think this was because the receive side couldn't do LRO on tagged
packets.)

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.