Re: [PATCH net-next 05/12] xdp: add generic xdp_build_skb_from_buff()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 11 Dec 2024 18:26:42 +0100 Alexander Lobakin wrote:
> +	if (rxq->mem.type == MEM_TYPE_PAGE_POOL && is_page_pool_compiled_in())
> +		skb_mark_for_recycle(skb);

I feel like the check for mem.type is unnecessary. I can't think of 
a driver that would build a skb out of pp pages, and not own pp
refs on those pages. Setting pp_recycle on non-pp skb should be safe,
even if slightly wasteful.

Also:

static inline void skb_mark_for_recycle(struct sk_buff *skb)
{
#ifdef CONFIG_PAGE_POOL
	skb->pp_recycle = 1;
#endif
}

You don't have to check if PP is complied in explicitly.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux