Netdev List
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: alexandre.ferrieux@orange.com,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 Chengen Du <chengen.du@canonical.com>
Cc: davem@davemloft.net,  edumazet@google.com,  kuba@kernel.org,
	 pabeni@redhat.com,  netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] af_packet: Handle outgoing VLAN packets without hardware offloading
Date: Sun, 26 May 2024 11:25:43 -0400	[thread overview]
Message-ID: <6653547768757_23ef3529455@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <3acef339-cdeb-407c-b643-0481bfbe3c80@orange.com>

alexandre.ferrieux@ wrote:
> On 25/05/2024 17:51, Willem de Bruijn wrote:
> > 
> > First, we need to even understand better why anything is using
> > SOCK_DGRAM when access to L2.5 headers is important, and whether the
> > process can convert to using SOCK_RAW instead.
> 
> For libpcap, it seems to be linked to the fact that the "any" device can 
> aggregate links with varied L2 header sizes, which in turn complicates filtering 
> (see Guy Harris' comment on this [1]).
> 
> Given that 99% of useful traffic is Ethernet, such considerations look awkward 
> now. I for one would love to see an "any2" based on SOCK_RAW. And while you're 
> at it, please let the new variant of SLL contain the full Ethernet header at the 
> end, so that a simple offset gives access to the whole linear wire image...

Complicating factors are loopback and tunnel devices, which are
common. Loopback (ARPHRD_LOOPBACK) is pseudo Ethernet. Libpcap does
convert this to DLT_EN10MB. But it converts ARPHRD_TUNNEL to DLT_RAW,
as can be expected.

I don't think a new DLT_LINUX_SLL3 is a solution. The application
just wants to receive the full L2.5 header, not yet another parsed
version.

Libpcap can conceivably already read with SOCK_RAW and still convert
each frame to SLL internally.

Separate from this, I'd like to see where exactly these L2.5 tags are
inserted and whether any besides VLAN (incl. QinQ special case) are
even susceptible.

For VLAN on the normal egress path, like the ICMP reproducer, this
probably is in vlan_insert_tag_set_proto. Not 100% sure. That indeed
inserts the header and updates skb->protocol, without changing the
network header.

MPLS in mpls_forward does appear to update network_header, and uses
this in mpls_hdr. So perhaps the issue does not extend beyond VLAN.

  reply	other threads:[~2024-05-26 15:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20  7:03 [PATCH] af_packet: Handle outgoing VLAN packets without hardware offloading Chengen Du
2024-05-20 18:35 ` Willem de Bruijn
2024-05-21  3:31   ` Chengen Du
2024-05-21  8:35     ` Paolo Abeni
2024-05-21 13:28       ` Willem de Bruijn
2024-05-22 14:27         ` Chengen Du
2024-05-22 18:39           ` Willem de Bruijn
2024-05-22 19:54             ` alexandre.ferrieux
2024-05-23 14:17               ` Chengen Du
2024-05-23 14:52                 ` Willem de Bruijn
2024-05-23 14:56 ` Willem de Bruijn
2024-05-24 14:04   ` Chengen Du
2024-05-25 15:51     ` Willem de Bruijn
2024-05-25 20:55       ` alexandre.ferrieux
2024-05-26 15:25         ` Willem de Bruijn [this message]
2024-05-27  0:18           ` alexandre.ferrieux

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=6653547768757_23ef3529455@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=alexandre.ferrieux@orange.com \
    --cc=chengen.du@canonical.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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