0

I am trying to load my XDP program directly on the NIC (offloaded XDP). According to this answer, I need to specify the device to the following functions:

  • BPF()
  • load_func()

I did it like so:

b = BPF(src_file=”file.c”, cflags=[”-w”], device=”eno5”)

When I added the device I got the following error:

types.ArgumentError: argument 6: <class ‘TypeError’>: wrong type

Can you please help me to solve this issue and make my XDP program offloaded to the NIC? Thanks

Qeole
  • 8,284
  • 1
  • 24
  • 52
Lidorelias3
  • 27
  • 1
  • 10
  • Does it work as expected without hardware offload? – Qeole Mar 15 '21 at 10:07
  • Yes it is. When I added the device parameter to BPF function or attach_xdp function, it cause an error – Lidorelias3 Mar 15 '21 at 17:20
  • Could it be that a bug in bcc was introduced at some point? I don't think hardware offload with bcc is tested often. If you don't get an answer here, it might be worth opening an issue on the GitHub repo. – Qeole Mar 15 '21 at 17:22
  • The type of the device parameter should be the name of the device? In string? – Lidorelias3 Mar 15 '21 at 17:29
  • Yes it should. I tried running the example `./examples/networking/xdp/xdp_drop_count.py` again and it fails with the same error (I don't have access to a SmartNIC anymore, but I would expect [a different error message](https://github.com/iovisor/bcc/pull/2502#issuecomment-526731097) for missing offload capailities). I believe this is a bug, although I failed at my quick attempt to bisect (I can't build from older versions on my setup, apparently). – Qeole Mar 15 '21 at 23:25

0 Answers0