Skip to contentSkip to conversation

Questions about XDP hints

DISCUSSION tianmuyang 2 participants 2 messages Oct 12, 2024 – Oct 14, 2024

Subsystems (3)
lore
Share & tools
lore

tianmuyang

author
#0 lore raw

Hi all:
There has been some discussions about adding checksum hint in AF_XDP such as this thread[1]. Now, we also plan to add checksum hint. My questions are:
1. In this msg[2], is it appropriate if xdp_csum_status only includes 4 enums/macros(CHECKSUM_NONE...CHECKSUM_PARTIAL in skbuff.h)? Thus it becomes more generic. Also, in this msg[3] we can simply pass skb->ip_summed to csum_status in veth_xdp_rx_csum().
2. What should be taken care of if I want to add a new hint? IOW, what is acceptable to add a new hint?

Thanks!

[1] https://lore.kernel.org/bpf/CAADnVQJPgpo7J0qVTQJYYocZ=Jnw=O5GfN2=PyAQ55+WWG_DVg@mail.gmail.com/
[2] https://lore.kernel.org/bpf/[email protected]/
[3] https://lore.kernel.org/bpf/[email protected]/

#1 lore raw
Quoted 4 lines · tianmuyang

Hi all:
There has been some discussions about adding checksum hint in AF_XDP such as this thread[1]. Now, we also plan to add checksum hint. My questions are:
1. In this msg[2], is it appropriate if xdp_csum_status only includes 4 enums/macros(CHECKSUM_NONE...CHECKSUM_PARTIAL in skbuff.h)? Thus it becomes more generic. Also, in this msg[3] we can simply pass skb->ip_summed to csum_status in veth_xdp_rx_csum().
2. What should be taken care of if I want to add a new hint? IOW, what is acceptable to add a new hint?

There is no clear guidance on what's acceptable and what's not. Each hint it evaluated case by case. IIRC, last time rx csum discussion stalled due to disagreement about the level of details which should be exposed from the generic kfuncs. Feel free to revive the discussion with another patchset.

Regarding (1): the consensus seems to be (IIRC) is to expose tree cases
only: no-csum, csum-unnecessary, csum-complete+csum. Anything else gets too device specific and too convoluted to handle on the xdp prog side.

Quoted 6 lines

Thanks!

[1] https://lore.kernel.org/bpf/CAADnVQJPgpo7J0qVTQJYYocZ=Jnw=O5GfN2=PyAQ55+WWG_DVg@mail.gmail.com/
[2] https://lore.kernel.org/bpf/[email protected]/
[3] https://lore.kernel.org/bpf/[email protected]/