News for hackers. Stuff that matters.
Re:BPF at Facebook and beyond by bdd on Thursday October 10, 2019 @06:08PM (#21219673)
Excuse me while I shill for my employer but we're indeed big fans of BPF at Facebook.

Our L4 load balancer is implemented entirely in BPF byte code emitting C++ and relies on XDP for "blazing fast" (comms approved totally scientific replacement for gbps and pps figures...) packet forwarding. It's open source and was discussed here at HN before https://news.ycombinator.com/item?id=17199921.

We discussed how we use eBPF for traffic shaping in our internal networks at Linux Plumber's Conference http://vger.kernel.org/lpc-bpf2018.html#session-9

We presented how we enforce network traffic encryption, catch and terminate cleartext communication, again, you guessed, with BPF at Networking@Scale https://atscaleconference.com/events/networking-scale-3/ (video coming soon, I think.)

Firewalls with BPF? Sure we have 'em. http://vger.kernel.org/lpc_net2018_talks/ebpf-firewall-LPC.p...

In addition to all these nice applications we heavily rely on fleet wide tooling constructed with eBPF to monitor:

  - performance (why is it slow? why does it allocate this much?)
  - correctness (collect evidence it's doing its job like counters and logs. this should never happen, catch if it does!)
...in our systems.
Re:BPF at Facebook and beyond by davemarchevsky on Thursday October 10, 2019 @07:26PM (#21220241)
> - performance (why is it slow? why does it allocate this much?)

One of the pieces of fleet-wide tooling that heavily uses eBPF is PyPerf, which we talked about publicly at Systems@Scale in September ("Service Efficiency at Instagram Scale" - https://atscaleconference.com/events/systems-scale-2/ - video also coming soon, I think).

Re:BPF at Facebook and beyond by stephen999 on Thursday October 10, 2019 @07:32PM (#21220270)
Is there any public code for these perf tools?
Re:BPF at Facebook and beyond by bdd on Thursday October 10, 2019 @07:46PM (#21220330)
Re:BPF at Facebook and beyond by lathiat on Thursday October 10, 2019 @09:37PM (#21220818)
woah I hadn't seen that.. sounds like PySpy but implemented in BPF. That's crazy and cool: https://github.com/benfred/py-spy
Re:BPF at Facebook and beyond by aloknnikhil on Thursday October 10, 2019 @11:52PM (#21221424)
Has there been any comparison on if XDP-eBPF packet processing is faster/slower than pure user-space packet processors like Cisco's VPP, especially the ones with support for DPDK and zero-copy? I ask because user space packet processors are extensively used as virtual switches in container deployments. Assuming XDP-eBPF is faster, I wonder if, in combination with namespaces, there could be an efficient "virtual switch" implemented completely in eBPF.
Re:BPF at Facebook and beyond by bdd on Friday October 11, 2019 @12:03AM (#21221470)
Personal experience spanning across my time at Twitter and Facebook, DPDK is definitely faster but it is (/was) a pain in the butt to program and share the NIC with the host. XDP allows you to reuse very many packet parsing / handling capabilities in the kernel while in DPDK world you’re shipping a tiny stack with your app.

Re: Virtual Switch implemented in BPF: see Cilium’s work to connect containers with their BPF based connectors.

Re:BPF at Facebook and beyond by shaklee3 on Friday October 11, 2019 @01:19AM (#21221753)
That depends on the nic. Mellanox's bifurcated driver is very easy to share with the kernel. Intel's, not so much. Do you mind mentioning which NICs are used at FB?

Also for GP, is anyone using vpp in production?

Re:BPF at Facebook and beyond by fdee on Friday October 11, 2019 @07:56AM (#21223447)
There is not even need for a bifurcated driver. The upstream kernel has AF_XDP which Intel and Mellanox NICs support in their drivers, and DPDK has official integration for it as well: https://doc.dpdk.org/guides/nics/af_xdp.html This will make deploying DPDK significantly easier for those that need/want to use it and allows to share the same driver for pushing packets up to DPDK and into the normal kernel stack with very close to "native" (as in user space driver) DPDK performance (target is ~90-95%).
Re:BPF at Facebook and beyond by shaklee3 on Friday October 11, 2019 @09:34AM (#21224169)
I'm aware of the xdp support, but it's brand new, and certainly nowhere near as mature as the normal mode. It doesn't even work on most NICs yet.

But I agree that once it's more mature, it will be better overall.

Re:BPF at Facebook and beyond by shaklee3 on Friday October 11, 2019 @11:35AM (#21225374)
From the latest DPDK docs in your link:

"Current implementation only supports single queue, multi-queues feature will be added later.

Note that MTU of AF_XDP PMD is limited due to XDP lacks support for fragmentation."

That's a non-starter for many use cases, since multiple queues is a fundamental feature of DPDK.

Re:BPF at Facebook and beyond by aloknnikhil on Friday October 11, 2019 @04:04AM (#21222430)
Predominantly, some internal teams at Cisco. VPP and its CNI (Ligato Contiv) seem to be picking up steam off late. This is going by activity in the mailing lists. I know Yahoo Japan uses it.

http://events19.linuxfoundation.org/wp-content/uploads/2018/...

Re:BPF at Facebook and beyond by jmeyerxz on Friday October 11, 2019 @08:14AM (#21223553)
Sort of a 'virtual switch' but much more beyond that and all with a BPF data plane. Cilium provides connectivity but also security policy, load-balancing and introspection for container pods. Preferred choice in Kubernetes-based workloads.
Re:BPF at Facebook and beyond by dmix on Thursday October 10, 2019 @07:56PM (#21220386)
The article mentions the servers run up to 100 different BPF related programs on an individual server. I get the firewall and traffic shaping stuff, but are there any unusual use-cases or hacks you could share?
Re:BPF at Facebook and beyond by bdd on Thursday October 10, 2019 @08:35PM (#21220539)
The number increases because there are various monitoring tools. Stuff like something that extracts more data from TCP retransmits so we have a better understanding of congestions and errors in the network path. ...or things that simply collect certain system events for security event detection. Imagine, for every certain event, what is injected is counted as a separate program.

On top of these which is common for every machine, service owners can deploy their own BPF programs for specific use cases. In fact our self service tracing tooling is also a BPF program. We talked about it back in 2014 when it did not use BPF https://tracingsummit.org/w/images/6/6f/TracingSummit2014-Tr...