1

I write to eBPF maps of type BPF_MAP_TYPE_HASH and BPF_MAP_TYPE_ARRAY in user space and read the maps from an XDP program. Would I get performance improvements in the XDP program if I use BPF_MAP_TYPE_PERCPU_HASH and BPF_MAP_TYPE_PERCPU_ARRAY? In the case where I write from the XDP program, I use PERCPU maps, but I'm wondering if I'd get performance improvements in this scenario because I am only reading these maps from the XDP program.

user2233706
  • 6,148
  • 5
  • 44
  • 86

1 Answers1

1

No, in theory your performance would even get worse since you would populate your shared CPU caches (L3) with duplicate data. Leaving less room for other parts of your application. Admittedly, this would likely be negligible.

Please note that I am saying this from a theoretical standpoint. I do not have practical numbers myself. Please try it if in doubt.

Dylan Reimerink
  • 5,874
  • 2
  • 15
  • 21