From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ani Sinha <ani@aristanetworks.com>
Cc: Paul Pearce <pearce@cs.berkeley.edu>,
netdev@vger.kernel.org, dborkman <dborkman@redhat.com>,
edumazet <edumazet@google.com>, Jiri Pirko <jpirko@redhat.com>
Subject: Re: [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value
Date: Tue, 08 Jan 2013 22:27:30 -0800 [thread overview]
Message-ID: <1357712850.27446.28.camel@edumazet-glaptop> (raw)
In-Reply-To: <CAOxq_8MXCvGpq4Q0UfxSbWMDNTusrK710fQ11qgfXKWS+zpoZQ@mail.gmail.com>
On Tue, 2013-01-08 at 22:06 -0800, Ani Sinha wrote:
> The proposed patch tries to fix the issue that arose after the
> following commit :
>
> commit b40863c667c16b7a73d4f034a8eab67029b5b15a
> Author: Eric Dumazet <edumazet@google.com>
> Date: Tue Sep 18 20:44:49 2012 +0000
>
> net: more accurate network taps in transmit path
>
>
> I do not believe 3.6.11 kernel has this change. 3.6.11 should not need
> the patch.
Thats irrelevant. This only shows that user land was depending on a
prior undocumented behavior.
It seems a libpcap issue to me. Kernel side provides all needed bits.
When I want "tcpdump src port 2030", filter is :
(000) ldh [12]
(001) jeq #0x86dd jt 2 jf 8
(002) ldb [20]
(003) jeq #0x84 jt 6 jf 4
(004) jeq #0x6 jt 6 jf 5
(005) jeq #0x11 jt 6 jf 19
(006) ldh [54]
(007) jeq #0x7ee jt 18 jf 19
(008) jeq #0x800 jt 9 jf 19
(009) ldb [23]
(010) jeq #0x84 jt 13 jf 11
(011) jeq #0x6 jt 13 jf 12
(012) jeq #0x11 jt 13 jf 19
(013) ldh [20]
(014) jset #0x1fff jt 19 jf 15
(015) ldxb 4*([14]&0xf)
(016) ldh [x + 14]
(017) jeq #0x7ee jt 18 jf 19
(018) ret #96
(019) ret #0
See how it handles both IPv4 and IPv6, and various protocols
automatically ?
If I only wanted "udp and src port 2030" it would give :
(000) ldh [12]
(001) jeq #0x86dd jt 2 jf 6
(002) ldb [20]
(003) jeq #0x11 jt 4 jf 15
(004) ldh [54]
(005) jeq #0x7ee jt 14 jf 15
(006) jeq #0x800 jt 7 jf 15
(007) ldb [23]
(008) jeq #0x11 jt 9 jf 15
(009) ldh [20]
(010) jset #0x1fff jt 15 jf 11
(011) ldxb 4*([14]&0xf)
(012) ldh [x + 14]
(013) jeq #0x7ee jt 14 jf 15
(014) ret #96
(015) ret #0
So when I want "tcpdump vlan 100" it generates :
(000) ldh [12]
(001) jeq #0x8100 jt 2 jf 6
(002) ldh [14]
(003) and #0xfff
(004) jeq #0x64 jt 5 jf 6
(005) ret #96
(006) ret #0
What's wrong instructing libpcap to extend the filter to be able to
get the correct result, vlan id being in skb->vlan_id (vlan accel on),
or in the packet itself (vlan accel off)
This way, you could chose if you want to get only accelerated vlan,
or non accelerated vlan, or both. And you need no kernel hacking.
next prev parent reply other threads:[~2013-01-09 6:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 5:15 [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value Paul Pearce
2013-01-09 6:06 ` Ani Sinha
2013-01-09 6:27 ` Eric Dumazet [this message]
2013-01-09 6:34 ` Ani Sinha
2013-01-09 19:27 ` Ani Sinha
2013-01-09 19:51 ` Eric Dumazet
2013-01-09 20:01 ` Ani Sinha
2013-01-09 20:06 ` Ani Sinha
2013-01-11 1:47 ` [tcpdump-workers] " Michael Richardson
2013-01-11 2:37 ` Paul Pearce
2013-01-11 8:46 ` Daniel Borkmann
2013-02-15 8:17 ` Eric W. Biederman
-- strict thread matches above, loose matches on Subject: below --
2013-01-08 18:51 [PATCH net 0/2] net: dev_queue_xmit_nit fixes Daniel Borkmann
2013-01-08 18:51 ` [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value Daniel Borkmann
2013-01-08 19:54 ` Ani Sinha
2013-01-08 20:04 ` Eric Dumazet
2013-01-08 20:22 ` Jiri Pirko
2013-01-08 20:42 ` Eric Dumazet
2013-01-08 20:14 ` Jiri Pirko
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=1357712850.27446.28.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=ani@aristanetworks.com \
--cc=dborkman@redhat.com \
--cc=edumazet@google.com \
--cc=jpirko@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pearce@cs.berkeley.edu \
/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