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 0B7FF26ADD; Tue, 10 Sep 2024 01:57:51 +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=1725933472; cv=none; b=kXL2SR1Azn2HTkiQeJ/b/qvdgt5AQT09nQ0g9KdjaZ8E9Nzc2bPjJZQC2v7AAH5+buTorM/rHnlWAtW61ZbugQZYvRspjfv6OyfGgbTnO3IxjydQevd97A85tU4qpwGrGm/+1LzRJRU9JkStZSp8mbd15ylwLdYkLo5vmaHZO58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725933472; c=relaxed/simple; bh=Mpc367Qq2KgjGSWneG8t1t7ylvaiUYfcTC1evuPCSo0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TRXlptImRrVVmeceyp7ilBwK9KCrN29Je/fakWzQpMimUZGCL6adUx/uK+NTxcyybbhobic+dh7uA6PX1l/8AybD8ae7bOZBID9ITBJ37k3cZGVD41Qy1ZmXbp7B+nL8x90UZqj6Occuo48x9QJEDR8IqywQUtv+GxLSv8nZ8Dg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A4/ZBQtc; 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="A4/ZBQtc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F36CC4CEC5; Tue, 10 Sep 2024 01:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725933471; bh=Mpc367Qq2KgjGSWneG8t1t7ylvaiUYfcTC1evuPCSo0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=A4/ZBQtcLIVb6iJZdngcey0BUW2zuO3KEn6O5mQs+NSHCdaQh93+fSfs+dgmnhku8 w5t+tKZKrGWg4mG1LanrIl+K/MzOHj1TaUy02KZpXCIv2VcTQWCjZp/THeUSS+BriL Chv4kikV2OgmKAFg8mkArn+YqHk2DUbnMrQ5AacoQXJzNZma9akXcs16C7z9hxlJEZ 5Srv0B7MY5lD3KerRnih5ibEHCZtSXAQVJJIVEOewhIq32CUfjES6fhrQTG5rWjVyE bncyE1+MM6CNLsmeO51LG0Ng53/ZcyW+bA113+7RFtBT0ry4kFbQ5QTmr3qm3SAMBe n1+sOElpSPkQw== Date: Mon, 9 Sep 2024 18:57:48 -0700 From: Jakub Kicinski To: Mina Almasry Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Donald Hunter , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Steffen Klassert , Herbert Xu , David Ahern , Willem de Bruijn , "=?UTF-8?B?QmrDtnJuIFTDtnBl?= =?UTF-8?B?bA==?=" , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , Shuah Khan , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Sumit Semwal , "Christian =?UTF-8?B?S8O2bmln?=" , Pavel Begunkov , David Wei , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi , Bagas Sanjaya , Christoph Hellwig , Nikolay Aleksandrov , Taehee Yoo , Willem de Bruijn , Kaiyuan Zhang Subject: Re: [PATCH net-next v25 08/13] net: add support for skbs with unreadable frags Message-ID: <20240909185748.0ac082fd@kernel.org> In-Reply-To: <20240909054318.1809580-9-almasrymina@google.com> References: <20240909054318.1809580-1-almasrymina@google.com> <20240909054318.1809580-9-almasrymina@google.com> Precedence: bulk X-Mailing-List: sparclinux@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 Mon, 9 Sep 2024 05:43:13 +0000 Mina Almasry wrote: > For device memory TCP, we expect the skb headers to be available in host > memory for access, and we expect the skb frags to be in device memory > and unaccessible to the host. We expect there to be no mixing and > matching of device memory frags (unaccessible) with host memory frags > (accessible) in the same skb. > > Add a skb->devmem flag which indicates whether the frags in this skb > are device memory frags or not. > > __skb_fill_netmem_desc() now checks frags added to skbs for net_iov, > and marks the skb as skb->devmem accordingly. > > Add checks through the network stack to avoid accessing the frags of > devmem skbs and avoid coalescing devmem skbs with non devmem skbs. > > Signed-off-by: Willem de Bruijn > Signed-off-by: Kaiyuan Zhang > Signed-off-by: Mina Almasry > Reviewed-by: Eric Dumazet I'm sure we'll find more cases which need a check but I can't think of any now, so: Reviewed-by: Jakub Kicinski