Netronome / nic-firmware

CoreNIC: a flexible SR-IOV SmartNIC firmware implementation supporting BPF and stateless offloads.
BSD 2-Clause "Simplified" License
92 stars 11 forks source link

Bpf firmware compilation #7

Open petrarce opened 4 years ago

petrarce commented 4 years ago

Hi everyone!

I am trying to compile netronome firmware from scratch, but after i am loading the firmware to the i am not able to load any bpf filter. Loading original firmware doesn't have such a problem.

Here are steps i am performing to compile and load firmware:

  make nic/nic_AMDA0099-0001_2x10.nffw
  cp ./firmware/nffw/nic/nic_AMDA0099-0001_2x10.nffw /opt/netronome/agilio-bpf-firmware/ic_AMDA0099-0001_2x10.nffw
  rmmod nfp
  modprobe nfp

But when i am trying to load ebpf filter i am getting

bpf: bpf(BPF_PROG_LOAD): Invalid argument

Is there something i am missing during compilation?

mrapson-netronome commented 4 years ago

Hi petrarce,

Thanks for your query. I assume you are trying to load the eBPF filter offloaded? The short answer is that Netronome has not made the BPF support open source.

When you build a "nic/nic_AMDA0099-0001_2x10.nffw", you are building the most basic firmware with PF support only. "sriov/nic_AMDA0099-0001_2x10.nffw" provides SRIOV support as well. Each of these firmwares advertises themselves as a different "flavour" or "nfp_app_id" to the nfp.ko module. The nfp_app_id for BPF is 2, see https://github.com/Netronome/nfp-drv-kmods/blob/master/src/nfp_app.h.

Overall, you are probably not doing anything wrong with your building process. The more advanced offloads (BPF and TC for example) have not been open sourced at this time.

jmalcaraz commented 3 years ago

It is clear that the logic for eBPF is already available in the source code. For example, adding the FLAVOUR=bfp in the makefile will enable bfp offloading and it will work if you do not make use of maps. However, it is a shame the complete bpf support with maps has not been released because it makes the usage of the card much less attrative for research purposes. +1 to vote to provide such support as open source.

mcabranches commented 3 years ago

Hi! Any chances Netronome will make the firmware with BPF support open source?