From patchwork Tue Aug 22 17:59:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 13361278 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B8171D307 for ; Tue, 22 Aug 2023 17:59:25 +0000 (UTC) Received: from [192.168.42.3] (194-45-78-10.static.kviknet.net [194.45.78.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPSA id 8D89DC433C7; Tue, 22 Aug 2023 17:59:22 +0000 (UTC) Subject: [PATCH net-next RFC v1 3/4] veth: lift skb_head_is_locked restriction for SKB based XDP From: Jesper Dangaard Brouer To: netdev@vger.kernel.org, edumazet@google.com Cc: Jesper Dangaard Brouer , pabeni@redhat.com, kuba@kernel.org, davem@davemloft.net, lorenzo@kernel.org, Ilias Apalodimas , mtahhan@redhat.com, huangjie.albert@bytedance.com, Yunsheng Lin , Liang Chen Date: Tue, 22 Aug 2023 19:59:20 +0200 Message-ID: <169272716036.1975370.9471039093816465682.stgit@firesoul> In-Reply-To: <169272709850.1975370.16698220879817216294.stgit@firesoul> References: <169272709850.1975370.16698220879817216294.stgit@firesoul> User-Agent: StGit/1.4 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 --- drivers/net/veth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;