GoogleCloudPlatform / GoogleCloudPlatform/compute-virtual-ethernet-linux
Provide more headroom for packets to allow `bpf_xdp_adjust_head` to be used
- Dominant language
- C
- Stars
- 91
- Forks
- 44
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 2
Description
I am trying to deploy an XDP program to GCP with gVNIC that uses `bpf_xdp_adjust_head`. This currently fails in mysterious ways and after some debugging and reading the source code, I think I have figured out why:
The driver only provides us with two bytes of headroom:
https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux/blob/d5ad781d87806deb507a9760d6b11a9ab4144eca/google/gve/gve_rx.c#L858-L860
The constant passed here, `GVE_RX_PAD` is defined as 2:
https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux/blob/d5ad781d87806deb507a9760d6b11a9ab4144eca/build/gve_desc.h#L86
That is unusually low.
The Linux kernel itself defines the headroom as 256:
https://github.com/torvalds/linux/blob/94d471a4f42862bf53dc3776bde4b4c9175acbd4/include/uapi/linux/bpf.h#L6449
Would it be possible to adjust this? If I compile the driver myself (which this constant changed), are things "just" going to work or are there more things that need to be changed?
Contributor guide
Assessment
This issue has not been assessed yet.