From patchwork Thu Sep 27 06:22:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirti Wankhede X-Patchwork-Id: 10617277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5422B15E8 for ; Thu, 27 Sep 2018 06:23:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AE422AF8D for ; Thu, 27 Sep 2018 06:23:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E0322AFA1; Thu, 27 Sep 2018 06:23:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FCCB2AF8D for ; Thu, 27 Sep 2018 06:23:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726698AbeI0MkR (ORCPT ); Thu, 27 Sep 2018 08:40:17 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:8506 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbeI0MkR (ORCPT ); Thu, 27 Sep 2018 08:40:17 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 26 Sep 2018 23:23:43 -0700 Received: from HQMAIL108.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 26 Sep 2018 23:23:41 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 26 Sep 2018 23:23:41 -0700 Received: from HQMAIL106.nvidia.com (172.18.146.12) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 27 Sep 2018 06:23:39 +0000 Received: from kwankhede-dev.nvidia.com (172.20.13.39) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 27 Sep 2018 06:23:37 +0000 From: Kirti Wankhede To: , , , CC: , Kirti Wankhede Subject: [RFC PATCH v1 1/1] Add attribute multiple_mdev_support for mdev type-id Date: Thu, 27 Sep 2018 11:52:00 +0530 Message-ID: <1538029320-6034-1-git-send-email-kwankhede@nvidia.com> X-Mailer: git-send-email 2.7.0 X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1538029423; bh=mTqOaUZwE2ui8WkModECS1sFZzExtOBqrMl9Qd+UdU4=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=fcDudWE6CcCFiKAH78lb5bL/Iu3dBSACa4vzayTVHktE4+H2UIzeZ1OR/Lk76MFZf iXKrXjd+g7wpHsrrS5A+Hwo6ai12Q8bMXLH3onGwuP7JgJp4+AhuWXPRjh99zmEkPM WG8ytjCcFEjT1GTaWBd3+/Jr+SRzv+dZlwZ1UODglp2mtPSAnLk93u/vK0EQKyH8qs Pc/h07vB0vNtl2cEHCJopHzbm727hjb/4xet5i3w3wmh1tV/OQXiMJVF/WkS4Z4TDH do59N1p+3rduLwlLLxITHSyh6bz96ugWrFjqToFyOM6EBfkOBYINXJC4JDzyho9PBA 2Qrd0TuYJiTKQ== Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Generally a single instance of mdev device, a share of physical device, is assigned to user space application or a VM. There are cases when multiple instances of mdev devices of same or different types are required by User space application or VM. For example in case of vGPU, multiple mdev devices of type which represents whole GPU can be assigned to one instance of application or VM. All types of mdev devices may not support assigning multiple mdev devices to a user space application. In that case vendor driver can fail open() call of mdev device. But there is no way to know User space application about the configuration supported by vendor driver. To expose supported configuration, vendor driver should add 'multiple_mdev_support' attribute to type-id directory if vendor driver supports assigning multiple mdev devices of a particular type-id to one instance of user space application or a VM. User space application should read if 'multiple_mdev_support' attibute is present in type-id directory of all mdev devices which are going to be used. If all read 1 then user space application can proceed with multiple mdev devices. This is optional and readonly attribute. Signed-off-by: Neo Jia Signed-off-by: Kirti Wankhede --- Documentation/ABI/testing/sysfs-bus-vfio-mdev | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-vfio-mdev b/Documentation/ABI/testing/sysfs-bus-vfio-mdev index 452dbe39270e..69e1291479ce 100644 --- a/Documentation/ABI/testing/sysfs-bus-vfio-mdev +++ b/Documentation/ABI/testing/sysfs-bus-vfio-mdev @@ -85,6 +85,19 @@ Users: a particular that can help in understanding the features provided by that type of mediated device. +What: /sys/.../mdev_supported_types//multiple_mdev_support +Date: September 2018 +Contact: Kirti Wankhede +Description: + Reading this attribute will return 0 or 1. Returning 1 indicates + multiple mdev devices of a particular assigned to one + User space application is supported by vendor driver. This is + optional and readonly attribute. +Users: + Userspace applications interested in knowing if multiple mdev + devices of a particular can be assigned to one + instance of application. + What: /sys/.../// Date: October 2016 Contact: Kirti Wankhede