From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB9F7C47094 for ; Thu, 10 Jun 2021 03:43:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA01B61407 for ; Thu, 10 Jun 2021 03:43:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229778AbhFJDpU (ORCPT ); Wed, 9 Jun 2021 23:45:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbhFJDpT (ORCPT ); Wed, 9 Jun 2021 23:45:19 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BC3AC061574 for ; Wed, 9 Jun 2021 20:43:13 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id v27-20020a056830091bb02903cd67d40070so23081387ott.1 for ; Wed, 09 Jun 2021 20:43:13 -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=DrU54z1Nzh/lKAzpfNJO/DdoaKcQ9gG4Vm2rUew/asonrxY5fv06jQOyzoP2CRKPQI 7v1o+Q8+7oaCOLtXR2Ijcu1xx631vxB0fN8ivgDcMJVj7o8RJxHPHXCIPMoD1LBKZAr+ E5Onv2JrsrHd6EflFD2uYDMuB1A5+8faAHb0A+5ZCTX7R3OfSRLSd5lYUjpfYuC90XH+ D03A9sEB60l/brpjfQdZMXWgorkJchZPnwp2pR/DIfkSJ+iVjEdadwC5KrC2lsW/SFBG mLsWdQQP9wfgRFCTBKGcpyBdU5lEYK0cvTu0bbB+H+zXMLlYq7FEj4K/guO4m/JxDfOr nFDw== X-Gm-Message-State: AOAM5329uR69lRigFfaYCvkjcVNIivMihmeT30ASlGcy/8T/9G3rF92s zc2WaSeyrHK82WY5eBHD3SLSAvF22zJgw499TuJxKg== X-Google-Smtp-Source: ABdhPJwaI7pY5h+Lp2iauvfmhJT8Zg+jqsNfguAo720I85KWBapKSLe5j38W7lEBj40rsZP877aszFSAKUNQM7jHv0A= 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: kvm@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(-) > > >