Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp678579pxj; Wed, 2 Jun 2021 08:44:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd/5AkOn0tbteuMXh+TllkPwyEbGe3A2N97t8ot7gSoevV6eOEbCefUV/ntFLP8FbDeO2m X-Received: by 2002:a17:906:2c4a:: with SMTP id f10mr27176884ejh.493.1622648640849; Wed, 02 Jun 2021 08:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622648640; cv=none; d=google.com; s=arc-20160816; b=ucMxEf8YdhU2GUcBDbAXxHQ8lC+c2zPJGoDHvFaIargvK8SmGSfbl+e3XDso8+1aFS GjgmY2x3SPMJlITSZJj3NsSxsieuO7VTH4KIzvyOw0mU041P+lw5FE1YoPaIHi85vWwg exBw5hdUa4OOUj9kM7jmfkO5fzFIYGQyfWdSyekcbwcvfOpdCu7AC+gh5lV132kb8Ewq US7CLXgQzf0ywTMQigGDDhf8k/bHQ2pgEhUUDboiXoiagOYju7rg5pQXjTjM+KBkpzKj w3hKLVfuinYKQsdyt+evHifIo1iGK2kHCyJjM5H5uFREinyVOsQ03nUijX3h9NcYlLr2 46Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=F7rTR0nIJh/ZBBwi7FQZkIxgzr6oxpys0zgmLuUrQn0=; b=f4NOjkSNYFXczvdqMV6hqLR2+io1IkTfrEUEgYVqPswhkojGmOEWUqFUUFX1HWb+1G SZBbxf8p2NMd78yM3HZEmHTS9BUWzEvYMg8+/Sk/plnpR2cAyJv61Yhw76HdSdrW43n3 n/msgHVsH0CIUmFW7UmSj6/vUFihgw/6odGV9/GjecwlDmGyoBiCrM0rJ1GtTdJVEyyu BHn0/fuOS5U2TSSQFqslce9KaQKye2n/yRUT07UnaD+l1qJXReEY+KPt4PM94SEGQSCg sEOyzHOi+c7VGk+pbR14rRElRwmfPQUdv4d7lg5SHcv+weRP92Q8KcOo5WlC4aaFbp+G U/6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id kk19si163309ejc.460.2021.06.02.08.43.36; Wed, 02 Jun 2021 08:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232127AbhFBPmm (ORCPT + 99 others); Wed, 2 Jun 2021 11:42:42 -0400 Received: from mga12.intel.com ([192.55.52.136]:62051 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230246AbhFBPml (ORCPT ); Wed, 2 Jun 2021 11:42:41 -0400 IronPort-SDR: 45+E8r9bh5eXM6wWQ4phn8eiYrnKXyn6RRvuWP4Rb6VO0u8Rx6rnp4oF+OBQitnpeSVyseiCa3 We35UMG/UM4g== X-IronPort-AV: E=McAfee;i="6200,9189,10003"; a="183498170" X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="183498170" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 08:40:53 -0700 IronPort-SDR: fygxpcgJ3k09ad+5wsx/bbZIYzXgQ3NYwhn46RK80I4bKEM5GOZOA6SO5QKmeqsQdSvAQqZNmI Ydz7uxkN31Lw== X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="416934415" Received: from djiang5-mobl1.amr.corp.intel.com (HELO [10.254.187.108]) ([10.254.187.108]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 08:40:52 -0700 Subject: Re: [PATCH v6 00/20] Add VFIO mediated device support and DEV-MSI support for the idxd driver To: Jason Gunthorpe Cc: alex.williamson@redhat.com, kwankhede@nvidia.com, tglx@linutronix.de, vkoul@kernel.org, Kevin Tian , Ashok Raj , megha.dey@intel.com, jacob.jun.pan@intel.com, yi.l.liu@intel.com, baolu.lu@intel.com, sanjay.k.kumar@intel.com, tony.luck@intel.com, dan.j.williams@intel.com, eric.auger@redhat.com, pbonzini@redhat.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <162164243591.261970.3439987543338120797.stgit@djiang5-desk3.ch.intel.com> <20210523232219.GG1002214@nvidia.com> From: Dave Jiang Message-ID: <86cde154-37c7-c00d-b0c6-06b15b50dbf7@intel.com> Date: Wed, 2 Jun 2021 08:40:51 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210523232219.GG1002214@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/23/2021 4:22 PM, Jason Gunthorpe wrote: > On Fri, May 21, 2021 at 05:19:05PM -0700, Dave Jiang wrote: >> Introducing mdev types “1dwq-v1” type. This mdev type allows >> allocation of a single dedicated wq from available dedicated wqs. After >> a workqueue (wq) is enabled, the user will generate an uuid. On mdev >> creation, the mdev driver code will find a dwq depending on the mdev >> type. When the create operation is successful, the user generated uuid >> can be passed to qemu. When the guest boots up, it should discover a >> DSA device when doing PCI discovery. >> >> For example of “1dwq-v1” type: >> 1. Enable wq with “mdev” wq type >> 2. A user generated uuid. >> 3. The uuid is written to the mdev class sysfs path: >> echo $UUID > /sys/class/mdev_bus/0000\:00\:0a.0/mdev_supported_types/idxd-1dwq-v1/create >> 4. Pass the following parameter to qemu: >> "-device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:0a.0/$UUID" > So the idxd core driver knows to create a "vfio" wq with its own much > machinery but you still want to involve the horrible mdev guid stuff? > > Why?? Are you referring to calling mdev_device_create() directly in the mdev idxd_driver probe? I think this would work with our dedicated wq where a single mdev can be assigned to a wq. However, later on when we need to support shared wq where we can create multiple mdev per wq, we'll need an entry point to do so. In the name of making things consistent from user perspective, going through sysfs seems the way to do it.