From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D4461DE3D9; Tue, 22 Apr 2025 18:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745345989; cv=none; b=tfyVdJWp4TU9/UifsfyZBu+KYkG/Npd3U5ElhsbnI3g02SLbyLxN1szcMmXAq4YDtUtsT1mxFVN204C/1JZFHHcKEZgLa9r6ICeNglEmQN0LYlTxghR8UrkyH8SBS06y91Z4DBalcZlj5qNMS84hO931QOBzesUtVjQrLHAi1Ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745345989; c=relaxed/simple; bh=8wYCXgZqpbTDarUW031W7MRIpH1sLDyCBxxD/Ri5fVI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SvjIBfT0r70IrK53zYIB3mj1zPNkZ+xQI2flM3Pqqu5c6G8o+teNkogr18wsueL37pDTsRnbLW7IPl7ad7ium3LSk5OqPRfA62txIcTyO1rcexfGRBTNQuQrIGGK4nbeP/ucMeQz1z6wZ25m/rOzdEHmdOnZqKhSRDjo2fHukxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fFI41pZM; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fFI41pZM" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-39c30d9085aso4112410f8f.1; Tue, 22 Apr 2025 11:19:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745345986; x=1745950786; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=V4wU0CuSU6YOeYRo+NJ/4ERb7AGDM75DMO3ccWS5aBc=; b=fFI41pZMhvq9311eYU4XvdZK2X1BiSZ1kDpnO5pI2gDW8zfhCC0yLORqDWQm+cVbwV 4FBBoAquFYU8e3xZWbSfYXS6qHEPNsmdaCoGa/Saj9W1n2npjclApBTCMcHB3jfZBN0d VWb+DIdeQmgAcXdSDiX3XGPUq2jHa5OiEnzNItTNmj2AehqvZYog1cGUEhyETtmlywch 59SzQn9A8hoTCNX7njFf8HsC7FOGJKj9BMehhy+yesUQtbMYDouPVeB+Bjymw01lj9+P qwkZVntm+FXp6RFLVWmwYDPFGL3RyWiXPbEfxy0XrcCPjMxLAgSpIYjNHSJcPdmJccqB j+aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745345986; x=1745950786; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=V4wU0CuSU6YOeYRo+NJ/4ERb7AGDM75DMO3ccWS5aBc=; b=nG5GkK3X1xxyvWyRJ5BdeDKu/Cwd27DAf5JB457CiekWUmTAju3b+LV64z4s2bql+h F1XlVWraXqz5XjWmxc+Mc/78ktXfLCrtRn8rpxVCBILUZ1eq57q3C6Akpk9pq8uJvMDP q17h3yDyIUHS0/8QJR+Ka/u6T3B0sNNkZ7vRmJxm4Faos4FCdi/uG0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egib1N9teF DQ/xifZq+TbRiPVKbE1ThvlzTQhVoVBDbVf5jLsEY9m+6E77 X-Google-Smtp-Source: AGHT+IGsGcBMmgVltHKkfzj/5mF0Ny9f6RgMByhyMlB833FKD6rDdwvWOUJDBJsAjsbBce/iJtRETg== X-Received: by 2002:a5d:584e:0:b0:39c:140c:25e with SMTP id ffacd0b85a97d-39efba560b1mr12910171f8f.24.1745345986104; Tue, 22 Apr 2025 11:19:46 -0700 (PDT) Received: from [192.168.8.100] ([85.255.235.90]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39efa42082csm15911065f8f.3.2025.04.22.11.19.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Apr 2025 11:19:45 -0700 (PDT) Message-ID: <957b74ed-f29c-4bb8-b819-af4e1168d6c1@gmail.com> Date: Tue, 22 Apr 2025 19:20:59 +0100 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v9 2/9] net: add get_netmem/put_netmem support To: Mina Almasry Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, io-uring@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter , Jonathan Corbet , Andrew Lunn , Jeroen de Borst , Harshitha Ramamurthy , Kuniyuki Iwashima , Willem de Bruijn , Jens Axboe , David Ahern , Neal Cardwell , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , Stefan Hajnoczi , Stefano Garzarella , Shuah Khan , sdf@fomichev.me, dw@davidwei.uk, Jamal Hadi Salim , Victor Nogueira , Pedro Tammela , Samiullah Khawaja References: <20250417231540.2780723-1-almasrymina@google.com> <20250417231540.2780723-3-almasrymina@google.com> <484ecaad-56de-4c0d-b7fa-a3337557b0bf@gmail.com> Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/22/25 14:56, Mina Almasry wrote: > On Tue, Apr 22, 2025 at 1:43 AM Pavel Begunkov wrote: >> >> On 4/18/25 00:15, Mina Almasry wrote: >>> Currently net_iovs support only pp ref counts, and do not support a >>> page ref equivalent. >> >> Makes me wonder why it's needed. In theory, nobody should ever be >> taking page references without going through struct ubuf_info >> handling first, all in kernel users of these pages should always >> be paired with ubuf_info, as it's user memory, it's not stable, >> and without ubuf_info the user is allowed to overwrite it. >> > > The concern about the stability of the from-userspace data is already > called out in the MSG_ZEROCOPY documentation that we're piggybacking > devmem TX onto: Sure, I didn't object that. There is no problem as long as the ubuf_info semantics is followed, which by extension mean that any ref manipulation should already be gated on ubuf_info, and there should be no need in changing generic paths. -- Pavel Begunkov