From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 4F0B6209F57 for ; Fri, 10 Jan 2025 10:04:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736503456; cv=none; b=UNNUUkz1qc8EXUqzZ42XiKJrLooPSqB02JJAdJXTbsadnF/+GdFdzFzSp7gDVKZWfanoB0q4ZMGuYiEXJdhbwUoLYfJ3MS2BWpLN39g45r9PL9p3ulzEglmmwxRbKJaCscJoIWWwPp5DEBxyy0S6sSQIg5AieOJv3/FwGqbToQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736503456; c=relaxed/simple; bh=qNaQzpehQQCjP6U1Smo/Nd38XDFDvWBgAvAJl4KW8uA=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=rAwzCTpudlgcqiu+K5hXehj6cXbEPuRIayae0vXmOxlD0gdkbLvACb1EBfQpccLL3guiOy6MIip+J2g2QMGu/Bk3o0m+HW7C44aja3FGhPMSxF+4ZkrnhR6+ZSLBOtiwJwmV6GU1wm5+jhKZHCGuoWhyK1V50BkIUfqgRmGd1uY= 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=T430dLon; arc=none smtp.client-ip=209.85.214.169 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="T430dLon" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2165448243fso34243715ad.1 for ; Fri, 10 Jan 2025 02:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736503453; x=1737108253; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=SbCDbM8KQIXhK7Foj8Bp5mpZOBTNVuVCawxI33XikWY=; b=T430dLonjsSAlmOPpq7K62Twr27dL4/lXuDT+WU9UJck6NoShVeGAWEMj3/qYGuPUH 8mFqeyWqrs3KumgimS1EVzKIAbfut7Q6WFp3lbwPxwNIlQW+OXhm2kvjOrHKOSu6iqPI sz/FqNdIYJA4ikICrLBHVmtTbdwxQopPQElXiVYW7dAqXkWuZoKMx6Zw89YIS/Th91ce Ns0K96mE2Zn4xFfW4n87qUJX3hCp1Gib74kwWQA+fZkHc86483l3Pjv4ZrGuT8cAcCyA BBkYOpeD6sTng1k2vf1MDl18Lz3AF5XyU9d57Jr5VnFpopMkpnaVZ8zaYlzJEQ7HL9kX 0Lpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736503453; x=1737108253; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SbCDbM8KQIXhK7Foj8Bp5mpZOBTNVuVCawxI33XikWY=; b=NhuNT/XGFZ//6Hj7lPNQVrVlkxvHg12Dlzkjeq+creOE59+p5edfTKa9eotZcl9LOg qsTVDOSyWxuZnYjOzVvzZ8T+RJfcl7FSW3xMjn0EiCcL/4p3a3DKmglZJHsgbnlec6r6 jtRq2I7+W1VkGsv8w11p8pJcBnsWxghpcYnjgOR27gi3Jghiq80MnnMVOCxaUG71/zkW gULSUHI5eA0bi1VMSBBzUZ9aqBQeXjkoKt/w0kmkJIRNKlcDAvBaevHu/4og7ooXbCLH 2dW2w/nkMWjVcJsX/QDJfUB50M18LQifxKccYsR1zLO0K789W5H+ElSGuiY60XT7SvXO BGuA== X-Forwarded-Encrypted: i=1; AJvYcCUh8KrkMvxAT0iPv7anodOnOeALQpib8zZTffIUGcfwzGQ6QTbZwxNfML9/GLoNoaUN/qCruWItyAN1fqg=@vger.kernel.org X-Gm-Message-State: AOJu0YxF7KRZY2wEXQdyPzEVY/gq6UTojfsbuv4HPu6F4cegMiw/OCC2 UdCwMJD3+5A0IsEbnlnY++NSot1CYKliW9wpT8hpXSBJCjOgQl2Edd4atZ7lYDc= X-Gm-Gg: ASbGncuL3qLIXOgySLu/qjVXSNXmQir4UFctGsJVXVrQ0Jefdooj41lbJXROm9Sa75K JrTL+3YJDO0//+ys6+d14ebyAi3Cye41k9dkojglT1Cezhl8ZtwcaSAoW7BuipmEeRkeQTnv026 yuuQrZD9EIAwHNhqjbFy5fC5KCWgD8Jzat2Fbacpl9tBqm68OEXHDPyQz+jBuHOo0qzs1HZ77yw gMWQf9io0hx9/oG9fq1P3H0f+bQNlXdsItDl2rWgAKcNagIHhpmzSGGUHpZvYN3lKE= X-Google-Smtp-Source: AGHT+IGwGJ74ps/x/Eb/FXDjZwvLuJmQUxKHNbskjBfpmMO+fHvECFMcSxYPTjF3D4hGyGv0Hh3cVw== X-Received: by 2002:a05:6a00:179f:b0:72a:bc54:84f7 with SMTP id d2e1a72fcca58-72d21f4f2e5mr15271389b3a.12.1736503453610; Fri, 10 Jan 2025 02:04:13 -0800 (PST) Received: from [157.82.203.37] ([157.82.203.37]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72d4067e9e1sm1247468b3a.131.2025.01.10.02.04.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 02:04:13 -0800 (PST) Message-ID: <1f2908ed-e938-4365-8f1e-9f1c7753fb9b@daynix.com> Date: Fri, 10 Jan 2025 19:04:07 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Akihiko Odaki Subject: Re: [PATCH v2 3/3] tun: Set num_buffers for virtio 1.0 To: Jason Wang Cc: Jonathan Corbet , Willem de Bruijn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , 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> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025/01/10 12:27, 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? My understanding is that we should fix the kernel and QEMU instead. There may be some driver implementations that assumes num_buffers is 1 so the kernel and QEMU should be fixed to be compatible with such potential implementations. It is also possible to make future drivers with existing kernels and QEMU by ensuring they will not read num_buffers when VIRTIO_NET_F_MRG_RXBUF has not negotiated, and that's what "[PATCH v3] virtio-net: Ignore num_buffers when unused" does. https://lore.kernel.org/r/20250110-reserved-v3-1-2ade0a5d2090@daynix.com Regards, Akihiko Odaki