Re: [PATCH v3 4/5] net: tun: fix tun_xdp_one() for IFF_TUN mode
From: David Woodhouse <dwmw2@infradead.org>
Date: 2021-06-28 10:43:39
Attachments
- smime.p7s [application/x-pkcs7-signature] 5174 bytes
From: David Woodhouse <dwmw2@infradead.org>
Date: 2021-06-28 10:43:39
On Mon, 2021-06-28 at 12:27 +0800, Jason Wang wrote:
quoted
If we're going to continue to *not* check on the XDP path, we similarly need a proof that it can't be fragmented. And also a reason to bother with the "optimisation", of course.For XDP path, we simply need to add a length check since the packet is always a linear memory.
Sure, but in that case skb_headlen is going to be enough to cover ETH_HLEN, and that's the very first thing that the standard inline version of pskb_may_pull() checks, without ever even having to make an out-of-line call. So there's just no reason ever for us *not* to keep it really simple, and use pskb_may_pull() in all cases.