From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.74.67.63 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796043148; b=LmDFFupc3ESgbMusa8p1A6TvM996ZAun89B5I6nD+4mkTHGzNGcipOlfTm9r8nM8zhjO zIqCQHtnGDxW/Pii2LaKH3BGxtEJOf/ulibTo+b8vR0Ntgdpva6C3pU3fd3TBvrfNGlAj tvviLItWzHp6w1HM8x/Hh8mfHkwoeb0HeKOqbUcx78qRehbYTz1ASPubdryZIG0PHw8Bs xx7MyFetJEv1kgrhswC1XIWywK4hKIJrJOn6dpdvpEl2HNc0GEJrX+CAaeSSWhEF2CSrM GSnSgkdpPtaEnqE4qKEMTFFUU66FWiGJrEwUd1DV9RBUO/lSkPlbFQRr1b+8ESUY4Mg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796043148; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To:DKIM-Signature; bh=xhh7nAr/jt+cDu6RG+58l8W5d9HbVdY0V1wY6BVxxjE=; b=kZ6j0Jc8nzPbfThs8DUn7ndKlrfeUk+r05hNCvH4pGfVAsH0SawE4kCJ/6WxBIUxJjno Kbn8p58dJeHR30rf9CRx+9veo30XU9EJIDAeYa4C79GVDp9MMSNrteuGsSTJIYIRPrL5G bfpOM61FQ6oD6XgnCEby4Dxii2A2hpjumY7SeWgQUusTsgqABWiJy8Hzpv51/LtLQvu10 y9j849e+NQAREg2w+lbRgOwTtPOFJPI6gXyV+ECNTeHW8cK32iCoAjCI05muK/9EKmp3+ lhtvejnuaDM0n5hser/8C744qJgmuXP7hJNaNikmVB14oF9qYfrcIHE9Qly8XpJEHSg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=poczta.fm; spf=pass smtp.mailfrom=poczta.fm; dkim=pass header.d=poczta.fm header.i=@poczta.fm header.a=rsa-sha256 header.s=dk header.b=oPBUBMOc; arc=none smtp.remote-ip=217.74.67.63 Received: from smtpo63.interia.pl (smtpo63.interia.pl [217.74.67.63]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC890606A31C for ; Mon, 30 Nov 2026 12:52:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EC890606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=poczta.fm Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=poczta.fm Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=poczta.fm header.i=@poczta.fm header.a=rsa-sha256 header.s=dk header.b=oPBUBMOc Received: from nr200 (unknown [80.68.231.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by poczta.interia.pl (INTERIA.PL) with ESMTPSA; Mon, 30 Nov 2026 13:52:14 +0100 (CET) Date: Mon, 30 Nov 2026 13:52:11 +0100 From: Slawomir Stepien To: netdev-bot+sashiko@kernel.org Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, bpf@vger.kernel.org, netdev@vger.kernel.org, jiayuan.chen@linux.dev, phx0fer@gmail.com, maciej.fijalkowski@intel.com, tianyi@cloudflare.com, tavip@google.com, toke@redhat.com, aleksander.lobakin@intel.com, lorenzo@kernel.org, lorenzo.bianconi@oss.qualcomm.com, ihor.solodrai@linux.dev, andrew+netdev@lunn.ch, willemb@google.com, horms@kernel.org, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org, memxor@gmail.com, emil@etsalapatis.com, shuah@kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH net v9 4/6] veth: use the page_pool mem type when running XDP on an skb Message-ID: References: <20261127100132.1977890-5-sst@poczta.fm> <179586023747.3135.10147454988994351806@kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <179586023747.3135.10147454988994351806@kernel.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poczta.fm; s=dk; t=1796043138; bh=xhh7nAr/jt+cDu6RG+58l8W5d9HbVdY0V1wY6BVxxjE=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=oPBUBMOcwbG0FjD1zQT4hIZET38v8iW+9hv+lPEXT3Lj8F5D0C/OPNv8t5xJgxODG Ec/IYg5aWNBM6y0aNUH/1QPOXC/yLPA3fkrwepYM83Zig23dpyfuSozy6epAeaAMju 3khhNQlvZcmZ7u4J7KQ5GVGY4B9uE2KzUc4GNXe0= On lis 28, 2026 10:03, netdev-bot+sashiko@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential > issue(s) to consider. > > Critical: 0 · High: 0 · Medium: 1 · Low: 0 > > If you believe none of the issues are legitimate, please reply to each > issue of Medium severity or higher and explain why the AI is wrong. > If any of them are legitimate and you plan to respin, please let patchwork > know by including "pw-bot: cr" as a separate line at the end of your reply > (one such reply per series is enough). > > - [Medium] In drivers/net/veth.c, veth_convert_skb_to_xdp_buff() now > always sets rxq->mem.type = MEM_TYPE_PAGE_POOL. This is true, but with this condition: > Take an skb that is unshared and unlocked, has enough headroom, and has > nr_frags > 0 but data_len == 0 (all frags are zero-length). It skips > skb_pp_cow_data() and keeps its original frag pages, which are not > page_pool pages. It still gets XDP_FLAGS_HAS_FRAGS and runs with > MEM_TYPE_PAGE_POOL. I wonder how possible is this anyway? I guess an easy prevention for this case, would be to also check for nr_frags in here: if (skb_shared(skb) || skb_head_is_locked(skb) || - skb_is_nonlinear(skb) || + skb_is_nonlinear(skb) || skb_shinfo(skb)->nr_frags || skb_headroom(skb) < XDP_PACKET_HEADROOM) { if (skb_pp_cow_data(rq->page_pool, pskb, XDP_PACKET_HEADROOM)) goto drop; skb = *pskb; } With this, the frags will not be copied when data_len == 0, so the output skb would have nr_frags == 0, so the flag would not be set. -- Slawomir Stepien