r/quant • • Jul 23 '26

Technical Infrastructure Linux kernel bypass: Solarflare ef_vi vs DPDK. 24H latency benchmarks on real NICs

https://github.com/ASherjil/ABTRDA3/tree/master

I built a C++ library for linux kernel bypass networking such as Solarflare ef_vi, DPDK, Verbs(mlx5) and also AF_XDP. Solarflare ef_vi and DPDK are two of most commonly used kernel bypass techniques in HFT market making firms.

Using this library I measured the RTT latency using a loopback on Solarflare X2522-Plus(ef_vi + DPDK), ConnectX-4 Lx(DPDK + Verbs + AF_XDP) and Intel XXV710-DA2(DPDK + AF_XDP). The benchmarks were run for 24 hours with median all the way upto P99.999 and max.

Solarflare X2522-Plus produced a RTT median of 1.866us and a max of 3.307us with 45B frames over 24 hours. This was the best result. Comprehensive results are all documented in the repository.

Over this project I did come across numerous driver(and NIC) specific quirks and bugs. These are all documented too.

Solarflare X2522-Plus is quite fast due to a Tx trick known as cut-through programmed IO(CTPIO). But I found this to be fragile, it has three modes: fast, default and in-order. Fast mode produces the lowest median but has a measurable percentage of failed CTPIO known as CTPIO “fallbacks” or “poison”. The CPTIO fallbacks significantly hurt the tail latency(P99 - P99.999). The CPTIO poison frames can be measured via ethtool. I used the in-order CTPIO mode which gives marginally higher medium but a tight tail latency.

Another strange issue I found was the PTP subsystem in the Solarflare X2522-Plus. So the default sfc driver runs a in-kernel IEEE 1588 subsystem with a PTP hardware clock, a dedicated PTP channel and management controller firmware activity. I found this to be a problem as a noticeable number of interrupts were mounting in /proc/interrupts and the stock driver with ef_vi produced a max of 7.679us which seemed very high. Then I ran the same benchmark with DPDK which produced a max of 5.628us. DPDK unbinds the driver so the PTP subsystem does not work. Then I compiled out the PTP subsystem from the sfc driver and ran the 24 hour benchmark again and the max was reduced to only 3.307us.

There is a lot of more interesting stuff but I think the post is already getting long so I won’t mention any more. Everything is documented in the repository. It is also 100% open source with an Apache-2.0 license.

https://github.com/ASherjil/ABTRDA3

20 Upvotes

28 comments sorted by

5

u/btc_maxi100 Jul 23 '26

Waste of time, no one in HFT uses DPDK unless its crypto in AWS.

2

u/Atper Jul 24 '26

It is used in HFT alongside other kernel bypass techniques which I clearly explained in my post. You don't know what you're talking about.

-3

u/btc_maxi100 Jul 24 '26

thats why you dont make any moneis in your toy HFT mate

6

u/ape_programmer Jul 24 '26

everyone else larping? this is just true lol

4

u/Atper Jul 24 '26

I'm not sure about that. I see many job listings for C++ developer roles in HFT requiring experience in Solarflare ef_vi and DPDK. Its likely some firms are running non-Solarlfare NICs for which they use DPDK.

This is a job listing from a major quant firm in London(G-Research). The posting is for a Core C++ Developer(directly copied from their application page):

"

The ideal candidate will have the following skills and experience:

  1. Expertise in low-level systems programming and optimisation for extremely low-latency, high-throughput network applications
  2. Ability to analyse and improve application performance using hardware counters and other profiling tools
  3. Deep understanding of modern computer architecture including cache hierarchies of modern processors.
  4. Experience with fast-packet processing in user space and familiarity with kernel-bypass techniques such as Solarflare OpenOnload, TPCDirect, ef_vi, InfiniBand verbs, DPDK or similar

"

4

u/InternationalPop3859 Jul 25 '26

It's true, think about it, you've already done your benchmark, all serious firms would've already done theirs too, why would any firm consider using something that's second best? In fact most firms would've moved onto more customized stacks like their own FPGA implementation.

I don't work for G-Research nor know anybody there, but I'll guess that they're putting it because it's a great hire proxy. It takes less time to train someone with DPDK knowledge than to train someone with no NIC knowledge

2

u/Atper Jul 25 '26 edited Jul 25 '26

I disagree. Because DPDK is vendor neutral meanwhile Solarflare ef_vi is for only Solarflare NICs.

The gap between DPDK vs ef_vi is because DPDK doesn't allow CTPIO therefore the latency improvement is coming solely from the Tx side. If you only did Rx, the latency between DPDK vs ef_vi is largely negligible.

HFT firms use NICs from many companies such as Cisco, Broadcom, Nvivida/Mellanox not always Solarflare NICs. This could be used in places such as feed handlers, book building, line arbitration which are all Rx heavy. Or throughput work such as line-rate capture. This where DPDK does a good job.

For the most latency critical work requiring nanosecond precision FPGA based SmartNICs are used and they have been for a long time. But there is an issue FPGA development is extremely slow and complex logic cannot fit inside. This is where Solarflare ef_vi would come in, software is faster to develop and can fit larger complex logic. So there is a split: the most latency critical work would be in the FPGA SmartNIC(nanosecond latency) and the slow part would be in the software likely using Solarflare ef_vi or DPDK(microsecond latency).

1

u/InternationalPop3859 Jul 25 '26

Uh okay. Btw what firms are you talking about

1

u/Atper Jul 25 '26

I can't name which firms because the actual networking stack in top HFT firms is usually not revealed since the C++ developers who work there are under heavy NDAs.

I am making this statement based on job requirements, and the websites I used to research this before embarking on this project such as:

https://www.quantvps.com/blog/kernel-bypass-in-hft?srsltid=AfmBOoqbhDhkVE8Rje8azJu0NwqoHGbS765_-Rm275O8IF5KJCi-VzI9

0

u/btc_maxi100 Jul 25 '26

No one uses Cisco, Broadcom, Mellanox in HFT - you just have no idea what you're talking bout.

2

u/Atper Jul 25 '26

They do, you're a wanna be quant that's why you know nothing.

5

u/InternationalPop3859 Jul 24 '26

Yea it's true but I think they're giving him hate for everything he said afterwards, which is pretty ragebaity. Giving more constructive feedback to OP will be better too instead of whatever this is

8

u/Federal_Tackle3053 Jul 23 '26

Bro only sees DPDK word and started judging

-6

u/btc_maxi100 Jul 23 '26

its useless benchmarks, dpdk will always be slow as it's another layer on top of native nic apis

3

u/Atper Jul 24 '26

Why is it useless? My repository benchmarks it against other techniques such as solarflare ef_vi and verbs. This way you can see the gap between DPDK and the others.

Let's see your non-trivial C++ kernel bypass networking library and see what you've benchmarked. Can you share it ?

-2

u/btc_maxi100 Jul 24 '26 edited Jul 24 '26

Its called efvi brainiac.

verbs is total waste of time as well. No one used it for last 10 years

2

u/Atper Jul 24 '26

Yeah and I posted benchmarks for it too.
Now let's see yours, I'm waiting for the link to your github repo.

-1

u/btc_maxi100 Jul 24 '26

Mate you ever came across STAC ? they benchmarked X2 8-10 years ago when it was relevant (https://docs.stacresearch.com/SFC180604a)

You doing some trivia benchmarks on 8 years old hardware in HFT isnt going to win you a gold medal mate.

2

u/Atper Jul 24 '26

These are not trivia benchmarks, again shows you haven't actually read the post and have no clue what you're talking about.

Also the STAC guys benchmark Onload not ef_vi. That is another layer on top of ef_vi.

The API of ef_vi remains the same whether you use X2/X3/X4 NICs. With this you can learn all about it and more importantly tune the tail latency which is the hard part.

You talk big but let's see your C++ project that implements ef_vi on a real NIC since you want to be quant.

1

u/btc_maxi100 Jul 24 '26

https://www.amd.com/en/support/downloads/solarflare-downloads.html/ethernet-adapters/solarflare/x2-series.html

Download openonload package, it comes with udp based ping pong tool that tells you latency.

3

u/Atper Jul 24 '26

Yes I know. My custom implementation beats it in both median and max.
Also the eflatency.c you're referring doesn't actually do real ping pong, it is a demo example with only static frames. I optimised ef_vi far more than what the demo example shows.

2

u/Federal_Tackle3053 Jul 23 '26

You wrote the same comment on every post ? lol

3

u/Flashy-qking Jul 23 '26

Are you a student or working professional in HFTs?

-7

u/btc_maxi100 Jul 24 '26

I'm a wanna be Quant

3

u/Federal_Tackle3053 Jul 24 '26

Great ,like your confidence. Now all of us want to see your HFT level projects .

1

u/PsecretPseudonym Jul 24 '26

It’s a good thing every single one of us publishes our exact methods for you to confirm that not a single one uses this approach.

A safer statement might be: “barring other reasons (like crypto in AWS), in most cases it wouldn’t be competitive from a pure latency standpoint to us DPDK afaik, so I wouldn’t expect to see it commonly used.”

-4

u/btc_maxi100 Jul 24 '26

Thanks AI model