Skip to content

Provide more headroom for packets to allow bpf_xdp_adjust_head to be used #70

@thomaseizinger

Description

@thomaseizinger

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:

xdp_prepare_buff(&xdp, page_info->page_address +
page_info->page_offset, GVE_RX_PAD,
len, false);

The constant passed here, GVE_RX_PAD is defined as 2:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions