Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp979868ybe; Thu, 19 Sep 2019 06:56:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjx1dwTyP3VTOelINyhjPYTZXh3JkMyBge87vkaZenR/FE0NhTtEg8s2yJQuUOzygJwsOQ X-Received: by 2002:a05:6402:1681:: with SMTP id a1mr16154918edv.218.1568901378222; Thu, 19 Sep 2019 06:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568901378; cv=none; d=google.com; s=arc-20160816; b=qiTT8RGF0sAtHfkkpJqwLXVWzwtB/2Kl5Jna90RQBtUS2b5VmloNmUyFGyQ7rQkiTS R6wJJDR8Ttiq5dF+gY2UwcIsb30UUt2t6Xsup1iIYIOj28UcHFbOnXIrVSvFXdSMsfdq 5AWEv5auuY/1jXVqTiGblYkEB7Raa1QPkwZTXaxMIzpXDTaidmt9b9467ED1qPO1piLT VB07IPyXD+/7LlpiZ0l4YNf21nz3J/k38P5F5iW6aQG4u1HIn6l3kcndFUWe5iox12eJ kxQrlTXrVJ2mycOjyImoE7JE0LKg/hqNjUXnloX6Cgq+fEd2GVq8sR9ncFYT3b4I4Ru9 NxBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=R4qfeIMR05hpC5ClhDSkl1CPUCQX3R7wmrIx7HEeEW0=; b=nEmD0tZh5DH/Ky88qZgpaBg6GBffqQ7M1a4Y39OAMH9wdCOqAuLhQxf0mYL4yOwyy4 plpbb9FcAh2KcvNfUTlKkfRUMDMtZIDNbY0+s/UYPnwKDYhsBCp7/LsHBvAX6GLq48F6 GIc/nr/TyOGzT/mEz/iBYCVwdXVZfzHFQH/KZYstrqfQzAnDFeuA1kRblwn70HFhYVuv nneTWxngUj+IFPvDYFoHqTXB0VgduxCiNHB+lg5hfXh0nBOlyWeCVckMHGaPbuHxaLoP 1iGRQZwKeJJ8sGsth9yu1WKFPdZfpV/SznqWoURLcEtzECVGciYhNwxbi6PWFXl+CP6y FB3Q== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g20si4434625eje.364.2019.09.19.06.55.54; Thu, 19 Sep 2019 06:56:18 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388901AbfISNIf (ORCPT + 99 others); Thu, 19 Sep 2019 09:08:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39868 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732271AbfISNIf (ORCPT ); Thu, 19 Sep 2019 09:08:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2765189810C; Thu, 19 Sep 2019 13:08:35 +0000 (UTC) Received: from [10.72.12.81] (ovpn-12-81.pek2.redhat.com [10.72.12.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABF825D9CC; Thu, 19 Sep 2019 13:08:22 +0000 (UTC) Subject: Re: [RFC v4 0/3] vhost: introduce mdev based hardware backend To: "Michael S. Tsirkin" Cc: Tiwei Bie , 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 References: <20190917010204.30376-1-tiwei.bie@intel.com> <993841ed-942e-c90b-8016-8e7dc76bf13a@redhat.com> <20190917105801.GA24855@___> <20190918102923-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: Date: Thu, 19 Sep 2019 21:08:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190918102923-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Thu, 19 Sep 2019 13:08:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/18 下午10:32, Michael S. Tsirkin wrote: >>>> So I have some questions: >>>> >>>> 1) Compared to method 2, what's the advantage of creating a new vhost char >>>> device? I guess it's for keep the API compatibility? >>> One benefit is that we can avoid doing vhost ioctls on >>> VFIO device fd. >> Yes, but any benefit from doing this? > It does seem a bit more modular, but it's certainly not a big deal. Ok, if we go this way, it could be as simple as provide some callback to vhost, then vhost can just forward the ioctl through parent_ops. > >>>> 2) For method 2, is there any easy way for user/admin to distinguish e.g >>>> ordinary vfio-mdev for vhost from ordinary vfio-mdev? >>> I think device-api could be a choice. >> Ok. >> >> >>>> I saw you introduce >>>> ops matching helper but it's not friendly to management. >>> The ops matching helper is just to check whether a given >>> vfio-device is based on a mdev device. >>> >>>> 3) A drawback of 1) and 2) is that it must follow vfio_device_ops that >>>> assumes the parameter comes from userspace, it prevents support kernel >>>> virtio drivers. >>>> >>>> 4) So comes the idea of method 3, since it register a new vhost-mdev driver, >>>> we can use device specific ops instead of VFIO ones, then we can have a >>>> common API between vDPA parent and vhost-mdev/virtio-mdev drivers. >>> As the above draft shows, this requires introducing a new >>> VFIO device driver. I think Alex's opinion matters here. Just to clarify, a new type of mdev driver but provides dummy vfio_device_ops for VFIO to make container DMA ioctl work. Thanks >> Yes, it is. >> >> Thanks >> >>