Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp332841lqs; Tue, 5 Mar 2024 03:34:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXHh+gSNnT7xpZ2A6GSmw5siBKzVvMnYKWegr8FDaWNjkuWHdaHffooJsan9irWHV2rJ9U15ZyTRqSZ6N3FJ/qubTn6A6Lo4bYcE505yg== X-Google-Smtp-Source: AGHT+IGkmJZ1WpND2GA+VV22+0Ye7nhKPhT7H6zF9dTfzU/ZqTQid3U76nHxZu+km81HhsUvlG6L X-Received: by 2002:a05:6a20:3c9f:b0:1a0:8897:85f1 with SMTP id b31-20020a056a203c9f00b001a0889785f1mr1701971pzj.6.1709638454180; Tue, 05 Mar 2024 03:34:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709638454; cv=pass; d=google.com; s=arc-20160816; b=lbFoPJsEQ+NThIGfwYolzAtiQShsa1NDegiIfX7I4BHXSW80adUIuCRtqIVAE8aCTb zaTvyURqSW8RR9XGv4T5TXvCuBKFmqyoqnVpAO99H6FfLGExz3KkSExFqNsVs5RY7U9q UM2yM9gAObArxBFWr/LNxc0BUa+SxJSmB+qgUtzZ4r6eGQYfUbr2olFOuZ0bKMHtmXNU UFJDI7P+Guzc0jfHEwdNMcw5zwvkSGI8w/FtJQ7yO0zkV/P0IDYJ1tTCTHRhX97J9CLe heJE8DQ/Y7oL567zDv2g1lQH4dsXgp0r+2TmvZvZCQ9tDrVhQjcA6ianCIPH9V+eTQdE 1cxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=QeA3EPMJnwt6NmNxY9VsOPm58VedM11auwf8kvd3l10=; fh=mGL+QDiLPsMFdIzG/6Lv8KDRNnXweMPK5miXynhYqv4=; b=JN6QpkKFy8rt42rxgHsLQiXerYiNcYgnzRnk6ENDGjdGGNhuwcdaiABhEj9/HeecV/ j4HZ1TjkBhyVSJR48MbaJ3XH1s68CGOcjpL3DcG26yAXQm0O9Pyn5K0mEvMswW/2qmXZ 47G66jfRHkJQQN5g1Vfc6FmMIdgeRlZnF7HvZij9lBN3EKMwKJaAmronRPDDcP5oT9ZR EzRb/F6KzZlcpmXSRYy/x5GwSAoF7XH4+YoyJJ/CDnu/MMu8bAWSnvrfAjvNJuc6wpk4 TjsYGXy5zZ0zchP8o+pnjJLpV8RvnkOtOA46MqmPo2rYbMkLLkoWw6fO853GFDdcT4I+ 3vBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=nFCUr8mh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=MeGRT64E; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-91920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id by30-20020a056a02059e00b005e4b0710537si7414544pgb.562.2024.03.05.03.34.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 03:34:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=nFCUr8mh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=MeGRT64E; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-91920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 690FFB21D44 for ; Tue, 5 Mar 2024 08:42:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF5F54F890; Tue, 5 Mar 2024 08:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="nFCUr8mh"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MeGRT64E" Received: from wfout6-smtp.messagingengine.com (wfout6-smtp.messagingengine.com [64.147.123.149]) (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 C555C2E40B; Tue, 5 Mar 2024 08:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709628140; cv=none; b=IuDCgWE0ElNh4fAngvLvjgvKNuMF3zcxJrwP62yhKRmbcuLk1t2PN4oYWRondMDEhpcCH0TCtZcCEAFthcY4gPx5lTV4KVbaxmoCloCIWQFnK/F2qIOxovHYLm80BP6aQWne3RsubB6Fz8RzAxpUBpGmmuttloD9JR9aXARK3qk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709628140; c=relaxed/simple; bh=NmJCAuRJ199Nz8coLDr4s+3BbQ9AxZ5w+P+Jx63NVw4=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=KKQ27b7rQWyv1YzcEjRRSKF6uIk9CsJMtCEOwknbNukNVyrM1TulLEWP42KquIABrfI7Xav2nPz1uy6eG/99XGdLDJny/KzmRSVmEC+C18PkeUKPVz84vtmGPpBcBj4I9WcuXUXy8jeOv6T5CYR9Nq/BoKEOwHw8tLXOFt6JpEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=nFCUr8mh; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MeGRT64E; arc=none smtp.client-ip=64.147.123.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 1AD091C0009F; Tue, 5 Mar 2024 03:42:16 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 05 Mar 2024 03:42:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1709628135; x=1709714535; bh=QeA3EPMJnw t6NmNxY9VsOPm58VedM11auwf8kvd3l10=; b=nFCUr8mh4qirfdLiF7rJ3ln4Ee ac3TZcBsBjTwt2v0sdIiovpLKYKyf84Jxe23adpiNL58TY/A6Un5jj6iESmOfBN+ NH3EgOLGaP2DQpO5LGujPp+1ACooTgAvYIJALYP/zB1DPOPdMHqcSl6pneGLIuSd 0k9KzYIWTlZUxiE5d/Z/VfhGrlYPtpIrvzzKaxh55J1YvHGR53svoOQw5rECchxc E9ikW19OkQ636itot1R2TSnpEFaS+eT+JgKKFsBgMEmk8BlUWkauiXR3Ls5Vvsp5 YZii5Qv8k/VvvLOAqjcoX8BsdOlRwRXYH9ceE7QjJGsmut+vnb/zrjODKYag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709628135; x=1709714535; bh=QeA3EPMJnwt6NmNxY9VsOPm58Ved M11auwf8kvd3l10=; b=MeGRT64EA+QDDWf22wqOrRSkQjCcngCXPFXQcuj7sKlb fsKykmy6Wo/2udr6Dj45/3j5m0Am1YNFMh5ogK0TGmfT3J3p1lUk5UkjwIxfJ/Ci Pk+CIVw/J74yah5SJbYvq+QLaOyKzQH6iNNSmcFd0y5fFCKb9E+Yfzt3yz+45LdK 9sFUcb6Fxl0Wjzf+1CiXDA/ghzeaVvr1VBLLs58vNnkiklddooZ4bWdiOUY+GqIR hy0uslWehpOhOdN1+n7zG5X3CplnE4+mdGGx1Yzro47d/GdIV8wduDcs4mOaIpqy CGRzWIXTXwbBC9s0rVJ0cHgCt/kyzi8t44pW07QIUA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheekgdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5045FB6008D; Tue, 5 Mar 2024 03:42:15 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-208-g3f1d79aedb-fm-20240301.002-g3f1d79ae Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: <20240305020153.2787423-13-almasrymina@google.com> References: <20240305020153.2787423-1-almasrymina@google.com> <20240305020153.2787423-13-almasrymina@google.com> Date: Tue, 05 Mar 2024 09:41:55 +0100 From: "Arnd Bergmann" To: "Mina Almasry" , Netdev , 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 , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "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" , "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Martin KaFai Lau" , "Eduard Zingerman" , "Song Liu" , "Yonghong Song" , "John Fastabend" , "KP Singh" , "Stanislav Fomichev" , "Hao Luo" , "Jiri Olsa" , "David Ahern" , "Willem de Bruijn" , shuah , "Sumit Semwal" , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pavel Begunkov" , "David Wei" , "Jason Gunthorpe" , "Yunsheng Lin" , "Shailend Chand" , "Harshitha Ramamurthy" , "Shakeel Butt" , "Jeroen de Borst" , "Praveen Kaligineedi" , "Willem de Bruijn" , "Kaiyuan Zhang" Subject: Re: [RFC PATCH net-next v6 12/15] tcp: RX path for devmem TCP Content-Type: text/plain On Tue, Mar 5, 2024, at 03:01, Mina Almasry wrote: > --- a/arch/alpha/include/uapi/asm/socket.h > +++ b/arch/alpha/include/uapi/asm/socket.h > #define SO_PEERPIDFD 77 > +#define SO_DEVMEM_LINEAR 79 > +#define SO_DEVMEM_DMABUF 80 > --- a/arch/mips/include/uapi/asm/socket.h > +++ b/arch/mips/include/uapi/asm/socket.h > #define SO_PEERPIDFD 77 > +#define SO_DEVMEM_LINEAR 79 > +#define SO_DEVMEM_DMABUF 80 > --- a/arch/parisc/include/uapi/asm/socket.h > +++ b/arch/parisc/include/uapi/asm/socket.h > #define SO_PEERPIDFD 0x404B > +#define SO_DEVMEM_LINEAR 98 > +#define SO_DEVMEM_DMABUF 99 > --- a/arch/sparc/include/uapi/asm/socket.h > +++ b/arch/sparc/include/uapi/asm/socket.h > #define SO_PEERPIDFD 0x0056 > +#define SO_DEVMEM_LINEAR 0x0058 > +#define SO_DEVMEM_DMABUF 0x0059 > --- a/include/uapi/asm-generic/socket.h > +++ b/include/uapi/asm-generic/socket.h > @@ -135,6 +135,11 @@ > #define SO_PEERPIDFD 77 > +#define SO_DEVMEM_LINEAR 98 > +#define SO_DEVMEM_DMABUF 99 These look inconsistent. I can see how you picked the alpha and mips numbers, but how did you come up with the generic and parisc ones? Can you follow the existing scheme instead? > diff --git a/include/uapi/linux/uio.h b/include/uapi/linux/uio.h > index 059b1a9147f4..ad92e37699da 100644 > --- a/include/uapi/linux/uio.h > +++ b/include/uapi/linux/uio.h > @@ -20,6 +20,16 @@ struct iovec > __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ > }; > > +struct dmabuf_cmsg { > + __u64 frag_offset; /* offset into the dmabuf where the frag starts. > + */ > + __u32 frag_size; /* size of the frag. */ > + __u32 frag_token; /* token representing this frag for > + * DEVMEM_DONTNEED. > + */ > + __u32 dmabuf_id; /* dmabuf id this frag belongs to. */ > +}; This structure requires a special compat handler to run x86-32 binaries on x86-64 because of the different alignment requirements. Any uapi-visible structures should be defined to avoid this and just have no holes in them. Maybe extend one of the __u32 members to __u64 or add another 32-bit padding field? Arnd