Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4202884rwb; Tue, 6 Sep 2022 04:18:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR7m6uIRDykHv1/Uvl9qgP+DhukEKyC3820I94e05WNQ34TuMtZy8ZIuni1XDcDBcQ68NZv5 X-Received: by 2002:a17:907:2cd1:b0:730:a980:d593 with SMTP id hg17-20020a1709072cd100b00730a980d593mr38932845ejc.48.1662463094447; Tue, 06 Sep 2022 04:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662463094; cv=none; d=google.com; s=arc-20160816; b=BxOnFwexPezidEFzAgcWrGzsoQBb4KtPW8rOxyApgRfYHuqSUB/VF8aAPrrlkSETHY OhHcwt6QImCHQgD3tXiP8Fhra7hZnVBV/XRDGoMllBWNm6rrtdox0cnfEwmMDSQ5nXdJ CpwM1TceHLFylLKxzJOd5odVMPeTNZZPNOrwibAPttvZDXCQDn/R1L1/j0QTVMgbV+2D 2GsgUQC8vty3Lv0wbJqV9UV8xbXoIMrb8d7j90whpAz5AeDYhhoY9ZCS6npIB+8/yfPe LdrMcM9w+C7O77Alqjg3hOVVJXUKSjblH8JN7qD4ts5mvt0jPuWxWuho7YhhWulyIRCq yJWw== 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=+0i0KE3XTFGMOugy8WjJQSlLzmOSM4MIpTEpD6UmFME=; b=B/r4xadJlpCUaVXKHaGwFJtLsgpf7z3PLzeSzvEKM2pp5HmH6x7KJJjsl5LG8uK/l0 wtzL3pUP72Q9wYPAp3fE+He2N2Ho3zn8O/bkScgoYdFuXo126sEHFeHwdxvPACr/yYE2 KkEqsMhbJOipJj33j6qr56XiX3/OVmaCKGY2nhbzQehscybeG5lochFvADX6CZRXZ7J0 9XVuR/tzDfUqJ+ZamyKxq44hCP9JRY6gPp3yGlyxGc1gS04u1X5LkxUmsuIJJlbn8xf2 ls+cRLJbMMc8NGyHEL9NgWQzIAtjPSkB+YmlDHgAR67YDgXf627I2f66hT+wnJaO5UkD JwkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gSrUwFEB; 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 y4-20020a056402358400b004486d90c931si11049546edc.49.2022.09.06.04.17.47; Tue, 06 Sep 2022 04:18:14 -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=gSrUwFEB; 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 S239722AbiIFK67 (ORCPT + 99 others); Tue, 6 Sep 2022 06:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239797AbiIFK6m (ORCPT ); Tue, 6 Sep 2022 06:58:42 -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 B8926719B3 for ; Tue, 6 Sep 2022 03:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662461921; 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=+0i0KE3XTFGMOugy8WjJQSlLzmOSM4MIpTEpD6UmFME=; b=gSrUwFEBBTrDc9aCguOMISLuD4DZf60X2SSczrYPSdKItLDquDnhigVuCdWgMXM45D51DM LTcP6BErO9fGqYMzWlIQyK0R9IbnU1lgef6yEQGMKZMZXCrXCfDxrO7zY3L1ugixczikhg 3ZaOBpfHJ4aXhAlAsponNYB2pDjnrKg= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-460-ZPyXf5zHNsWJTk7cpmiB2w-1; Tue, 06 Sep 2022 06:58:40 -0400 X-MC-Unique: ZPyXf5zHNsWJTk7cpmiB2w-1 Received: by mail-ed1-f72.google.com with SMTP id c14-20020a05640227ce00b0043e5df12e2cso7422498ede.15 for ; Tue, 06 Sep 2022 03:58:39 -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:subject:date; bh=+0i0KE3XTFGMOugy8WjJQSlLzmOSM4MIpTEpD6UmFME=; b=4MlnyycdDck2BGgvHa20HdkMWZ8NHCj9BZ2XEt/Fygi4f5LRj1UplsbnCnj64greqO mdH+Rmsndy794+UOkb3aypl6MkdLk5uaKzAza4X/nayf3olEh9P4Vs4VKPvovUOZ5/M6 2ANzleqIDM1Lukjh7WUfeTMOCy0t1sVQezjNnoM2pGU1dw7CNMv0tmU1w852s5Cgo1oh C8StmXCKJ6rChTzlyy71JSvnvA6o/dUNLvTj8glsiNvfeyFc0rTzSUdx8CCWfL0Mu2go rJjvflDzqWFi1rcFdBDZtMsXgzouwlcki9FfttBAZyfEJQGj6nhlCy/LQaKxzHxTNGSh 0Htw== X-Gm-Message-State: ACgBeo0OvHy/X5p/QaZb6Vf9GPAQV2jBfqYNQBYE0KqPPcyWMd6BI2tN Mp6vK02uA0MPmUDvES8kVAbsToDROw+KOTlZhSbUT2/0Ii9ps3XgFVWL2eUUd7xDypTSqjlYqu3 7LqIUYEAbXjV7Nk8poX1SDRiU X-Received: by 2002:aa7:cb13:0:b0:448:3759:8c57 with SMTP id s19-20020aa7cb13000000b0044837598c57mr37696957edt.8.1662461918968; Tue, 06 Sep 2022 03:58:38 -0700 (PDT) X-Received: by 2002:aa7:cb13:0:b0:448:3759:8c57 with SMTP id s19-20020aa7cb13000000b0044837598c57mr37696947edt.8.1662461918761; Tue, 06 Sep 2022 03:58:38 -0700 (PDT) Received: from redhat.com ([2.52.135.118]) by smtp.gmail.com with ESMTPSA id kv12-20020a17090778cc00b0073d7b876621sm6398731ejc.205.2022.09.06.03.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:58:38 -0700 (PDT) Date: Tue, 6 Sep 2022 06:58:32 -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 , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] vsock: add netdev to vhost/virtio vsock Message-ID: <20220906065523-mutt-send-email-mst@kernel.org> References: <5a93c5aad99d79f028d349cb7e3c128c65d5d7e2.1660362668.git.bobby.eshleman@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a93c5aad99d79f028d349cb7e3c128c65d5d7e2.1660362668.git.bobby.eshleman@bytedance.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, 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 Mon, Aug 15, 2022 at 10:56:06AM -0700, Bobby Eshleman wrote: > In order to support usage of qdisc on vsock traffic, this commit > introduces a struct net_device to vhost and virtio vsock. > > Two new devices are created, vhost-vsock for vhost and virtio-vsock > for virtio. The devices are attached to the respective transports. > > To bypass the usage of the device, the user may "down" the associated > network interface using common tools. For example, "ip link set dev > virtio-vsock down" lets vsock bypass the net_device and qdisc entirely, > simply using the FIFO logic of the prior implementation. > > For both hosts and guests, there is one device for all G2H vsock sockets > and one device for all H2G vsock sockets. This makes sense for guests > because the driver only supports a single vsock channel (one pair of > TX/RX virtqueues), so one device and qdisc fits. For hosts, this may not > seem ideal for some workloads. However, it is possible to use a > multi-queue qdisc, where a given queue is responsible for a range of > sockets. This seems to be a better solution than having one device per > socket, which may yield a very large number of devices and qdiscs, all > of which are dynamically being created and destroyed. Because of this > dynamism, it would also require a complex policy management daemon, as > devices would constantly be spun up and down as sockets were created and > destroyed. To avoid this, one device and qdisc also applies to all H2G > sockets. > > Signed-off-by: Bobby Eshleman I've been thinking about this generally. vsock currently assumes reliability, but with qdisc can't we get packet drops e.g. depending on the queueing? What prevents user from configuring such a discipline? One thing people like about vsock is that it's very hard to break H2G communication even with misconfigured networking. -- MST