diff mbox series

[net-next,RFC,v1,3/4] veth: lift skb_head_is_locked restriction for SKB based XDP

Message ID 169272716036.1975370.9471039093816465682.stgit@firesoul (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series veth: reduce reallocations of SKBs when XDP bpf-prog is loaded | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers warning 4 maintainers not CCed: daniel@iogearbox.net ast@kernel.org bpf@vger.kernel.org john.fastabend@gmail.com
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jesper Dangaard Brouer Aug. 22, 2023, 5:59 p.m. UTC
As veth_xdp_rcv_skb() no-longer steals SKB data and no-longer uses
XDP native xdp_do_redirect(), then it is possible to handle
more types of SKBs with other memory types.

Replacing skb_head_is_locked() with skb_cloned().

Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org>
---
 drivers/net/veth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 192547035194..8e117cc44fda 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -720,7 +720,7 @@  static int veth_convert_skb_to_xdp_buff(struct veth_rq *rq,
 	struct sk_buff *skb = *pskb;
 	u32 frame_sz;
 
-	if (skb_shared(skb) || skb_head_is_locked(skb) ||
+	if (skb_shared(skb) || skb_cloned(skb) ||
 	    skb_shinfo(skb)->nr_frags ||
 	    skb_headroom(skb) < XDP_PACKET_HEADROOM) {
 		u32 size, len, max_head_size, off;