xdp-project / xdp-project

XDP project collaboration through a git-repo
260 stars 35 forks source link

regarding xdp modes and smartNICs #54

Closed sachintiptur closed 3 years ago

sachintiptur commented 3 years ago

Hi,

I am trying to test the performance of our xdp ebpf program. I have questions regarding modes of operation in xdp.

  1. From my understanding Generic mode, driver mode and offload to NIC mode. What is the difference between driver mode and offload to NIC mode? or both are same?

  2. Our server has igb NIC driver and i came to know that it is supported in kernel version 5.10. If i upgrade to this kernel, can I offload xdp to NIC or should I go for any smart NIC with ebpf support?

  3. Can you please let me know apart from nfp Netronome what other smartNICs support ebpf offloading, so that I can try to procure one.

Thanks, Sachin

tohojo commented 3 years ago

sachints123 notifications@github.com writes:

Hi,

I am trying to test the performance of our xdp ebpf program. I have questions regarding modes of operation in xdp.

  1. From my understanding Generic mode, driver mode and offload to NIC mode. What is the difference between driver mode and offload to NIC mode? or both are same?

Offload mode means "runs on the NIC co-processor". This is only supports by the 'nfp' driver, and it's somewhat limited in what features it can support (map types etc).

You can think of 'native' or 'driver' mode as "software offload". It still runs on the host CPU, but it's significantly faster than the networking stack (and thus than generic mode) because the kernel does a bunch of tricks to give the BPF program access to the packet data as early as possible and with as little overhead as possible.

  1. Our server has igb NIC driver and i came to know that it is supported in kernel version 5.10. If i upgrade to this kernel, can I offload xdp to NIC or should I go for any smart NIC with ebpf support?

If you want offload you'll need to get a Netronome smart NIC. However, you can still get a significant performance boost by just running in driver mode, and you can use more BPF features that way. So depending on your use case I'd advise that you start out by experimenting with driver mode on your current hardware.

  1. Can you please let me know apart from nfp Netronome what other smartNICs support ebpf offloading, so that I can try to procure one.

Nothing other than nfp cards support offloading today, AFAIK.

sachintiptur commented 3 years ago

Thank you Toke Hoiland. Looks like only netronome supports..for now i go with the driver mode

tohojo commented 3 years ago

sachints123 notifications@github.com writes:

Thank you Toke Hoiland. Looks like only netronome supports..for now i go with the driver mode

Yeah, you'll probably be fine with that :)