From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 3A00B22E40A for ; Wed, 15 Jan 2025 05:07:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736917663; cv=none; b=HjVhGvROt8JzppisWiORK0Q14eaB0iP5axVFY+bOYLAZyQKrNQE6nGfng9B1k+1NYVqCDVwqBhKDpJASIvYT7CAXZvHNrFuJ7Zy8JquQariqRPUBkfmpP+fa+0wkF1747BsRdbtg18DQ1F06Qru+fAVGdqmbIjUduxxV8El6+PY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736917663; c=relaxed/simple; bh=t4dXpTZmsRI2k2NZ4xiQUhN5dBPeJttIl5lhtigwHU8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ko0ykkN1hkZofWitJid9NxC4EsxQTNzzv5PTeX4hLAjtMTREFhQsNbE5e8OcVFnLnU1xsGZ1yaHg8kl7cvBIkzvqCw6MuUXDeDI+ImYwf/rahi5kowUmBaYGttOYM8dsUEEADQgqDnMqmI8gfg6adhjzqBfnSgjIFOciT/SM040= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=daynix.com; spf=pass smtp.mailfrom=daynix.com; dkim=pass (2048-bit key) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.b=ojNFcQ6q; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=daynix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=daynix.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.b="ojNFcQ6q" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2163bd70069so114563145ad.0 for ; Tue, 14 Jan 2025 21:07:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736917660; x=1737522460; 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=tJj2ax30G5cYMMuz85Qw6SCJDIZ/bbwOrDlSPLFGRgM=; b=ojNFcQ6qbQMsuh63BrZPD2cg5u7/AjaUXt9B7ekVeZhZM8dOXf3eAAuYd+TBljvKwK JtNVSsZSxxxJMsHDenuRv66Q+3LiW/CEFkGmFZ15GfcB1tGh258PdjinToYMY6fN5CT9 yLK/AIBtJTJJwU1XATwHLqPmqX6dv8V9mBOPQ6Rx1Sfri9vVUE/+dgN+cKHNzxg2ivhk m7ysgpWjGkfKAPQDfwx20th4mSNaYEPeGZwe/pPtPrlYgMFWu6FprvmzyPayoSWQys1k 2nGX8N5IF/6m1UIIXjlIlqdAOoj5xaQRHCPESiDfRHfQYqYL7WKNb6iJHI4t1rnWxhjb XD/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736917660; x=1737522460; 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=tJj2ax30G5cYMMuz85Qw6SCJDIZ/bbwOrDlSPLFGRgM=; b=GUyjQGDZxd+A8HWUBYXilpSaEEy/192r2ZNjYZGJm81R2tZtklchh15aa0RudZgtJb ZWOpAH4dEow9f8wTmdV8yIPoT5tF/Z2CLuGq8BzS7jksntK+an7Uk8XUAP/2V4cC9Kr0 v1pQDwDPLo1tYfig8BVZJR0gDuBjyrdkTb6z0R8WH81N1hTJm57tIuTrQp68VCHnqpEH 2DszSQWLLb6gqYCPBl5VSFDvBbpPKq+9n5obYVbAEP7EKJhj6/I1E5qIQBuD+Lr0weAK ys0+2Z0WpSaz9DVtMAIttmPHQLsRxccTX8evhOKfB8NvH3Mtp1s1A23BJtlAUDfAoELw YdaQ== X-Forwarded-Encrypted: i=1; AJvYcCVQLJ/w56t0UK2/6a77NB3TC0Ql/4fGaLc7y+9Mk6ZI7kI3JowdepPGQQsQTnLrI16ItqZGenw=@vger.kernel.org X-Gm-Message-State: AOJu0YwHIV4J3jLpy74iuMoUTSmSxhisABvJWeUmsVobyIuauVwX5652 5t1T94p0t6Fr6UcYA8CiTsaWciNxC0kUr+MwzHqJAAaEfcUOcOcsV8CBmU8d+CM= X-Gm-Gg: ASbGncsyBzpE3FJm7Oh6WwNYp5cGWsty9OsvgXjXpM7ATe28HUQXCts+djbMudHyam0 ygb71rrWRIFgbN6kgXc7kxq6JfmxGuLj5tCb1K5LxXQxZ29VbLgMhPnvcJZ0Osv+LSXqkCg1ucn FWq34ff02xDZx2YC0kNNch3NNpIgVHRFGSX7WGv1lxd4lmm61CB2hHqy8gWuW9kPxYI7KNqwO9e MHZpSAJVg+QFk4XPHx2AzWoYxIRGhFJ2SH9UpLE1VUqKrDFNxtsmSVqki68viLUlBA= X-Google-Smtp-Source: AGHT+IH85/A6RLxL+2rEhiloGI8TMEvrvGtTvROtv7Pjqakmsz8YgZ7ly7fq+kIggy8KHNzrf4rkjg== X-Received: by 2002:a17:902:ea0a:b0:216:3083:d03d with SMTP id d9443c01a7336-21a83ffc447mr470885135ad.44.1736917659024; Tue, 14 Jan 2025 21:07:39 -0800 (PST) Received: from [157.82.203.37] ([157.82.203.37]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f10e41csm73994625ad.11.2025.01.14.21.07.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 21:07:38 -0800 (PST) Message-ID: Date: Wed, 15 Jan 2025 14:07:32 +0900 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] tun: Set num_buffers for virtio 1.0 To: Jason Wang Cc: "Michael S. Tsirkin" , Jonathan Corbet , Willem de Bruijn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xuan Zhuo , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kselftest@vger.kernel.org, Yuri Benditovich , Andrew Melnychenko , Stephen Hemminger , gur.stavi@huawei.com, devel@daynix.com References: <20250109-tun-v2-0-388d7d5a287a@daynix.com> <20250109-tun-v2-3-388d7d5a287a@daynix.com> <20250110052246-mutt-send-email-mst@kernel.org> <2e015ee6-8a3b-43fb-b119-e1921139c74b@daynix.com> Content-Language: en-US From: Akihiko Odaki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025/01/13 12:04, Jason Wang wrote: > On Fri, Jan 10, 2025 at 7:12 PM Akihiko Odaki wrote: >> >> On 2025/01/10 19:23, Michael S. Tsirkin wrote: >>> On Fri, Jan 10, 2025 at 11:27:13AM +0800, Jason Wang wrote: >>>> On Thu, Jan 9, 2025 at 2:59 PM Akihiko Odaki wrote: >>>>> >>>>> The specification says the device MUST set num_buffers to 1 if >>>>> VIRTIO_NET_F_MRG_RXBUF has not been negotiated. >>>> >>>> Have we agreed on how to fix the spec or not? >>>> >>>> As I replied in the spec patch, if we just remove this "MUST", it >>>> looks like we are all fine? >>>> >>>> Thanks >>> >>> We should replace MUST with SHOULD but it is not all fine, >>> ignoring SHOULD is a quality of implementation issue. >>> > > So is this something that the driver should notice? > >> >> Should we really replace it? It would mean that a driver conformant with >> the current specification may not be compatible with a device conformant >> with the future specification. > > I don't get this. We are talking about devices and we want to relax so > it should compatibile. The problem is: 1) On the device side, the num_buffers can be left uninitialized due to bugs 2) On the driver side, the specification allows assuming the num_buffers is set to one. Relaxing the device requirement will replace "due to bugs" with "according to the specification" in 1). It still contradicts with 2) so does not fix compatibility. Instead, we should make the driver requirement stricter to change 2). That is what "[PATCH v3] virtio-net: Ignore num_buffers when unused" does: https://lore.kernel.org/r/20250110-reserved-v3-1-2ade0a5d2090@daynix.com > >> >> We are going to fix all implementations known to buggy (QEMU and Linux) >> anyway so I think it's just fine to leave that part of specification as is. > > I don't think we can fix it all. It essentially only requires storing 16 bits. There are details we need to work out, but it should be possible to fix. Regards, Akihiko Odaki