Thread (2 messages) 2 messages, 2 authors, 2021-05-28

Re: [PATCH bpf-next] xsk: support AF_PACKET

From: Toke Høiland-Jørgensen <hidden>
Date: 2021-05-28 09:26:05
Also in: bpf

Xuan Zhuo [off-list ref] writes:
On Fri, 28 May 2021 10:55:58 +0200, Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
Xuan Zhuo [off-list ref] writes:
quoted
In xsk mode, users cannot use AF_PACKET(tcpdump) to observe the current
rx/tx data packets. This feature is very important in many cases. So
this patch allows AF_PACKET to obtain xsk packages.
You can use xdpdump to dump the packets from the XDP program before it
gets redirected into the XSK:
https://github.com/xdp-project/xdp-tools/tree/master/xdp-dump
Wow, this is a good idea.
quoted
Doens't currently work on egress, but if/when we get a proper TX hook
that should be doable as well.

Wiring up XSK to AF_PACKET sounds a bit nonsensical: XSK is already a
transport to userspace, why would you need a second one?
I have some different ideas. In my opinion, just like AF_PACKET can monitor
tcp/udp packets, AF_PACKET monitors xsk packets is the same.
But you're adding code in the fast path to do this, in a code path where
others have been working quite hard to squeeze out every drop of
performance (literally chasing single nanoseconds). So I'm sorry, but
this approach is just not going to fly.

What is your use case anyway? Yes, being able to run tcpdump and see the
packets is nice and convenient, but what do you actually want to use
this for? Just for debugging your application? System monitoring?
Something else?

-Toke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help