ping_setup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– ping_setup(9) β€” a little kernel API manual moment, but make it group chat 🫢

okay so bestie, welcome to the Kernel API Manual page for ping_setup, and no cap this one is short but it is doing the most conceptually. Sit down, grab a strawberry πŸ“, let's go.


✨ NAME ✨

ping_setup β€” create two veth peers and forward packets in-between using XDP. that's it, that's the whole vibe. two little virtual ethernet besties, and XDP literally passing notes between them πŸ”₯


✨ SYNOPSIS ✨

int ping_setup (struct test_data *data );

yep, it returns an int, takes a struct test_data * named data, and that's the entire signature. iconic minimalism honestly πŸ’…


✨ ARGUMENTS ✨

  • data β€” so this is the funny part. the original page literally wrote -- undescribed --. like, the manpage author said "bestie i'm not explaining that one" and clocked out 😭 so fr fr, the only thing documented here is that data is a struct test_data * and the manual gives it no description at all. not me respecting the archaeology of it. if you need to know what goes in there, that's a you-and-the-source-code situation πŸ™ˆ

✨ DESCRIPTION ✨

okay so here's the mental image: you've got these network namespaces, right β€” NS1 and NS2 β€” and inside each of them lives a veth0 interface. NS1's is chilling at 10.1.1.1, NS2's is chilling at 10.1.1.2. then down in NS0 there's veth1 with id 111 and veth2 with id 222, and the whole thing is wired up with xdp forwarding running through the middle πŸ‘‘

here's the original diagram, verbatim, because it's a masterpiece and i refuse to redraw it:

       ------------           ------------ |    NS1   |           |    NS2   |
       |   veth0  |           |   veth0  | | 10.1.1.1 |           | 10.1.1.2 |
       -----|------           ------|----- |                       | |
       | -----|-----------------------|------- |  veth1                   veth2
       | | (id:111)                (id:222)  | |    |                        |
       | |    ----- xdp forwarding -----     | |
       | |               NS0                 |
       -------------------------------------

like, look at it. veth0 on both sides, 10.1.1.1 and 10.1.1.2, veth1 at (id:111), veth2 at (id:222), xdp forwarding bridging the gap, and NS0 holding it all down at the bottom. the way that diagram is literally the whole description β€” she said "a picture is worth a thousand words" and meant it πŸ’€


✨ SEE ALSO ✨

  • Kernel file ./tools/testing/selftests/bpf/prog_tests/xdp_do_redirect.c β€” the actual real-world lore lives here, go read it, that's where the tea is πŸ¦‹
ngl this page is short enough to read in one breath, but the selftest file above is the main character energy you actually want ✨

and that's the page!! 🌈 this little gem came to you from ./tools/testing/selftests/bpf/... and it's dated October 2026 β€” so mark your calendar, screenshot the group chat, and remember: two veth peers, one XDP forward, zero further explanation. periodt πŸ’œπŸŽ€

πŸ“¦ where this page comes from