Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2990411ybg; Mon, 28 Oct 2019 05:47:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEjkYrImDQbQ9dy1YnFx3+7Te72DJk4Ft4n2N6b+hUv5AkDRChIdA71v4kaF1KLZ4YY5C5 X-Received: by 2002:a17:906:fca5:: with SMTP id qw5mr16358911ejb.133.1572266862963; Mon, 28 Oct 2019 05:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572266862; cv=none; d=google.com; s=arc-20160816; b=jRp2y7M07Wbd4gBHje5wF0sW4BH/rQ75ojtftQgsxlY6Lvc802RiTArhAI53IPnCo+ wTwtaPBYF4lUzC3Y3uQw+QISllDcRo7mLW55m4fhfAOTCjSZW/fg002qYDTjkv1zIZGY mETl4kCxAszRm9jqZFcpTQSoKKvf52zG7a7JW2EMtOV4m+JLHz8vpf2OrbaIGeZSNr7x u8iS4frjvo6ZT7JLgbSKbnfyhyNZSqyCqoHYmfBE82QBbmM76Hnz9EnFArz1TVdwhAXF QeqEBZUojXxsgkoBWbZYpPcHDZYFfw3qMm3BfOQnNqRuzMOgk0NPd4zGi6HtCOjTMOg3 WZEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=UDguCLtRMoHzsn4APsmGP6b7jnGHWjRorLjd6vI66rM=; b=Tv8r2qxSRD8i1iPrYWPm2MizfBJkaEpsANDb6C0KQAdsLY25kjmYP1J0DaIXBngzsK oKkE8U091AxSjx4ksaDqPzkx4xt7m9ONJEBP/xQuyJsy/8ZiGXOHb2qpJx8Pb0QfuaGQ z6oRjSYSZv1CZOyEOBgEuUekcNWqfnrsudRa3eUnJN1J7N4ixOBmWw8UmwTP4/oypjvl +1Mr4/ac4/jqbJ3IUfA0EQe4+flP6f7jNsICcfwmVGvTcHiTKT5S/1ykCpPGG0GlazbI Zj0fxemEKD2CO6qKgAaDULLwXDP39jjZnXBi7CQzeC0S1vJsbkle5uj5ynsRPVpccTLT P5zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ss13si6101953ejb.259.2019.10.28.05.47.19; Mon, 28 Oct 2019 05:47:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729665AbfJ1B5y (ORCPT + 99 others); Sun, 27 Oct 2019 21:57:54 -0400 Received: from mga11.intel.com ([192.55.52.93]:16201 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727598AbfJ1B5x (ORCPT ); Sun, 27 Oct 2019 21:57:53 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Oct 2019 18:57:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,238,1569308400"; d="scan'208";a="229541691" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by fmsmga002.fm.intel.com with ESMTP; 27 Oct 2019 18:57:51 -0700 Date: Mon, 28 Oct 2019 09:58:42 +0800 From: Tiwei Bie To: Jason Wang , "Michael S. Tsirkin" Cc: alex.williamson@redhat.com, maxime.coquelin@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, dan.daly@intel.com, cunming.liang@intel.com, zhihong.wang@intel.com, lingshan.zhu@intel.com Subject: Re: [PATCH v2] vhost: introduce mdev based hardware backend Message-ID: <20191028015842.GA9005@___> References: <106834b5-dae5-82b2-0f97-16951709d075@redhat.com> <20191023101135.GA6367@___> <5a7bc5da-d501-2750-90bf-545dd55f85fa@redhat.com> <20191024042155.GA21090@___> <20191024091839.GA17463@___> <20191025080143-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191025080143-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 25, 2019 at 08:16:26AM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 25, 2019 at 05:54:55PM +0800, Jason Wang wrote: > > On 2019/10/24 下午6:42, Jason Wang wrote: > > > > > > Yes. > > > > > > > > > >   And we should try to avoid > > > > putting ctrl vq and Rx/Tx vqs in the same DMA space to prevent > > > > guests having the chance to bypass the host (e.g. QEMU) to > > > > setup the backend accelerator directly. > > > > > > > > > That's really good point.  So when "vhost" type is created, parent > > > should assume addr of ctrl_vq is hva. > > > > > > Thanks > > > > > > This works for vhost but not virtio since there's no way for virtio kernel > > driver to differ ctrl_vq with the rest when doing DMA map. One possible > > solution is to provide DMA domain isolation between virtqueues. Then ctrl vq > > can use its dedicated DMA domain for the work. It might not be a bad idea to let the parent drivers distinguish between virtio-mdev mdevs and vhost-mdev mdevs in ctrl-vq handling by mdev's class id. > > > > Anyway, this could be done in the future. We can have a version first that > > doesn't support ctrl_vq. +1, thanks > > > > Thanks > > Well no ctrl_vq implies either no offloads, or no XDP (since XDP needs > to disable offloads dynamically). > > if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS) > && (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) || > virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) || > virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || > virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || > virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { > NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO/CSUM, disable LRO/CSUM first"); > return -EOPNOTSUPP; > } > > neither is very attractive. > > So yes ok just for development but we do need to figure out how it will > work down the road in production. Totally agree. > > So really this specific virtio net device does not support control vq, > instead it supports a different transport specific way to send commands > to device. > > Some kind of extension to the transport? Ideas? > > > -- > MST