From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7F62A0562; Tue, 4 May 2021 14:07:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63E0740147; Tue, 4 May 2021 14:07:33 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 319C240141 for ; Tue, 4 May 2021 14:07:32 +0200 (CEST) IronPort-SDR: pUmnL/0r6LLvOChgeCvhgK2RvN4qSqeimI1KLbAj2kjeDe8xgM5E7jQ3TAhPBekX/UwnERCLe+ FvNjOYGeekjw== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="198018526" X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="198018526" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 05:07:30 -0700 IronPort-SDR: j1/qDQJKa19qPeTMWMYy8b2/X+GBW4m+U1AsKPIt/7y5dUfCTA4GxOvwdRIiuiraYBQtZ9hwmn 8+mFgG767ipA== X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="389943606" Received: from plaurenx-mobl.ger.corp.intel.com (HELO bricha3-MOBL.ger.corp.intel.com) ([10.252.15.85]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 04 May 2021 05:07:29 -0700 Date: Tue, 4 May 2021 13:07:25 +0100 From: Bruce Richardson To: Thomas Monjalon Cc: dev@dpdk.org, kevin.laatz@intel.com, sunil.pai.g@intel.com, jiayu.hu@intel.com Message-ID: References: <20210318182042.43658-1-bruce.richardson@intel.com> <20210430150637.362610-1-bruce.richardson@intel.com> <20210430150637.362610-9-bruce.richardson@intel.com> <3569712.0Jme0LqbK9@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3569712.0Jme0LqbK9@thomas> Subject: Re: [dpdk-dev] [PATCH v4 08/12] raw/ioat: add bus driver for device scanning automatically X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, May 03, 2021 at 11:32:04PM +0200, Thomas Monjalon wrote: > 30/04/2021 17:06, Bruce Richardson: > > Rather than using a vdev with args, DPDK can scan and initialize the > > devices automatically using a bus-type driver. This bus does not need to > > worry about registering device drivers, rather it can initialize the > > devices directly on probe. > > > > The device instances (queues) to use are detected from /dev with the > > additional info about them got from /sys. > > > > Signed-off-by: Bruce Richardson > > --- > > --- a/doc/guides/rawdevs/ioat.rst > > +++ b/doc/guides/rawdevs/ioat.rst > > @@ -78,7 +78,7 @@ Example configuration for a work queue:: > > > > $ accel-config config-wq dsa0/wq0.0 --group-id=0 \ > > --mode=dedicated --priority=10 --wq-size=8 \ > > - --type=user --name=app1 > > + --type=user --name=dpdk_app1 > > It looks to belong to commit "make workqueue name configurable in script". > It could, but I think it better belongs here, because this is the commit where it's important that the name of the queue has the appropriate prefix. > > Once the devices have been configured, they need to be enabled:: > > > > @@ -114,15 +114,18 @@ the device driver on the EAL commandline, via the ``allowlist`` or ``-a`` flag e > > > > $ dpdk-test -a ,max_queues=4 > > > > -If the device is bound to the IDXD kernel driver (and previously configured with sysfs), > > -then a specific work queue needs to be passed to the application via a vdev parameter. > > -This vdev parameter take the driver name and work queue name as parameters. > > -For example, to use work queue 0 on Intel\ |reg| DSA instance 0:: > > - > > - $ dpdk-test --no-pci --vdev=rawdev_idxd,wq=0.0 > > - > > -Once probed successfully, the device will appear as a ``rawdev``, that is a > > -"raw device type" inside DPDK, and can be accessed using APIs from the > > +For devices bound to the IDXD kernel driver, > > +the DPDK ioat driver will automatically perform a scan for available workqueues to use. > > +Any workqueues found listed in ``/dev/dsa`` on the system will be checked in ``/sys``, > > +and any which have ``dpdk_`` prefix in their name will be automatically probed by the > > +driver to make them available to the application. > > +Alternatively, to support use by multiple DPDK processes simultaneously, > > +the value used as the DPDK ``--file-prefix`` parameter may be used as a workqueue name prefix, > > +instead of ``dpdk_``, > > +allowing each DPDK application instance to only use a subset of configured queues. > > + > > +Once probed successfully, irrespective of kernel driver, the device will appear as a ``rawdev``, > > +that is a "raw device type" inside DPDK, and can be accessed using APIs from the > > ``rte_rawdev`` library. > [...] > > --- a/drivers/raw/ioat/meson.build > > +++ b/drivers/raw/ioat/meson.build > > @@ -4,13 +4,13 @@ > > build = dpdk_conf.has('RTE_ARCH_X86') > > reason = 'only supported on x86' > > sources = files( > > + 'idxd_bus.c', > > 'idxd_pci.c', > > - 'idxd_vdev.c', > > 'ioat_common.c', > > 'ioat_rawdev.c', > > 'ioat_rawdev_test.c', > > ) > > -deps += ['bus_pci', 'bus_vdev', 'mbuf', 'rawdev'] > > +deps += ['bus_pci', 'mbuf', 'rawdev'] > > OK to remove the vdev dependency by creating a bus singleton. > > You may want to allow iterating devices of the bus > by implementing .dev_iterate callback. > I was wondering about that. What is the expected use-case in general for such iteration?