From: Daniel Borkmann <dborkman@redhat.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Atzm Watanabe <atzm@stratosphere.co.jp>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, stephen@networkplumber.org
Subject: Re: [PATCH RESEND] packet: Deliver VLAN TPID to userspace
Date: Mon, 04 Nov 2013 19:33:52 +0100 [thread overview]
Message-ID: <5277E890.20308@redhat.com> (raw)
In-Reply-To: <1383585391.1553.7.camel@bwh-desktop.uk.level5networks.com>
On 11/04/2013 06:16 PM, Ben Hutchings wrote:
> On Wed, 2013-10-30 at 16:03 +0900, Atzm Watanabe wrote:
> [...]
>> Should it be structures as below?
>>
>> struct tpacket_hdr_variant1 {
>> __u32 tp_rxhash;
>> __u32 tp_vlan_tci;
>> };
>>
>> struct tpacket_hdr_variant2 {
>> __u32 tp_rxhash;
>> __u32 tp_vlan_tci;
>> __u32 tp_vlan_tpid;
>> };
>>
>> struct tpacket3_hdr {
>> __u32 tp_next_offset;
>> __u32 tp_sec;
>> __u32 tp_nsec;
>> __u32 tp_snaplen;
>> __u32 tp_len;
>> __u32 tp_status;
>> __u16 tp_mac;
>> __u16 tp_net;
>> /* pkt_hdr variants */
>> union {
>> struct tpacket_hdr_variant1 hv1;
>> struct tpacket_hdr_variant2 hv2;
>> };
>> };
>>
>> If it's ok, I'd like to send the patch v2.
> [...]
>
> I think this makes sense.
>
> Also add a BUILD_BUG_ON(TPACKET3_HDRLEN != 48) somewhere.
Sorry for coming late into this discussion.
I think the packet_mmap API with its 3 different API versions
already is a "bit" terrible, and should only be further extended
for user space if there is a _*huge*_ (!) improvement somewhere
(e.g. in terms of packet capturing/transmission performance) that
would justify it. I'm thinking that this could e.g. be in terms
of packet capturing and transmission performance.
Otherwise, each time we want to add a new member, we add yet
another subheader for userspace into tpacket, making it even
more complicated to use, and adding more "legacy" API fragments?
To solve your problem, why don't you add a socket option that,
if _enabled_, would reconstruct the vlan header as it was seen
on the "wire" and push that up to userspace, just like libpcap
does internally. It's not perfect either, but perhaps a better
way to go. What do you think?
next prev parent reply other threads:[~2013-11-04 18:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 8:39 [PATCH RESEND] packet: Deliver VLAN TPID to userspace Atzm Watanabe
2013-10-25 22:59 ` David Miller
2013-10-28 20:11 ` Ben Hutchings
2013-10-30 7:03 ` Atzm Watanabe
2013-11-04 17:16 ` Ben Hutchings
2013-11-04 18:33 ` Daniel Borkmann [this message]
2013-11-07 17:22 ` Atzm Watanabe
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=5277E890.20308@redhat.com \
--to=dborkman@redhat.com \
--cc=atzm@stratosphere.co.jp \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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).