Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp329100ybv; Wed, 5 Feb 2020 06:20:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxdefIDuP6FxWvTprb7Vk1wk3SuzDQ2w3+imuwZtz1p2UiejmpPP4INbENU16XcIYbl644v X-Received: by 2002:a9d:6f85:: with SMTP id h5mr26370110otq.19.1580912405523; Wed, 05 Feb 2020 06:20:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580912405; cv=none; d=google.com; s=arc-20160816; b=EXPuhcqkRgGyWOdhvU8mtfVG+J5PWMh/35JiGu3Fs5TS65X3N+oDJYfUtP9Q/o3/La CZVYi5Yl6n/YVZBZ/LN2wPTp9Kt4GbMxzqeJhz3Lgwzkau2OKV+GOITWu1xlaZXsZxn6 w/oghtOTncZieV2YwBeNY3Qbsi8wsCVLKmDpwj703cACRBMXFbSteHh7xyiDyJFkvN2G eHin9rN+uQXA1FEXPoAB2/GWZ6PxYx1QbKjB6aaz+Kkavc0H4Z4yl16yFZ9s0g8PevdY QxIIzIuVcHq1RmQzqf5LZaxVymC5SmSzhK+1f0v42TE7haa5s9ijJjg59kf7WK09lu5C jQjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=1dGbRA7pmfjMTjjm0vzl9/+wz0Bn0fpu96k2WzDU2gg=; b=h/Os+Ur2KqTHJrlj/8V9RWH7IWHgeWqahDLMJGNkBsC3J5cT43VIicN8HT1uLnDCPP Cm7wlWOUTZwRsRvK1muyYQ9IYW1pOZRbLJdqbVMS+flX/ZS7J1fw7DDsh3mjpC2ZLwoA kVJgreuI9muq0VUDCE8iJJrpIV8Or475mFuY6rS3N8QfglL0lVz6MmQWFprGoMtODIFg yjzGprrx0lHyzV20dXzsU3kqIgHh6ch5QKt0XXIYyKfqWvFUfe/Op45Qph3ygIkWi/Wj I8/o2aVRHO8bpNZexlaK/GGjGdUwzcgmXbOqsQtyfeoe+FDBj/we0dKte4Bf4E/M8hqN EyhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MUrw6Dy+; 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=pass (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 i25si12332049oii.259.2020.02.05.06.19.51; Wed, 05 Feb 2020 06:20:05 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MUrw6Dy+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728273AbgBEOSg (ORCPT + 99 others); Wed, 5 Feb 2020 09:18:36 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43115 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728123AbgBEOSg (ORCPT ); Wed, 5 Feb 2020 09:18:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580912314; 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=1dGbRA7pmfjMTjjm0vzl9/+wz0Bn0fpu96k2WzDU2gg=; b=MUrw6Dy+JLsmiUWYv/rUs+SluR2vIZlp+ikqPCGoNJs9sUIrdWDzJWZ8CLb/FXu1d0aAsS GnegyrUVarQhP4s+yAHezADAb1jkUH87gMOubrlg9fDsClZngL7svZUCmpEF9avuEFm86L E+F4KSacN7hf0giQQiRiLX0dTJgCcOI= 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-330-amSae5N0MbyMQZpTPJVfbQ-1; Wed, 05 Feb 2020 09:18:29 -0500 X-MC-Unique: amSae5N0MbyMQZpTPJVfbQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4BEA801E76; Wed, 5 Feb 2020 14:18:27 +0000 (UTC) Received: from x1.home (ovpn-116-28.phx2.redhat.com [10.3.116.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 095EF790D4; Wed, 5 Feb 2020 14:18:26 +0000 (UTC) Date: Wed, 5 Feb 2020 07:18:26 -0700 From: Alex Williamson To: "Liu, Yi L" Cc: "kvm@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "dev@dpdk.org" , "mtosatti@redhat.com" , "thomas@monjalon.net" , "bluca@debian.org" , "jerinjacobk@gmail.com" , "Richardson, Bruce" , "cohuck@redhat.com" Subject: Re: [RFC PATCH 0/7] vfio/pci: SR-IOV support Message-ID: <20200205071826.6d4d43d7@x1.home> In-Reply-To: References: <158085337582.9445.17682266437583505502.stgit@gimli.home> <20200204161737.34696b91@w520.home> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Feb 2020 07:57:36 +0000 "Liu, Yi L" wrote: > > From: Alex Williamson > > Sent: Wednesday, February 5, 2020 7:18 AM > > To: kvm@vger.kernel.org > > Subject: Re: [RFC PATCH 0/7] vfio/pci: SR-IOV support > > > > > > Promised example QEMU test case... > > > > commit 3557c63bcb286c71f3f7242cad632edd9e297d26 > > Author: Alex Williamson > > Date: Tue Feb 4 13:47:41 2020 -0700 > > > > vfio-pci: QEMU support for vfio-pci VF tokens > > > > Example support for using a vf_token to gain access to a device as > > well as using the VFIO_DEVICE_FEATURE interface to set the VF token. > > Note that the kernel will disregard the additional option where it's > > not required, such as opening the PF with no VF users, so we can > > always provide it. > > > > NB. It's unclear whether there's value to this QEMU support without > > further exposure of SR-IOV within a VM. This is meant mostly as a > > test case where the real initial users will likely be DPDK drivers. > > > > Signed-off-by: Alex Williamson > > Just curious how UUID is used across the test. Should the QEMU > which opens VFs add the vfio_token=UUID or the QEMU which > opens PF add the vfio_token=UUID? or both should add vfio_token=UUID. In this example we do both as this covers the case where there are existing VF users, which requires the PF to also provide the vf_token. If there are no VF users, the PF is not required to provide a vf_token and vfio-pci will not fail the device match if a vf_token is provided but not needed. In fact, when a PF is probed by vfio-pci a random vf_token is set, so it's required to use a PF driver to set a known vf_token before any VF users can access their VFs. Thanks, Alex