xdp-project / xdp-tools

Utilities and example programs for use with XDP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to do crc32 or xxhash for bpf? are there any existing hash functions i can use? even fnv1a etc is fine

hiqsociety opened this issue · comments

  1. how to do crc32 or xxhash for bpf? are there any existing hash functions i can use? even fnv1a etc is fine
  2. are there simpler workaround?
  3. there is BPF_CPU_HASH_... stuff, possible to use that hash too? what is the hash? need to match with my user app

i can do ipv4 % cpunum
how do i do the last ip number of ipv6 to do
ipv6[4] % cpunum? //<- something along this line? can provide a clue? the cpunum i know how to get. just dunno how to get the last ipv6[4] <- value i think it's 4x uint64 for each ipv6 segment so how do i get the last segment?

I'm sorry, but this is not a general support forum for how to write XDP programs. Closing this issue as not relevant to xdp-tools.