Thread (36 messages) 36 messages, 8 authors, 2024-02-01

Re: [PATCH v6 net-next 3/5] xdp: add multi-buff support for xdp running in generic mode

From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: 2024-02-01 16:41:13
Also in: bpf

On Thu, 1 Feb 2024 12:34:26 +0100 Lorenzo Bianconi wrote:
quoted
quoted
nit: doesn't look all that related to a netif, I'd put it in skbuff.c  
ack, fine. skb_segment_for_xdp() in this case?
I think the closest thing we have now is skb_cow_data(),
so how about skb_cow_data_pp() or skb_cow_fragged() or
skb_cow_something? :)
I like skb_cow_something :)
I'm on the fence whether we should split the XDP-ness out.
I mean the only two xdp-related things are the headroom and
check for xdp_has_frags, so we could also:

skb_cow_data_pp(struct page_pool *pool, struct sk_buff **pskb,
		unsigned int headroom)
{
	...
}

skb_cow_data_xdp(struct page_pool *pool, struct sk_buff **pskb,
		 struct bpf_prog *prog)
{
	if (!prog->aux->xdp_has_frags)
		return -EINVAL;

	return skb_cow_data_pp(pool, pskb, XDP_PACKET_HEADROOM);
}


I think it'd increase the chances of reuse. But that's speculative 
so I'll let you decide if you prefer that or to keep it simple.
ack, I agree. I will fix it in v7.

Regards,
Lorenzo

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help