Thread (36 messages) 36 messages, 3 authors, 2022-01-19

Re: [PATCH v22 bpf-next 12/23] bpf: add multi-frags support to the bpf_xdp_adjust_tail() API

From: Alexei Starovoitov <hidden>
Date: 2022-01-18 20:20:55
Also in: bpf

On Mon, Jan 17, 2022 at 06:28:24PM +0100, Lorenzo Bianconi wrote:
 BPF_CALL_2(bpf_xdp_adjust_tail, struct xdp_buff *, xdp, int, offset)
 {
 	void *data_hard_end = xdp_data_hard_end(xdp); /* use xdp->frame_sz */
 	void *data_end = xdp->data_end + offset;
 
+	if (unlikely(xdp_buff_has_frags(xdp))) { /* xdp multi-frags */
+		if (offset < 0)
+			return bpf_xdp_multi_frags_shrink_tail(xdp, -offset);
+
+		return bpf_xdp_multi_frags_increase_tail(xdp, offset);
+	}
"multi frags" isn't quite correct here and in other places.
It sounds like watery water.
Saying "xdp frags" is enough to explain that xdp has fragments.
Either multiple fragments or just one fragment doesn't matter.
I think it would be cleaner to drop "multi".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help