Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11146482rwd; Thu, 22 Jun 2023 09:15:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ezA7Uv2urB+6d2Vsp0GYG+L8D5CEhIVpD2XGy5odTc9Jqw5KqtQGU4S71bbKXTUaCUfMv X-Received: by 2002:a92:a308:0:b0:334:7796:f90c with SMTP id a8-20020a92a308000000b003347796f90cmr15924417ili.18.1687450548283; Thu, 22 Jun 2023 09:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687450548; cv=none; d=google.com; s=arc-20160816; b=OoZ0EqiyFqndwEYVK0yaFvUz3vDS0p65l6e3XcBTSTC3IbZvDXRx0U9sg7R3Xzj5xF TflMMWcGcxA7juusOypiZc0eV8A5upGPdEdnzemawdimJnEfnbqy/pAjhsGWHgIrcGy9 shnDUbHiT77hcMOR2/FWloOmAjvCVCk/JZGhm3NXqgGw1/Z7UvphcDPLuwxif0AtNpfQ 07MwA1h4U6z1qPKEeJ5duly8U1ueG0lv7BUIPq40IHsOpN2lFzqvoq/dOuPM23qwxKoX yT1xtUZnE+OY87Eok/VT4gNnFPaMLodfWS4IB7ZJLAH2+7AWg0tGNW+ZKFMuhu5T/De7 efVg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=a4ZeA3fCzpsP/weTyEHljBjdeImnc1sztgg04Zvr3Iw=; b=cp/bDJqfPGYv0qDRcrscMuLuFv0OnFtVwU1xv5NWR1gII9SEBWXt5K+2rWxZg0nj60 7+kcT5KsOTuOE18rMQJSXOAy1coKJEidGm+1xBXMYkJ0grL/tyveN0F/+8wruXGb5UoP QTNNyqWPUW83cbNCcTzR6ilL3DfwxwKohNaMo+jFPA9cGycJrpfepzjGbiENHzptErNS 3Xji5pzHju/paVyRbMlIIsKKAO26S/Nw1vk6wZ1e38qyx9ZR8JM3rkP9b1RKaGyZZC1d HiddJ6cbe3tPAXuj27R5cG1dQJK3jmsW27t+/EakxMjUMPNZzxc8zLLyYJM43dWnLYMC GgIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Msdee8Em; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a63de0a000000b0054405fa924fsi6641181pgg.891.2023.06.22.09.15.35; Thu, 22 Jun 2023 09:15:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Msdee8Em; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230407AbjFVQKO (ORCPT + 99 others); Thu, 22 Jun 2023 12:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjFVQKM (ORCPT ); Thu, 22 Jun 2023 12:10:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A1BD1BE3 for ; Thu, 22 Jun 2023 09:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687450160; 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: in-reply-to:in-reply-to:references:references; bh=a4ZeA3fCzpsP/weTyEHljBjdeImnc1sztgg04Zvr3Iw=; b=Msdee8EmuvB0ZZWdv7LsUTuMUwJiXXi3oipYi3Sq7/jyENoHMwOv6J5v3bg4Crhk+0FmuW ufN+us2jb/Dj9WwoaliwQxo2DwI3wuc+dCOPKPVZR9Jm5pUlzjFdgwXgQJF4VjbY3CvgNH CuZyEg9AZwJeu7PORCeKTU/DwES4ljg= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-_g3r1EqfNFiouZ4vCKB2vw-1; Thu, 22 Jun 2023 12:09:17 -0400 X-MC-Unique: _g3r1EqfNFiouZ4vCKB2vw-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b46bfa6710so48136751fa.1 for ; Thu, 22 Jun 2023 09:09:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687450156; x=1690042156; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=a4ZeA3fCzpsP/weTyEHljBjdeImnc1sztgg04Zvr3Iw=; b=Y79O/WL7N/qdSTDfYV185dWXNXEDnJs5yuIrbP126i34WLaKirjdFD/OpiqRvH8NZ+ A9h3a/JrKOT/L+oHqwVdMHDdAM1egc5ySxIBBkdypiRfkQCQw51eQwbVPar8m0+WPL0I HtZ1zTks8INL/Cnv+GdGI783TIf79Rq9KEl0MN4eR8zNpVuHUzOLxuBcnXpCpTtgZxRt ztRqnsABoqjAI8S3HTkbBnDoVz+U9l+rE8/zNFF/IC3BOJm9vfbyK9Yxcn4UUF3Fs+Ir OGr7hNEBXeXhT4A1lRh5qs+m12IzOMV3GNzHjDgvXhyOIEsj6It4iRgxyq8CqF4m0Gdr 5Ntg== X-Gm-Message-State: AC+VfDzfNQJUGgaPmo/+90tCcp1euQVDgP+pwlZ7vrzqO8J1qGZkQK/b TgmNI95YzWEVVjJ5VdhWUhQCF5f9c/3AF8dCb51OUGah0HY5wTbbJagKfYcXZikHjMbZ8hg/N8h 1tQZRT23hxVNYzk5e/hBqnH4D X-Received: by 2002:a2e:9a8e:0:b0:2b5:8cfd:5236 with SMTP id p14-20020a2e9a8e000000b002b58cfd5236mr2267185lji.17.1687450155866; Thu, 22 Jun 2023 09:09:15 -0700 (PDT) X-Received: by 2002:a2e:9a8e:0:b0:2b5:8cfd:5236 with SMTP id p14-20020a2e9a8e000000b002b58cfd5236mr2267154lji.17.1687450155518; Thu, 22 Jun 2023 09:09:15 -0700 (PDT) Received: from sgarzare-redhat (host-87-11-6-160.retail.telecomitalia.it. [87.11.6.160]) by smtp.gmail.com with ESMTPSA id f13-20020a1709067f8d00b0098d2f91c850sm1026234ejr.89.2023.06.22.09.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 09:09:14 -0700 (PDT) Date: Thu, 22 Jun 2023 18:09:12 +0200 From: Stefano Garzarella To: Arseniy Krasnov Cc: Bobby Eshleman , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers , Dan Carpenter , Simon Horman , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH RFC net-next v4 6/8] virtio/vsock: support dgrams Message-ID: References: <20230413-b4-vsock-dgram-v4-0-0cebbb2ae899@bytedance.com> <20230413-b4-vsock-dgram-v4-6-0cebbb2ae899@bytedance.com> <92b3a6df-ded3-6470-39d1-fe0939441abc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <92b3a6df-ded3-6470-39d1-fe0939441abc@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 11, 2023 at 11:49:02PM +0300, Arseniy Krasnov wrote: >Hello Bobby! > >On 10.06.2023 03:58, Bobby Eshleman wrote: >> This commit adds support for datagrams over virtio/vsock. >> >> Message boundaries are preserved on a per-skb and per-vq entry basis. > >I'm a little bit confused about the following case: let vhost sends 4097 bytes >datagram to the guest. Guest uses 4096 RX buffers in it's virtio queue, each >buffer has attached empty skb to it. Vhost places first 4096 bytes to the first >buffer of guests RX queue, and 1 last byte to the second buffer. Now IIUC guest >has two skb in it rx queue, and user in guest wants to read data - does it read >4097 bytes, while guest has two skb - 4096 bytes and 1 bytes? In seqpacket there is >special marker in header which shows where message ends, and how it works here? I think the main difference is that DGRAM is not connection-oriented, so we don't have a stream and we can't split the packet into 2 (maybe we could, but we have no guarantee that the second one for example will be not discarded because there is no space). So I think it is acceptable as a restriction to keep it simple. My only doubt is, should we make the RX buffer size configurable, instead of always using 4k? Thanks, Stefano