From: Atzm Watanabe <atzm@stratosphere.co.jp>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Ben Hutchings <bhutchings@solarflare.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH] packet: Deliver VLAN TPID to userspace
Date: Wed, 23 Oct 2013 15:51:21 +0900 [thread overview]
Message-ID: <87hac8jx92.wl%atzm@stratosphere.co.jp> (raw)
In-Reply-To: <20131022154110.518282ba@nehalam.linuxnetplumber.net>
At Tue, 22 Oct 2013 15:41:10 -0700,
Stephen Hemminger wrote:
>
> On Tue, 22 Oct 2013 11:56:31 +0900
> Atzm Watanabe <atzm@stratosphere.co.jp> wrote:
>
> > Hmm... I think TPACKET{,2,3}_HDRLEN should not be removed without
> > careful considerations. Because some userspace programs (e.g libpcap)
> > are using them in order to check mmap ability of the kernel...
>
>
> That's bad because it means the library then depends on the headers
> of the machine it was built on, not the machine it is running on. I often
> build software on boxes where /usr/include version of kernel headers is out dated.
Yes, this means that building such library with the new header
(TPACKET{,2,3}_HDRLEN were deleted) will make the binary that does
not support PACKET_MMAP. :-(
So, IMHO, we should be prudent in deleting TPACKET{,2,3}_HDRLEN,
otherwise we will break such userspace programs very easily...
e.g. snippet of the latest libpcap-1.4.0 (pcap-linux.c):
/* check for memory mapped access avaibility. We assume every needed
* struct is defined if the macro TPACKET_HDRLEN is defined, because it
* uses many ring related structs and macros */
# ifdef TPACKET_HDRLEN
# define HAVE_PACKET_RING
# ifdef TPACKET2_HDRLEN
# define HAVE_TPACKET2
# else
# define TPACKET_V1 0
# endif /* TPACKET2_HDRLEN */
# endif /* TPACKET_HDRLEN */
It looks like PACKET_MMAP is used when HAVE_PACKET_RING is defined.
prev parent reply other threads:[~2013-10-23 6:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-18 17:08 [PATCH] packet: Deliver VLAN TPID to userspace Atzm Watanabe
2013-10-18 17:56 ` Stephen Hemminger
2013-10-19 6:19 ` Atzm Watanabe
2013-10-21 9:24 ` Ben Hutchings
2013-10-22 2:56 ` Atzm Watanabe
2013-10-22 22:41 ` Stephen Hemminger
2013-10-23 6:51 ` Atzm Watanabe [this message]
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=87hac8jx92.wl%atzm@stratosphere.co.jp \
--to=atzm@stratosphere.co.jp \
--cc=bhutchings@solarflare.com \
--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