From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Ben Greear <greearb@candelatech.com>
Cc: Dave Johnson <djohnson+linux-kernel@sw.starentnetworks.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Bin Guo <bguo@sw.starentnetworks.com>
Subject: Re: expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device?
Date: Wed, 31 Oct 2007 18:23:37 -0700 [thread overview]
Message-ID: <47292A99.5070805@linux-foundation.org> (raw)
In-Reply-To: <4729269A.6090606@candelatech.com>
Ben Greear wrote:
> Stephen Hemminger wrote:
>> On Wed, 31 Oct 2007 14:43:51 -0400
>> Dave Johnson <djohnson+linux-kernel@sw.starentnetworks.com> wrote:
>>
>>
>>> Depending on the network driver, I'm seeing different behavior if
>>> a .1q packet is received to an PF_PACKET, SOCK_RAW, ETH_P_ALL socket.
>>>
>>>
>>> On devices what do not use NETIF_F_HW_VLAN_RX, the packet socket gets
>>> the complete packet with vlan tag included as the driver simply calls
>>> netif_receive_skb() or equivilant. packet_rcv() then gets the whole
>>> thing vlan tag included and sends this through the socket.
>>>
>>> vlan_skb_recv() also gets these all and will drop them because there
>>> are no vlans configured.
>>>
>>>
>>
>> The VLAN acceleration grabs and hides the tag. It is a design flaw
>> that should be fixed, feel free to post a patch.
>>
> There may be several ways to 'fix' this. Perhaps it would be worth
> discussing what
> we want the end result to be at least?
>
> Should we always pass the vlan header up to raw sockets as part of the
> data payload?
>
> Or, maybe pass it in an auxiliary message such as how timestamps may
> be passed?
>
> The first option seems cleaner, but maybe there are performance
> problems with this
> approach?
>
> We should also define what a NIC should do with VLANs it doesn't
> explicitly know
> about. I think it should pass them up the stack with VLAN tag
> intact, but again, perhaps
> there are reasons not to do that?
>
> DaveM did the HW Accel for VLANs if I remember correctly...perhaps he
> has some input?
The code in AF_PACKET should fix the skb before passing to user space so
that there is
no difference between accel and non-accel hardware. Internal choices
shouldn't
leak to user space. Ditto, the receive checksum offload should be fixed
up as well.
next prev parent reply other threads:[~2007-11-01 1:23 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 18:43 expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device? Dave Johnson
2007-10-31 19:33 ` Stephen Hemminger
2007-11-01 1:06 ` Ben Greear
2007-11-01 1:10 ` David Miller
2007-11-01 1:23 ` Stephen Hemminger [this message]
2007-11-01 1:31 ` Ben Greear
2007-11-01 4:50 ` David Miller
2007-11-01 15:04 ` Ben Greear
2007-11-01 21:35 ` David Miller
2007-11-01 21:36 ` Dave Johnson
2007-11-01 21:48 ` Rick Jones
2007-11-01 21:59 ` David Miller
2007-11-01 22:04 ` Rick Jones
2007-11-01 22:07 ` David Miller
2007-11-01 23:26 ` Rick Jones
2007-11-05 17:46 ` [PATCH 1/2] NET: Re-add VLAN tag for devices incapable of keeping it Dave Johnson
2007-11-05 18:00 ` Patrick McHardy
2007-11-05 23:15 ` David Miller
2007-11-06 0:21 ` Patrick McHardy
2007-11-06 0:35 ` David Miller
2007-11-06 18:03 ` Krzysztof Halasa
2007-11-06 18:56 ` Ben Greear
2007-11-06 20:08 ` Krzysztof Halasa
2007-11-06 23:55 ` Patrick McHardy
2007-11-05 17:47 ` [PATCH 2/2] " Dave Johnson
2007-11-06 2:39 ` Ramkrishna Vepa
2007-11-06 18:28 ` Ramkrishna Vepa
2007-11-06 18:34 ` Dave Johnson
2007-11-01 21:58 ` expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device? David Miller
2007-11-02 18:08 ` Dave Johnson
2007-11-02 21:20 ` David Miller
2007-11-02 21:52 ` Michael Chan
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=47292A99.5070805@linux-foundation.org \
--to=shemminger@linux-foundation.org \
--cc=bguo@sw.starentnetworks.com \
--cc=djohnson+linux-kernel@sw.starentnetworks.com \
--cc=greearb@candelatech.com \
--cc=linux-kernel@vger.kernel.org \
--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).