Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4488073rwb; Wed, 17 Aug 2022 00:17:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4MACptKHzxaOerZPolMoIpun33i2AfzS5N6c5gGz4mHD1RZHVqxdpoeY8Y5f+ISF6MaEMV X-Received: by 2002:a17:90b:390c:b0:1f7:314d:d46f with SMTP id ob12-20020a17090b390c00b001f7314dd46fmr2465446pjb.7.1660720638323; Wed, 17 Aug 2022 00:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660720638; cv=none; d=google.com; s=arc-20160816; b=ShM5bUTUI1zOrp2euY9a2KCIDXlqXzYzGhKCdxHbojgQyU7E1kwq8RnJqTvfyc6jRZ u3MaX+JmcZdSjB0ovxcwaIkSbX/g+BAMJZxunqXkR1oozVKYtOWqsMnhbwvUC5hFbSiF jZYpUjOLjeTHIIp3DP1l/ECZgi4uHr4aKmaPWvipLNt8pV//iyt8O/SZRxiY64X6WaGE QBJjYnJ6Q5R/cuHXb1mluwTC6Ml6LBSZmoDwXDxbS6WKnNhVd8SRe1vgj/W+KmKFxopq jrTQQUCWraFua6qdiif6i+P+jTalSy/4h8ew/tCtL7YfL0dVSJKA9KPeL6Cj6drLASAN HlQw== 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=zcPD4jBG73lQXOoH43Q6tPWaFdDfYRto/2dXXxDgwek=; b=Q6wN87Laoae8eDly7jgst2U3usDGgvzGISRA8wgTxaswAfwU4Aju+pbFla7DVP/pGl biICj81cmCIiYOZ7gf86gBeuRIZ5qBRUjgw5t3YvDOs8FOba0qX1dDJT67W7SUQg+l8a 98It6WxYDRQokDc6M4tzJUkyFy8F6jQtJjMMXIeUus/h3/8RqIB4MiDExFVrvHMdkgQU gQ5TEUeiH2ocjhlzYhe7Xgj5gBXaU7SSAdDjmiYPBoRwVG4Gq8CdYc89w5+5ecrfg4pn IFi9VPZpQubh7x9+COLFG3TR5u/oWVMGLf7Wv/9GAChPdeXLGhB+5UvyQlXbLL94kbhz lwsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zj2pAXsd; 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 j191-20020a638bc8000000b00420f9b67f13si15149726pge.231.2022.08.17.00.17.07; Wed, 17 Aug 2022 00:17:18 -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=Zj2pAXsd; 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 S230473AbiHQGyr (ORCPT + 99 others); Wed, 17 Aug 2022 02:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbiHQGyp (ORCPT ); Wed, 17 Aug 2022 02:54:45 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E06C25C948 for ; Tue, 16 Aug 2022 23:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660719282; 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=zcPD4jBG73lQXOoH43Q6tPWaFdDfYRto/2dXXxDgwek=; b=Zj2pAXsd4q69s+qQo6qi6ije2FgY75UDnmqKiMWMoFDh599/FBQeWmT/UAMK04B9pZnFxy i1L0GSP25ua2Qtuua4vq6+hcurd146GFHJnq5NGsYuziLH5/uq32SEHy0kEYLG2hAclIBh OaAXxEUqosw7AGgRjVQgSRllOBzaygo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-7-9iPhOHP9PVGPfs7qZM5t0A-1; Wed, 17 Aug 2022 02:54:40 -0400 X-MC-Unique: 9iPhOHP9PVGPfs7qZM5t0A-1 Received: by mail-wr1-f71.google.com with SMTP id g11-20020adfa48b000000b002250d091f76so1466517wrb.3 for ; Tue, 16 Aug 2022 23:54:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=zcPD4jBG73lQXOoH43Q6tPWaFdDfYRto/2dXXxDgwek=; b=vPSibVH9wYoFWTWTs202xkPsizc7bAGt2o3ths3P3rw6eZk2ED+5YMXL3RXQX3SxQ7 erCklMuKF4imlep4M4+o/RWy/f2MjEBWOVQABGFxAUaoxJugqwXDCkdeYWJwRSWjHOUs RY2kHMxmHC9m1opRVo6l8pK2b9eQwmhtlJGhYpRd1M/Ts3Oet+jGmWSgTYyop1d/Bqt3 W3Oro6XXbVyxe/Ccu/zjSq53k5Nltl/Ny+532FAA/agywTmo/UZpaaeNgymH6NfhYZii vNKYr6/JQjTD/myPwyt9FsaHbaEYhed7R79rJZ8JFBk5Jv3aCBVXLvA1RiD+lJsffPSX Pokg== X-Gm-Message-State: ACgBeo2E3YIhxCS3WtCV6KZx4CiOI1wBoeweeqihSQVn/yLVqUN+9jzp i3ZVv1V5hjFfe1Y42ONmQl0+MPy9haR9O8P+GpUlcuPFh3jo1QD1EZetUxAMDyKDfpoIZpYRZNo WkhUg+CHXxXsk4qgWofX34wzg X-Received: by 2002:adf:d1c9:0:b0:225:f98:d602 with SMTP id b9-20020adfd1c9000000b002250f98d602mr5595057wrd.419.1660719279679; Tue, 16 Aug 2022 23:54:39 -0700 (PDT) X-Received: by 2002:adf:d1c9:0:b0:225:f98:d602 with SMTP id b9-20020adfd1c9000000b002250f98d602mr5595029wrd.419.1660719279393; Tue, 16 Aug 2022 23:54:39 -0700 (PDT) Received: from redhat.com ([2.55.43.215]) by smtp.gmail.com with ESMTPSA id f14-20020a05600c154e00b003a32251c3f9sm1288244wmg.5.2022.08.16.23.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 23:54:38 -0700 (PDT) Date: Wed, 17 Aug 2022 02:54:33 -0400 From: "Michael S. Tsirkin" To: Bobby Eshleman Cc: Bobby Eshleman , Bobby Eshleman , Cong Wang , Jiang Wang , Stefan Hajnoczi , Stefano Garzarella , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH 0/6] virtio/vsock: introduce dgrams, sk_buff, and qdisc Message-ID: <20220817025250-mutt-send-email-mst@kernel.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, Aug 15, 2022 at 10:56:03AM -0700, Bobby Eshleman wrote: > Hey everybody, > > This series introduces datagrams, packet scheduling, and sk_buff usage > to virtio vsock. > > The usage of struct sk_buff benefits users by a) preparing vsock to use > other related systems that require sk_buff, such as sockmap and qdisc, > b) supporting basic congestion control via sock_alloc_send_skb, and c) > reducing copying when delivering packets to TAP. > > The socket layer no longer forces errors to be -ENOMEM, as typically > userspace expects -EAGAIN when the sk_sndbuf threshold is reached and > messages are being sent with option MSG_DONTWAIT. > > The datagram work is based off previous patches by Jiang Wang[1]. > > The introduction of datagrams creates a transport layer fairness issue > where datagrams may freely starve streams of queue access. This happens > because, unlike streams, datagrams lack the transactions necessary for > calculating credits and throttling. > > Previous proposals introduce changes to the spec to add an additional > virtqueue pair for datagrams[1]. Although this solution works, using > Linux's qdisc for packet scheduling leverages already existing systems, > avoids the need to change the virtio specification, and gives additional > capabilities. The usage of SFQ or fq_codel, for example, may solve the > transport layer starvation problem. It is easy to imagine other use > cases as well. For example, services of varying importance may be > assigned different priorities, and qdisc will apply appropriate > priority-based scheduling. By default, the system default pfifo qdisc is > used. The qdisc may be bypassed and legacy queuing is resumed by simply > setting the virtio-vsock%d network device to state DOWN. This technique > still allows vsock to work with zero-configuration. The basic question to answer then is this: with a net device qdisc etc in the picture, how is this different from virtio net then? Why do you still want to use vsock? > In summary, this series introduces these major changes to vsock: > > - virtio vsock supports datagrams > - virtio vsock uses struct sk_buff instead of virtio_vsock_pkt > - Because virtio vsock uses sk_buff, it also uses sock_alloc_send_skb, > which applies the throttling threshold sk_sndbuf. > - The vsock socket layer supports returning errors other than -ENOMEM. > - This is used to return -EAGAIN when the sk_sndbuf threshold is > reached. > - virtio vsock uses a net_device, through which qdisc may be used. > - qdisc allows scheduling policies to be applied to vsock flows. > - Some qdiscs, like SFQ, may allow vsock to avoid transport layer congestion. That is, > it may avoid datagrams from flooding out stream flows. The benefit > to this is that additional virtqueues are not needed for datagrams. > - The net_device and qdisc is bypassed by simply setting the > net_device state to DOWN. > > [1]: https://lore.kernel.org/all/20210914055440.3121004-1-jiang.wang@bytedance.com/ > > Bobby Eshleman (5): > vsock: replace virtio_vsock_pkt with sk_buff > vsock: return errors other than -ENOMEM to socket > vsock: add netdev to vhost/virtio vsock > virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit > virtio/vsock: add support for dgram > > Jiang Wang (1): > vsock_test: add tests for vsock dgram > > drivers/vhost/vsock.c | 238 ++++---- > include/linux/virtio_vsock.h | 73 ++- > include/net/af_vsock.h | 2 + > include/uapi/linux/virtio_vsock.h | 2 + > net/vmw_vsock/af_vsock.c | 30 +- > net/vmw_vsock/hyperv_transport.c | 2 +- > net/vmw_vsock/virtio_transport.c | 237 +++++--- > net/vmw_vsock/virtio_transport_common.c | 771 ++++++++++++++++-------- > net/vmw_vsock/vmci_transport.c | 9 +- > net/vmw_vsock/vsock_loopback.c | 51 +- > tools/testing/vsock/util.c | 105 ++++ > tools/testing/vsock/util.h | 4 + > tools/testing/vsock/vsock_test.c | 195 ++++++ > 13 files changed, 1176 insertions(+), 543 deletions(-) > > -- > 2.35.1