Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp186651pxj; Wed, 9 Jun 2021 20:46:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPgzX9kQVJkDXLx/QHqDclLPA7cLymJVdqlAKqkOH7UOzkgRUyomi3uiPXVcS8Ep5gom1q X-Received: by 2002:a05:6402:524b:: with SMTP id t11mr2609985edd.327.1623296799339; Wed, 09 Jun 2021 20:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623296799; cv=none; d=google.com; s=arc-20160816; b=b/uj4XfbUdMwY4Dbk4ouLDPK6zOClhB40PE7Iu+uN/HSYA1K8ME6bSroNt44/Y+Av+ 34E5g/4IgdCgT6AguOaXpZ6uTmwvK/zNw1xgcWWnHnoh/amshOUfkn+FAaMN33YCYoOt d64lwNgHC34Y3UDTnbgOOJ0lv1Qr9V0wpNYsLPfspMHN2U3zJnFMb7OCe6XYDw7yBdMr bGFgEaJVYklgqgnU5C0i3SkW50a59Ugc2Sg+hgW1eTFLLSYOGUDwMB/30zdpLEnOIujm ExAM9WPlOK5+kqL9sIA5Y1JQLtSeCvXx/8bfF8V9tqsupZsITL+GjSanWSaksxkRa50a kevg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=d/HsOChtoCYv2fZLAnHj+L8OfimOjEe4YM7F//2V4UM=; b=nhYkIa+7VDoocYOFBiSZW7HSQi8/Ef9Yc+EeGJKngLfAmpUkFfTm6bbqyEn5ezqzJr LmaRYAsa/a7uaOjv9jwNIUeOp61kEL6VoC7ZfvK6u9srkhAG4V4NT8V7VilhbkqB9BUL WJOM0mrZx5SJBA0r+6YzXvjaqV355Z/Yn2xOd0QKlVSZI5tDMkA5OPbMz42RPP38hMjY Z1XyOtuJnWu9ElYkvEALwZM33ujwQUIsKUVsvw9aIKllPYk17rQWIEgJZTa0dHx4ksmO /Orv04t2I7cwRkL1ypsa+JFOsjDDVUytJgHrUZrvwE1VRKzvWaoAQkr9wlH1QK7ckfMA 8xUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=Xh67DyPE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m29si1266091ejl.33.2021.06.09.20.46.15; Wed, 09 Jun 2021 20:46:39 -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=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=Xh67DyPE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229911AbhFJDqZ (ORCPT + 99 others); Wed, 9 Jun 2021 23:46:25 -0400 Received: from mail-ot1-f45.google.com ([209.85.210.45]:43849 "EHLO mail-ot1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbhFJDqY (ORCPT ); Wed, 9 Jun 2021 23:46:24 -0400 Received: by mail-ot1-f45.google.com with SMTP id i12-20020a05683033ecb02903346fa0f74dso26121524otu.10 for ; Wed, 09 Jun 2021 20:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=d/HsOChtoCYv2fZLAnHj+L8OfimOjEe4YM7F//2V4UM=; b=Xh67DyPE6Dr/kBZT1T6WHVHNDgnklob0hvRge79XgS3dUfpC+iqe3geJA0EJxO4kzK Ot37b8Pulgxw5XN5Fa6KGf7GYNhkyGy+9RcqdrLjnpbSuIDFQPEbKb0Xf44MrNP1zLm2 WrWY3RAEWZtR0mQ87N4jnbpzkvSxN3+BHFZgazaGKzsNdaOKZFiEScjc0GExA2l5UsJ4 F0wFDYmOkxIRvWpAt2j18370FgzP+3AndnwDqjm1R/xH7PG3XDpFClhwRA5bo5+vnqTl HWjnxbrNmbjoFG/D0xBPsqZ+n+UakseIticWoF9S9UcgMHc0R+YVxkD8cqlRd/7fe3CB Zt2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=d/HsOChtoCYv2fZLAnHj+L8OfimOjEe4YM7F//2V4UM=; b=IKH2WY4P5vCJaduueMmzE1bQY4uDl7NW2eYA5wJRGwvaqxogIWrBukovn8z8g6z/sh tX2sZ+DVzviBAWkLXlVX9sVsDYGtdu2GHF4jU3JrNS1KilBOcp4dwO+A62Q8s3CiOub2 rDf8da06j/Nr4YkACsGowtJhsnaJsF1zOfbz2z0QehfwLHYCbJCvsWSpsZyumuJExEoA OHUakG6MW3OtaLIVTadRtzSYkB46046bkGlpQZBR4J51qE9RBLyJuIFMD78S6qrW8jcR XH6cAeUsdz7XBlT1F8TBHw0pfLM7wWenTgwxwdc6T4rB3bbfJw/L23vrJlMxs4qWb3ss t8yg== X-Gm-Message-State: AOAM5302r7KxSyW+lrmLV7OfC75/IRON9KTOM79DnTdraJzJ/Jy1RqfW qnVbsTlubt2qrIT/h7RV2Hyi38E4q3rEPvAhw6EKoQ== X-Received: by 2002:a9d:711c:: with SMTP id n28mr704194otj.180.1623296592541; Wed, 09 Jun 2021 20:43:12 -0700 (PDT) MIME-Version: 1.0 References: <20210609232501.171257-1-jiang.wang@bytedance.com> In-Reply-To: From: "Jiang Wang ." Date: Wed, 9 Jun 2021 20:43:01 -0700 Message-ID: Subject: Re: Re: [RFC v1 0/6] virtio/vsock: introduce SOCK_DGRAM support To: Jason Wang Cc: Stefano Garzarella , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 9, 2021 at 6:51 PM Jason Wang wrote: > > > =E5=9C=A8 2021/6/10 =E4=B8=8A=E5=8D=887:24, Jiang Wang =E5=86=99=E9=81=93= : > > This patchset implements support of SOCK_DGRAM for virtio > > transport. > > > > Datagram sockets are connectionless and unreliable. To avoid unfair con= tention > > 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 fu= ll. > > 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. It can also be used to replace UDP communications between the guest and the host. > > > > 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. > Thanks > > > > > > For those who prefer git repo, here is the link for the linux kernel=EF= =BC=9A > > https://github.com/Jiang1155/linux/tree/vsock-dgram-v1 > > > > qemu patch link: > > https://github.com/Jiang1155/qemu/tree/vsock-dgram-v1 > > > > > > To do: > > 1. use skb when receiving packets > > 2. support multiple transport > > 3. support mergeable rx buffer > > > > > > Jiang Wang (6): > > virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit > > virtio/vsock: add support for virtio datagram > > vhost/vsock: add support for vhost dgram. > > vsock_test: add tests for vsock dgram > > vhost/vsock: add kconfig for vhost dgram support > > virtio/vsock: add sysfs for rx buf len for dgram > > > > drivers/vhost/Kconfig | 8 + > > drivers/vhost/vsock.c | 207 ++++++++-- > > include/linux/virtio_vsock.h | 9 + > > include/net/af_vsock.h | 1 + > > .../trace/events/vsock_virtio_transport_common.h | 5 +- > > include/uapi/linux/virtio_vsock.h | 4 + > > net/vmw_vsock/af_vsock.c | 12 + > > net/vmw_vsock/virtio_transport.c | 433 ++++++++++++= ++++++--- > > net/vmw_vsock/virtio_transport_common.c | 184 ++++++++- > > tools/testing/vsock/util.c | 105 +++++ > > tools/testing/vsock/util.h | 4 + > > tools/testing/vsock/vsock_test.c | 195 ++++++++++ > > 12 files changed, 1070 insertions(+), 97 deletions(-) > > >