Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3825019rdb; Thu, 28 Dec 2023 00:46:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQ8sBJpwRnlHLaKryaYOfmwc+WHFj28N7yTiJD1XBweAKKv+O5MxZ5beVRvfQqqm9qeyEF X-Received: by 2002:a50:d797:0:b0:553:903a:5db with SMTP id w23-20020a50d797000000b00553903a05dbmr5666186edi.44.1703753179673; Thu, 28 Dec 2023 00:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703753179; cv=none; d=google.com; s=arc-20160816; b=NP0q/AVUEQtEUf8qfTB/iFHIopaFg7MRQQ0vRWjWwDRYv5A+yOVuJsxmvzXaOHVOWf ntWTFKlp0U7MmQxvKhujaBCO8jJYrFY7m4LUxojdZgcDPhCgQ8JJGpkcY0sX6gntQWhN CtIJvuW8AJDxayeSRcfMJUGfwi4oNhZ/4GsmscgWkAjnKyNiZREzbj7mTkcC2y0tZcvD y3hSrRvNU7B76u6rmDppo7GE35pUnyDLWwuahBYXHEM2+ktBbM9nbPxVQvEypLWyauLc aL4mXa49C3xQthJOywcFIJVVfuLNzcS1QyNp5/D8BXDKXusGEEMqSk9gNiS1orFZ6+od V6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:autocrypt :from:references:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=rqeJyEjTmGDUYjyv1iKG4a3pQTlRk+dfQMFHSoB7zGs=; fh=13yeMmD/wK4gtPvE04gM4Q3/dT/qs6oFQCDFft5FvWY=; b=Y447cYQ8to4GxBxJ2OJ18yKQ4L4135XyaR7H2ReFShpm0TOLdC6LajJdcoSXhlp5Xo v33o/br7TLJ2DspD2MYXn6Sb2cYPgcApo/kaVnr6yrLufIo3eU1ptetwo3KqrGFcXYG9 eQsdFBACCcKf/vzSgVca+dm8fkYMSJ3MSTDeF6j4NjPyR7egNfUvHbbnFUAhwYcDMtQC La3MdJRdVkSm3fo/CkjqgpCrMQyxtrrTQCZy8tr+GoomkcA/KHFJ0AdFYMhNNBGr2OAS MU1NzUE95J1aWg4Wc+C3pP/NUejg3JAl8bspKvagjWPDBcKC5oEr0HSAIJpPVUx6ouOp kbzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=aNzKnepD; spf=pass (google.com: domain of linux-kernel+bounces-12524-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12524-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h3-20020a056402280300b0054c90700948si7005898ede.321.2023.12.28.00.46.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 00:46:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12524-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=aNzKnepD; spf=pass (google.com: domain of linux-kernel+bounces-12524-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12524-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3A0061F21F52 for ; Thu, 28 Dec 2023 08:46:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8920863C5; Thu, 28 Dec 2023 08:46:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b="aNzKnepD" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 4B1A85671; Thu, 28 Dec 2023 08:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1703753163; x=1704357963; i=deller@gmx.de; bh=fJqDTgVLl8Hra1HS/8kXEcwI5ggM5ehurfeNCFKVkRo=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=aNzKnepDp5ls3Dlaq4KAWwhDHXutRqzTKOnJ49xVn71GkXf3oc1jTB1ylj8kWuUa pAMErwiRW/SXyry7u3mA/FDpz0RhRcPDrl+Uogil24o1SO4Wv2xLKCGCL5Svd7MTv IDo/iWwVdYlEmwFUceYQdlyAbRtMYl3ZMMZAbJc3o6T0jjGegK8AJfYa6XXxjNgBm tvvSpCG48lQzgXMNg1QXQHJXoVzb9lntmvBslAlwCigbiYJYzEoRIER2QWyPcabHO W/Ofgytsh78I0miKscfc8ft6X1MTug4upeU9O3ZnuKwkSsRobHaI3bXESMx2vDrQG rVWOnEyPvJdgnu6OFA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.55] ([94.134.144.42]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Md6Qr-1qjzNA2EYV-00aEW9; Thu, 28 Dec 2023 09:46:03 +0100 Message-ID: <5585dee0-452e-48e1-8fae-bab1eccc8e97@gmx.de> Date: Thu, 28 Dec 2023 09:46:03 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH net-next v5 12/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags Content-Language: en-US To: Mina Almasry , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org References: <20231218024024.3516870-1-almasrymina@google.com> <20231218024024.3516870-13-almasrymina@google.com> From: Helge Deller Autocrypt: addr=deller@gmx.de; keydata= xsFNBF3Ia3MBEAD3nmWzMgQByYAWnb9cNqspnkb2GLVKzhoH2QD4eRpyDLA/3smlClbeKkWT HLnjgkbPFDmcmCz5V0Wv1mKYRClAHPCIBIJgyICqqUZo2qGmKstUx3pFAiztlXBANpRECgwJ r+8w6mkccOM9GhoPU0vMaD/UVJcJQzvrxVHO8EHS36aUkjKd6cOpdVbCt3qx8cEhCmaFEO6u CL+k5AZQoABbFQEBocZE1/lSYzaHkcHrjn4cQjc3CffXnUVYwlo8EYOtAHgMDC39s9a7S90L 69l6G73lYBD/Br5lnDPlG6dKfGFZZpQ1h8/x+Qz366Ojfq9MuuRJg7ZQpe6foiOtqwKym/zV dVvSdOOc5sHSpfwu5+BVAAyBd6hw4NddlAQUjHSRs3zJ9OfrEx2d3mIfXZ7+pMhZ7qX0Axlq Lq+B5cfLpzkPAgKn11tfXFxP+hcPHIts0bnDz4EEp+HraW+oRCH2m57Y9zhcJTOJaLw4YpTY GRUlF076vZ2Hz/xMEvIJddRGId7UXZgH9a32NDf+BUjWEZvFt1wFSW1r7zb7oGCwZMy2LI/G aHQv/N0NeFMd28z+deyxd0k1CGefHJuJcOJDVtcE1rGQ43aDhWSpXvXKDj42vFD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P89JymGE8CBGdQaAXnqYK3/yWf FwRDcGV6nxanxZGKEkSHHOm8jHwvQWvPP73pvuPBEPtKGLzbgd7OOcGZWtq2hNC6cRtsRdDx 4TAGMCz4j238m+2mdbdhRh3iBnWT5yPFfnv/2IjFAk+sdix1Mrr+LIDF++kiekeq0yUpDdc4 ExBy2xf6dd+tuFFBp3/VDN4U0UfG4QJ2fg19zE5Z8dS4jGIbLg== In-Reply-To: <20231218024024.3516870-13-almasrymina@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:1CJx57+OhafBv9nyT31t7uQ69mk+ew1K2kNcH6rFX0c45RB+gGy ufI14Cm8vmaThhO5jaxQvDyvLAWtFiQlfaHTcJS4nB8lOMjTcvgmDuzQaGlOkq7toMFGuct zqbYviNagfmrU856z6PHOnBOrCw7DcXKPftPJzyBf4M7avOEBNEWpfWrIhkttSBq8A8JxQe pFg22iUZNQcuQ678QWpIQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:HAEGlgqLqvw=;Yc26w74KRUPPguj5A2LYqQ7u48p AIRjX4iaj5Zy5fGQdeKRRAXNq1BzQBE8eWh8LR17/DePFZYNObhlvCC2mj69r2eWwhQzanlAa +HELes4lt6c5hBk9++z9KyTJ0D5caZtqAKEQqFVuHeDeVUFxpHo0xMHLWrbRyMUPJhK5vs4Ap Tmy1e96VS6DceBVpyW7SAeAyvDm6u6bocgKNzq0MMpXIqJPzmrfXvvOWq5/lsYDZbmXtI4r/+ 2DG1q/szvVou+nH10738+CenehQy7MiK+5xGjN84awqsJeoNnS890LBBRCSnAvLAdRmjk8yHD RYIYpFoWAfFMRQOW4NmyL3zLgyak9RpBRGRzJnvwY40RKKEw3YwbWQUgl5XnEk0JNk2TNRtH8 VekeA/M5ZClF++YakLgeUXDibg9geldaxLup0Y9x/1K6rsLEhwy9ieFn6CpX6mZBiKLy5uW74 H2Txk883FAJRtHZSXWEd3iHpPWqAoa4Su7qDq7vJvNAj4Tv7Awc9jDWBiuWVayJ64xH70qWZe AqZrvflNzwT+4wXK73E6/+SE2T/DAVgQ7J9wJTZBBa6utPMm9HLRuU28cpJXiLzFNMIPBRfMe 2FtEI8SYYcIABHoswAtAxAOSfiou83RHk063MZ5jL11uuWUjjDGKIRv+yZ1j3xCwRtyVFNsRG Rd0COP10AReF2n7kdcP+N9/E3UqtFiSkagtHyagv5YQa38u6s7PVdnHVT4yhJ4rNNoG4RTWrX 6JKDlwrRP6W9iLHIsA+Pe+BIAsTKuAnhEcUXzpvQ2RquJh7dcyxbgAn3OQ9ChWoRzbbqZTQb8 aijPpoTGHulP2ayJtISjOgekfa+2QVI+T3bgqBWVoBTVOmBLpUe8S3GJbU4gGRjwnZbnYQxC0 UkvP22uqsQwqKw04noJG/vDXKWa3eX269Mc0bbBF4RxlekL6pMAyd2PVTBzz7xERAhvsC5+gW 1jjbhBMKEIBr2tQ0+ORZwiHN/nE= Hi Mina, On 12/18/23 03:40, Mina Almasry wrote: > Add an interface for the user to notify the kernel that it is done > reading the devmem dmabuf frags returned as cmsg. The kernel will > drop the reference on the frags to make them available for re-use. > > Signed-off-by: Willem de Bruijn > Signed-off-by: Kaiyuan Zhang > Signed-off-by: Mina Almasry > > --- > > Changes in v1: > - devmemtoken -> dmabuf_token (David). > - Use napi_pp_put_page() for refcounting (Yunsheng). > - Fix build error with missing socket options on other asms. > > --- > arch/alpha/include/uapi/asm/socket.h | 8 ++++- > arch/mips/include/uapi/asm/socket.h | 6 ++++ > arch/parisc/include/uapi/asm/socket.h | 6 ++++ > arch/sparc/include/uapi/asm/socket.h | 6 ++++ > include/uapi/asm-generic/socket.h | 1 + > include/uapi/linux/uio.h | 4 +++ > net/core/sock.c | 45 +++++++++++++++++++++++++++ > 7 files changed, 75 insertions(+), 1 deletion(-) > ... > diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include= /uapi/asm/socket.h > index be264c2b1a11..6b8674399363 100644 > --- a/arch/parisc/include/uapi/asm/socket.h > +++ b/arch/parisc/include/uapi/asm/socket.h > @@ -132,6 +132,12 @@ > #define SO_PASSPIDFD 0x404A > #define SO_PEERPIDFD 0x404B > > +#define SO_DEVMEM_DONTNEED 0x404C > +#define SO_DEVMEM_LINEAR 0x404D > +#define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR > +#define SO_DEVMEM_DMABUF 0x404E > +#define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF Could you please change this ^^ for parisc to use the same constants as the generic version below (97-99). Although 0x404c is the logical successor, I'd prefer to be in sync with other generic code if possible... Thanks! Helge ... > diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generi= c/socket.h > index 25a2f5255f52..1acb77780f10 100644 > --- a/include/uapi/asm-generic/socket.h > +++ b/include/uapi/asm-generic/socket.h > @@ -135,6 +135,7 @@ > #define SO_PASSPIDFD 76 > #define SO_PEERPIDFD 77 > > +#define SO_DEVMEM_DONTNEED 97 > #define SO_DEVMEM_LINEAR 98 > #define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR > #define SO_DEVMEM_DMABUF 99