Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933632AbcKPPHp (ORCPT ); Wed, 16 Nov 2016 10:07:45 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:9150 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564AbcKPPHm (ORCPT ); Wed, 16 Nov 2016 10:07:42 -0500 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 16 Nov 2016 07:07:40 -0800 Subject: Re: [PATCH v13 02/22] vfio: VFIO based driver for Mediated devices To: , , , , , , , , , References: <1479223805-22895-1-git-send-email-kwankhede@nvidia.com> <1479223805-22895-3-git-send-email-kwankhede@nvidia.com> <20161116022958.GA5531@bjsdjshi@linux.vnet.ibm.com> X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: <8dc7519e-f463-3495-516d-a867405d241a@nvidia.com> Date: Wed, 16 Nov 2016 20:35:55 +0530 MIME-Version: 1.0 In-Reply-To: <20161116022958.GA5531@bjsdjshi@linux.vnet.ibm.com> X-Originating-IP: [10.24.216.210] X-ClientProxiedBy: DRHKMAIL102.nvidia.com (10.25.59.16) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3199 Lines: 101 On 11/16/2016 7:59 AM, Dong Jia Shi wrote: > * Kirti Wankhede [2016-11-15 20:59:45 +0530]: > > Hi Kirti, > >> vfio_mdev driver registers with mdev core driver. >> mdev core driver creates mediated device and calls probe routine of >> vfio_mdev driver for each device. >> Probe routine of vfio_mdev driver adds mediated device to VFIO core module >> >> This driver forms a shim layer that pass through VFIO devices operations >> to vendor driver for mediated devices. >> >> Signed-off-by: Kirti Wankhede >> Signed-off-by: Neo Jia >> Reviewed-by: Jike Song >> >> Change-Id: I583f4734752971d3d112324d69e2508c88f359ec >> --- >> drivers/vfio/mdev/Kconfig | 7 ++ >> drivers/vfio/mdev/Makefile | 1 + >> drivers/vfio/mdev/mdev_core.c | 16 ++++- >> drivers/vfio/mdev/vfio_mdev.c | 148 ++++++++++++++++++++++++++++++++++++++++++ >> 4 files changed, 171 insertions(+), 1 deletion(-) >> create mode 100644 drivers/vfio/mdev/vfio_mdev.c >> >> diff --git a/drivers/vfio/mdev/Kconfig b/drivers/vfio/mdev/Kconfig >> index 258481d65ebd..1aa0391d74f2 100644 >> --- a/drivers/vfio/mdev/Kconfig >> +++ b/drivers/vfio/mdev/Kconfig >> @@ -7,3 +7,10 @@ config VFIO_MDEV >> Provides a framework to virtualize devices. >> >> If you don't know what do here, say N. >> + >> +config VFIO_MDEV_DEVICE >> + tristate "VFIO support for Mediated devices" > ^^^^^^^^^^^^^^^^ > >> + depends on VFIO && VFIO_MDEV >> + default n >> + help >> + VFIO based driver for mediated devices. > ^^^^^^^^^^^^^^^^ > nit: > s/mediated/Mediated/ > > I saw in many places you use the term "Mediated device", so I guess this > is what you preferred to name them. > >> diff --git a/drivers/vfio/mdev/Makefile b/drivers/vfio/mdev/Makefile >> index 31bc04801d94..fa2d5ea466ee 100644 >> --- a/drivers/vfio/mdev/Makefile >> +++ b/drivers/vfio/mdev/Makefile >> @@ -2,3 +2,4 @@ >> mdev-y := mdev_core.o mdev_sysfs.o mdev_driver.o >> >> obj-$(CONFIG_VFIO_MDEV) += mdev.o >> +obj-$(CONFIG_VFIO_MDEV_DEVICE) += vfio_mdev.o >> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c >> index 613e8a8a3b2a..1e0714ebc56a 100644 >> --- a/drivers/vfio/mdev/mdev_core.c >> +++ b/drivers/vfio/mdev/mdev_core.c >> @@ -354,7 +354,21 @@ int mdev_device_remove(struct device *dev, bool force_remove) >> >> static int __init mdev_init(void) >> { >> - return mdev_bus_register(); >> + int ret; >> + >> + ret = mdev_bus_register(); >> + if (ret) { >> + pr_err("Failed to register mdev bus\n"); > If you want to report an error message here, you should do it in a > previous patch where you introduce the call for mdev_bus_register. > Removing this error message. >> + return ret; >> + } >> + >> + /* >> + * Attempt to load known vfio_mdev. This gives us a working environment >> + * without the user needing to explicitly load vfio_mdev driver. >> + */ >> + request_module_nowait("vfio_mdev"); >> + >> + return ret; >> } >> >> static void __exit mdev_exit(void) > [...] > > Please: > Reviewed-by: Dong Jia Shi > Thanks.