Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp293353pxj; Thu, 10 Jun 2021 00:27:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzseQa/M4Z0GigbdwZmMwpXhEM8wLG3Kyh6Su0Dt6VgDXVgg8I5mK1a0cK23N5iCEiJiTG X-Received: by 2002:a17:906:2612:: with SMTP id h18mr3222352ejc.417.1623310030732; Thu, 10 Jun 2021 00:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623310030; cv=none; d=google.com; s=arc-20160816; b=PiG7PiTv8+q80hswa5ptntMdL1mUGzJNwYa0GaJmmfMgFszvTP+3LMTlgVAp3QyGG3 OCjSAutRvTHm4h5IJ/yHtpz1TEBZPHoiRpbSquHXYHUoc+YtLYL5QCcnCFVsFbG1gJ4U 9AqEnSNsNv6yMt2lZDZR/65zocJv2JbFeGbMYRdhBg0xO3abrxcE2yUnZSGj6epG5Tq4 Ma23AeTVEqnd3CT6C/k0H828Wg2GWSCfYxVMrfp5CKAV9D7eI4mYMkMs24Txt6TvWaV1 mfGxejVqGDQfgMcHYRDzqejDroCPURSPNc+jPKG0ivpuqKmWfvwrV9iw1isynMfOBq8W Yvug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5tlPw+fNQnyyXsv0Z5PViUY/ZrTm7CI6pUHe7QloYKE=; b=qvp7s0+NQ9HUIQh5Mpzk+8iKvtzdp6n6o43qgISzJIX++AJcXB8WmuVK6wq93HT8W5 K46P7t5PrIqYL2/16rwPgn/JrUpH3vEEhQ5g/0oytbSnDVrkLRATGz8Urc3LP8n4JKqv k5cr+08TfrdRCChTYZz4CDRU/yUmEM16WKHdRSLTLYOpgRQoMPlOsTba6xO2dWA84vZA WT7iEtFwMY6TXJPLr2I36IVXAxhdOTYnAttC+ifgXYIQW3tFojliVeFMLCR2TwzruSdn Frvr78NqFkY3PYNUG14B3DMyjTqeL/f28lzdJfYGwS2H7g4jAMyut3EiEdM5o0U6BrQK S5SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EyW3fiK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz1si1686365ejc.257.2021.06.10.00.26.47; Thu, 10 Jun 2021 00:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EyW3fiK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbhFJH0X (ORCPT + 99 others); Thu, 10 Jun 2021 03:26:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56593 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230492AbhFJH0A (ORCPT ); Thu, 10 Jun 2021 03:26:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623309844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5tlPw+fNQnyyXsv0Z5PViUY/ZrTm7CI6pUHe7QloYKE=; b=EyW3fiK9gRqTF+M8k80TUrqwZZZkGl1HfU/RIEKeNjGVuF396XMBFa3S3upfIgtVO3lU/O ZexDTpgta9yTqkpanS3dPLV+atPokpyBE+zIPhIhsMwzu2F3Xg0ng2yywJhFtLzxxFQtfz IDxGXX5E1OYOp9VzQuVLLSxMmDbj/QY= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-rjIBf0XlO-aJNZOYpO23bg-1; Thu, 10 Jun 2021 03:24:02 -0400 X-MC-Unique: rjIBf0XlO-aJNZOYpO23bg-1 Received: by mail-ed1-f69.google.com with SMTP id df3-20020a05640230a3b029039179c0f290so12010980edb.13 for ; Thu, 10 Jun 2021 00:24:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=5tlPw+fNQnyyXsv0Z5PViUY/ZrTm7CI6pUHe7QloYKE=; b=P5pevUGXZIgMk0R9107+8WUXzGogVLmHcCz1elQKuePrJ52Q8MKzgy9YnlJLCjoY4s gDl+evU7uGYhO5l8PKTFLxr7YMi9bVoDgskHG2mKOvC7YjyUAHsO7tMeyPXWwiV+N4Gt ka4lGYtdiewqXDnzkz0PzGFj2EX3bFdNvIHP9p5zgGVrB4BN1cQAJfdmYa/O0+aoo3gY vS1+Au/jwwc9RjbArjamUs/VfUMRfTHxOuXq/+R5c9JMSpYVPUVy7Z+NV9KTWr+WnyT8 Fk4IE7jKbx3obBR5M16vltSl2+e/pJ5O1akNzJK1KXw5Y2iMUHh5tb445RrDz9YI/lzQ 9SVQ== X-Gm-Message-State: AOAM531zT4GsL+Fz1XiEK0gDeAUYqJgXfkjtYYwfKuCyBzGqT251hI1V q/seevEWqgmTgxIRLqa4Cl3CS35yuMwgX6FJyyvXDb/muX5ZPEyXxhNbha3DWiG3XL36FGkUtVq sBLYhj2o++gPAozt5AtqFhPE/ X-Received: by 2002:a05:6402:31a2:: with SMTP id dj2mr3327561edb.206.1623309841253; Thu, 10 Jun 2021 00:24:01 -0700 (PDT) X-Received: by 2002:a05:6402:31a2:: with SMTP id dj2mr3327543edb.206.1623309841108; Thu, 10 Jun 2021 00:24:01 -0700 (PDT) Received: from steredhat (host-79-18-148-79.retail.telecomitalia.it. [79.18.148.79]) by smtp.gmail.com with ESMTPSA id o21sm651992ejg.49.2021.06.10.00.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 00:24:00 -0700 (PDT) Date: Thu, 10 Jun 2021 09:23:58 +0200 From: Stefano Garzarella To: Jason Wang Cc: "Jiang Wang ." , virtualization@lists.linux-foundation.org, Stefan Hajnoczi , "Michael S. Tsirkin" , Arseny Krasnov , jhansen@vmware.comments, cong.wang@bytedance.com, Xiongchun Duan , Yongji Xie , =?utf-8?B?5p+056iz?= , "David S. Miller" , Jakub Kicinski , Steven Rostedt , Ingo Molnar , Colin Ian King , Jorgen Hansen , Andra Paraschiv , Norbert Slusarek , Lu Wei , Alexander Popov , kvm@vger.kernel.org, Networking , linux-kernel@vger.kernel.org Subject: Re: [RFC v1 0/6] virtio/vsock: introduce SOCK_DGRAM support Message-ID: <20210610072358.3fuvsahxec2sht4y@steredhat> References: <20210609232501.171257-1-jiang.wang@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 10, 2021 at 12:02:35PM +0800, Jason Wang wrote: > >在 2021/6/10 上午11:43, Jiang Wang . 写道: >>On Wed, Jun 9, 2021 at 6:51 PM Jason Wang wrote: >>> >>>在 2021/6/10 上午7:24, Jiang Wang 写道: >>>>This patchset implements support of SOCK_DGRAM for virtio >>>>transport. >>>> >>>>Datagram sockets are connectionless and unreliable. To avoid unfair contention >>>>with stream and other sockets, add two more virtqueues and >>>>a new feature bit to indicate if those two new queues exist or not. >>>> >>>>Dgram does not use the existing credit update mechanism for >>>>stream sockets. When sending from the guest/driver, sending packets >>>>synchronously, so the sender will get an error when the virtqueue is >>>>full. >>>>When sending from the host/device, send packets asynchronously >>>>because the descriptor memory belongs to the corresponding QEMU >>>>process. >>> >>>What's the use case for the datagram vsock? >>> >>One use case is for non critical info logging from the guest >>to the host, such as the performance data of some applications. > > >Anything that prevents you from using the stream socket? > > >> >>It can also be used to replace UDP communications between >>the guest and the host. > > >Any advantage for VSOCK in this case? Is it for performance (I guess >not since I don't exepct vsock will be faster). I think the general advantage to using vsock are for the guest agents that potentially don't need any configuration. > >An obvious drawback is that it breaks the migration. Using UDP you can >have a very rich features support from the kernel where vsock can't. > Thanks for bringing this up! What features does UDP support and datagram on vsock could not support? > >> >>>>The virtio spec patch is here: >>>>https://www.spinics.net/lists/linux-virtualization/msg50027.html >>> >>>Have a quick glance, I suggest to split mergeable rx buffer into an >>>separate patch. >>Sure. >> >>>But I think it's time to revisit the idea of unifying the virtio-net >>>and >>>virtio-vsock. Otherwise we're duplicating features and bugs. >>For mergeable rxbuf related code, I think a set of common helper >>functions can be used by both virtio-net and virtio-vsock. For other >>parts, that may not be very beneficial. I will think about more. >> >>If there is a previous email discussion about this topic, could you >>send me >>some links? I did a quick web search but did not find any related >>info. Thanks. > > >We had a lot: > >[1] >https://patchwork.kernel.org/project/kvm/patch/5BDFF537.3050806@huawei.com/ >[2] >https://lists.linuxfoundation.org/pipermail/virtualization/2018-November/039798.html >[3] https://www.lkml.org/lkml/2020/1/16/2043 > When I tried it, the biggest problem that blocked me were all the features strictly related to TCP/IP stack and ethernet devices that vsock device doesn't know how to handle: TSO, GSO, checksums, MAC, napi, xdp, min ethernet frame size, MTU, etc. So in my opinion to unify them is not so simple, because vsock is not really an ethernet device, but simply a socket. But I fully agree that we shouldn't duplicate functionality and code, so maybe we could find those common parts and create helpers to be used by both. Thanks, Stefano