From mboxrd@z Thu Jan 1 00:00:00 1970 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 BFD144685; Tue, 10 Jun 2025 20:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749587872; cv=none; b=WZx6oKesp8klDcTV34AcsjVQCWea3rdzSAsGGrj+uK/MLJgMMs+taXTN9CcFk9FpPOotZpsRZTvPV7cpxHL8nmbjDPWjtNthTb1ArDS56gWeHv2N8LPxGmhrVKYKRhDtmgGUNYaxlVCwnYMtFILuRl1JjiLCH2OOA7GLpJ9XTiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749587872; c=relaxed/simple; bh=lqS9H5+bZRu73v+RaI1FVxS30dUDinfTEKGWKKl2qec=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iJFdwuMOy6LPZCuowOL8BPT9lSCxnnHS/iyPnWXm3SH4515VTLqJRiSgulUwFxAC7VDE0Y75fHUXepmp5vLXxnq/T+l0Jw9vY7I1UwAJkZbC6rNnIRZiowE6dtDW2Da36oYJ9wRcBXMSbp2YZmJ0BlJyJ06RKpMnLyWTi9boarM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Nx7c4Q70; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Nx7c4Q70" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70215C4CEED; Tue, 10 Jun 2025 20:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749587872; bh=lqS9H5+bZRu73v+RaI1FVxS30dUDinfTEKGWKKl2qec=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Nx7c4Q70Nygv3x0k02CwqcdeYFxM6/hCVRrUFZJ2u58bCnj2OX2V9KoWx/XdY/gVd /rrk4iMjGG2qO8rCsUtOFdiJa7KvnvLz+LMGMw/vvDhXwKZY+b2ERGIdcqdB1Jt1YI rd8vbj0I2WICZicYGk4vfYxy2QW/7QrkfcYcUV6u0SSqBrtGnBpLy+7nOd3j4riffK mzXqyXFyr1y7wHLpvN0LDhKLyaX7W9KFB5O9l/thEmfWQIZf4A13dx5Pg8dD+BTNGR XP/Jen/MqUIRr7FdLznr4RXMFIHb096WTKmJMTmwvIHXiSlhCmz0OAqrB7VOC2l/JR dl64y7pQUQJtg== Date: Tue, 10 Jun 2025 13:37:50 -0700 From: Jakub Kicinski To: Bui Quang Minh Cc: Paolo Abeni , netdev@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?UTF-8?B?UMOpcmV6?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH net] virtio-net: drop the multi-buffer XDP packet in zerocopy Message-ID: <20250610133750.7c43e634@kernel.org> In-Reply-To: References: <20250603150613.83802-1-minhquangbui99@gmail.com> <20250605074810.2b3b2637@kernel.org> <20250609095824.414cffa1@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 10 Jun 2025 22:18:32 +0700 Bui Quang Minh wrote: > >> Furthermore, we are in the zerocopy so we cannot linearize by > >> allocating a large enough buffer to cover the whole frame then copy the > >> frame data to it. That's not zerocopy anymore. Also, XDP socket zerocopy > >> receive has assumption that the packet it receives must from the umem > >> pool. AFAIK, the generic XDP path is for copy mode only. > > Generic XDP == do_xdp_generic(), here I think you mean the normal XDP > > patch in the virtio driver? If so then no, XDP is very much not > > expected to copy each frame before processing. > > Yes, I mean generic XDP = do_xdp_generic(). I mean that we can linearize > the frame if needed (like in netif_skb_check_for_xdp()) in copy mode for > XDP socket but not in zerocopy mode. Okay, I meant the copies in the driver - virtio calls xdp_linearize_page() in a few places, for normal XDP. > > This is only slightly related to you patch but while we talk about > > multi-buf - in the netdev CI the test which sends ping while XDP > > multi-buf program is attached is really flaky :( > > https://netdev.bots.linux.dev/contest.html?executor=vmksft-drv-hw&test=ping-py.ping-test-xdp-native-mb&ld-cases=1 > > metal-drv-hw means the NETIF is the real NIC, right? The "metal" in the name refers to the AWS instance type that hosts the runner. The test runs in a VM over virtio, more details: https://github.com/linux-netdev/nipa/wiki/Running-driver-tests-on-virtio