From: John Fastabend <john.r.fastabend@intel.com>
To: Jesse Gross <jesse@nicira.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC][net-next-2.6 PATCH 3/4] ethtool: set hard_header_len using ETH_FLAG_{TX|RX}VLAN
Date: Tue, 26 Oct 2010 14:58:28 -0700 [thread overview]
Message-ID: <4CC74F04.6080007@intel.com> (raw)
In-Reply-To: <AANLkTikJpsFC=ZsTWtxwSp-aQRDoZ9fy1p-ZxR+v8jVm@mail.gmail.com>
On 10/25/2010 3:45 PM, Jesse Gross wrote:
> On Fri, Oct 22, 2010 at 6:00 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
>> On Thu, 2010-10-21 at 15:10 -0700, John Fastabend wrote:
>>> Toggling the vlan tx|rx hw offloads needs to set the hard_header_len
>>> as well otherwise we end up using LL_RESERVED_SPACE incorrectly.
>>> This results in pskb_expand_head() being used unnecessarily.
>>>
>>> This add a check in ethtool_op_set_flags to catch the ETH_FLAG_TXVLAN
>>> flag and set the header length.
>> [...]
>>
>> Note that not every driver that implements the set_flags operation calls
>> back to ethtool_op_set_flags().
>
> Currently all of the drivers that support toggling this using ethtool
> call into ethtool_op_set_flags. Even if they don't, things will
> continue to work correctly, albeit with a performance hit, so it's not
> a catastrophe.
>
> This does assume that drivers which support offloading will start with
> it enabled. If they don't and just use the non-vlan header length
> then this will drop the header length down even further when
> offloading is enabled. All current drivers that support toggling do
> start with offloading enabled, so maybe it's not that big a deal.
>
> Another issue is that cards that don't support vlan offloading at all
> probably won't take the header into account, so they'll get hit every
> time.
>
The lower layer driver should not include the vlan tag in
hard_header_len because pkts pushed to the real net device will not add
the vlan tag. The vlan device however should increment/dec the len value
depending on if the underlying net device is offloading the vlan tagging.
> When we are using vlan devices we also manually add the vlan header
> length but it doesn't update if we change the underlying device. It
> seems a little redundant to have to do it in both places.
Right, I think doing this in vlan_transfer_features() should work.
>
> I like that this is generic and independent of vlan devices.
> Hopefully we can figure out these corner cases (or maybe decide that
> they're not important or this is strictly an improvement).
I'll post an update. Thanks for the comments.
-- John
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-10-26 21:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-21 22:10 [RFC][net-next-2.6 PATCH 1/4] net: consolidate 8021q tagging John Fastabend
2010-10-21 22:10 ` [RFC][net-next-2.6 PATCH 2/4] net: 8021Q consolidate header_ops routines John Fastabend
2010-10-25 22:44 ` Jesse Gross
2010-11-04 0:47 ` Jesse Gross
2010-11-04 13:43 ` John Fastabend
2010-11-04 18:26 ` Jesse Gross
2010-10-21 22:10 ` [RFC][net-next-2.6 PATCH 3/4] ethtool: set hard_header_len using ETH_FLAG_{TX|RX}VLAN John Fastabend
2010-10-22 13:00 ` Ben Hutchings
2010-10-25 22:45 ` Jesse Gross
2010-10-26 21:58 ` John Fastabend [this message]
2010-10-21 22:10 ` [RFC][net-next-2.6 PATCH 4/4] net: remove check for headroom in vlan_dev_create John Fastabend
2010-10-25 22:45 ` Jesse Gross
2010-10-26 22:05 ` John Fastabend
2010-10-27 2:07 ` Jesse Gross
2010-10-25 22:44 ` [RFC][net-next-2.6 PATCH 1/4] net: consolidate 8021q tagging Jesse Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CC74F04.6080007@intel.com \
--to=john.r.fastabend@intel.com \
--cc=bhutchings@solarflare.com \
--cc=jesse@nicira.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).