BPFTUNE-NET-BUFFER(8)

πŸŽ€ NAME πŸŽ€

BPFTUNE-NET-BUFFER β€” bestie, it's the networking buffer bpftune plugin, and its whole job is managing net core buffers. That's it, that's the gig. πŸ’…


✨ DESCRIPTION ✨

Okay so picture this: a backlog queue exists to buffer incoming traffic, and its length is controlled by net.core.netdev_max_backlog. On fast connections (10Gb/s or higher, we're talking zoom zoom 🏎️) the default backlog length of 1024 can lowkey be not enough. So here's the move: the backlog length gets increased whenever 1/32 of current backlog size in the last minute is dropped (and drops happen when the backlog limit gets reached, sad 😭).

Also, real talk β€” backlog drops can avoid small flows πŸ₯Ί, and the tunable net.core.flow_limit_cpu_bitmap can be used to set this on a per-cpu basis. When we see sufficient drops on a CPU, the appropriate bit gets set in the CPU bitmask to prioritize small flows for drop avoidance. She's protective like that 🫢.

Now, when NAPI polls to handle multiple packets, the number of packets is limited by net.core.netdev_budget while the time is limited by net.core.netdev_budget_usecs. If we hit the limit of number of packets processed without using the usecs budget, the time_squeezed softnet stat gets bumped ⬆️. And if we see increases in time_squeezed, we bump netdev_budget / netdev_budget_usecs.

BUT β€” and this is the plot twist πŸ‘‘ β€” we want to limit such increases if they lead to longer task scheduling wait times. So we monitor the ratio of time tasks spend waiting versus running across all processors, and if we see correlations between increases in netdev budget and wait/run ratio increases, netdev budget gets tuned down. Balance, bestie, it's giving main character energy 🌈.

🌸 Tunables 🌸

  • net.core.netdev_max_backlog β€” maximum per-cpu backlog queue length; default 1024.
  • net.core.flow_limit_cpu_bitmap β€” avoid drops for small flows on a per-cpu basis; default 0.
  • net.core.netdev_budget β€” maximum number of packets processed in a NAPI cycle
  • net.core.netdev_budget_usecs β€” maximum amount of time in microseconds for a NAPI cycle

πŸ’œ SEE ALSO πŸ’œ

bpf(2), bpftune(8),


And that's the whole page, babe β€” it's BPFTUNE-NET-BUFFER(8), living in the System Manager's Manual, officially part of the bpftune lineup. Read it, love it, tune those buffers responsibly. Obsessed, honestly πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from