[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87haa86n4l.wl%atzm@stratosphere.co.jp>
Date: Tue, 17 Dec 2013 14:51:38 +0900
From: Atzm Watanabe <atzm@...atosphere.co.jp>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org,
"Ben Hutchings" <bhutchings@...arflare.com>,
"David Miller" <davem@...emloft.net>,
"Daniel Borkmann" <dborkman@...hat.com>,
"David Laight" <David.Laight@...LAB.COM>
Subject: Re: [PATCH v3 3/3] packet: Deliver VLAN TPID to userspace
At Mon, 16 Dec 2013 09:25:09 -0800,
Stephen Hemminger wrote:
>
> On Mon, 16 Dec 2013 17:12:09 +0900
> Atzm Watanabe <atzm@...atosphere.co.jp> wrote:
>
> > struct tpacket_hdr_variant1 {
> > __u32 tp_rxhash;
> > __u32 tp_vlan_tci;
> > + __u32 tp_vlan_tpid;
> > };
>
> Is this safe? Won't you break ABI for existing userspace applications.
I think we can do it safely without breaking userspace.
struct tpacket_hdr_variant1 is an union member of struct tpacket3_hdr,
and it is not used for any others in the kernel-userspace ABI.
struct tpacket3_hdr is aligned to a multiple of 16 bytes, its size is
currently 48 bytes. Against that, the size before aligning is
currently 36 bytes, so there is a gap of 12 bytes that is unused.
Previous patch 2/3 adds padding members for filling the gap, after the
patch 1/3 which adds BUILD_BUG_ON() as sentinel for aligned size.
The patch 3/3 adds tp_vlan_tpid by picking area from the padding added
in the patch 2/3.
--
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