From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 010E4C433E3 for ; Thu, 13 Aug 2020 04:34:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C23D92087D for ; Thu, 13 Aug 2020 04:34:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DGuz8A8z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725298AbgHMEeX (ORCPT ); Thu, 13 Aug 2020 00:34:23 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21158 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725848AbgHMEeW (ORCPT ); Thu, 13 Aug 2020 00:34:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597293261; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qvrNz4SFjTzW3E/xjnyIB3Qq4CFTBccMTkHV2o/Wvns=; b=DGuz8A8zQHPu4cXN/GV0rvNMMGd9XKevQFRRs1IfAAJ1G1VpMGuTA9MVGBcapxk4VK557s xtZwwcx2nZmBn+dcT/b94PCQ+4q9NTizfCZVJubx6zV56U/WKFgsjpzzqYkZsT+mJ/HQ1Z VczV2qmcbIngNjfXmW7jjjxqUS6WC00= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-392-vQ5TZQD_Mw6U0R6mxvcHsw-1; Thu, 13 Aug 2020 00:34:16 -0400 X-MC-Unique: vQ5TZQD_Mw6U0R6mxvcHsw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7D651005504; Thu, 13 Aug 2020 04:34:12 +0000 (UTC) Received: from [10.72.13.44] (ovpn-13-44.pek2.redhat.com [10.72.13.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BE435DA30; Thu, 13 Aug 2020 04:33:54 +0000 (UTC) Subject: Re: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver To: "Tian, Kevin" , Jason Gunthorpe , Alex Williamson Cc: "Jiang, Dave" , "vkoul@kernel.org" , "Dey, Megha" , "maz@kernel.org" , "bhelgaas@google.com" , "rafael@kernel.org" , "gregkh@linuxfoundation.org" , "tglx@linutronix.de" , "hpa@zytor.com" , "Pan, Jacob jun" , "Raj, Ashok" , "Liu, Yi L" , "Lu, Baolu" , "Kumar, Sanjay K" , "Luck, Tony" , "Lin, Jing" , "Williams, Dan J" , "kwankhede@nvidia.com" , "eric.auger@redhat.com" , "parav@mellanox.com" , "Hansen, Dave" , "netanelg@mellanox.com" , "shahafs@mellanox.com" , "yan.y.zhao@linux.intel.com" , "pbonzini@redhat.com" , "Ortiz, Samuel" , "Hossain, Mona" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-pci@vger.kernel.org" , "kvm@vger.kernel.org" References: <159534667974.28840.2045034360240786644.stgit@djiang5-desk3.ch.intel.com> <20200721164527.GD2021248@mellanox.com> <20200724001930.GS2021248@mellanox.com> <20200805192258.5ee7a05b@x1.home> <20200807121955.GS16789@nvidia.com> From: Jason Wang Message-ID: Date: Thu, 13 Aug 2020 12:33:52 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: 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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On 2020/8/12 下午12:05, Tian, Kevin wrote: >> The problem is that if we tie all controls via VFIO uAPI, the other >> subsystem like vDPA is likely to duplicate them. I wonder if there is a >> way to decouple the vSVA out of VFIO uAPI? > vSVA is a per-device (either pdev or mdev) feature thus naturally should > be managed by its device driver (VFIO or vDPA). From this angle some > duplication is inevitable given VFIO and vDPA are orthogonal passthrough > frameworks. Within the kernel the majority of vSVA handling is done by > IOMMU and IOASID modules thus most logic are shared. So why not introduce vSVA uAPI at IOMMU or IOASID layer? > >>> If an userspace DMA interface can be easily >>> adapted to be a passthrough one, it might be the choice. >> It's not that easy even for VFIO which requires a lot of new uAPIs and >> infrastructures(e.g mdev) to be invented. >> >> >>> But for idxd, >>> we see mdev a much better fit here, given the big difference between >>> what userspace DMA requires and what guest driver requires in this hw. >> A weak point for mdev is that it can't serve kernel subsystem other than >> VFIO. In this case, you need some other infrastructures (like [1]) to do >> this. > mdev is not exclusive from kernel usages. It's perfectly fine for a driver > to reserve some work queues for host usages, while wrapping others > into mdevs. I meant you may want slices to be an independent device from the kernel point of view: E.g for ethernet devices, you may want 10K mdevs to be passed to guest. Similarly, you may want 10K net devices which is connected to the kernel networking subsystems. In this case it's not simply reserving queues but you need some other type of device abstraction. There could be some kind of duplication between this and mdev. Thanks > > Thanks > Kevin >