From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5B6DA0487 for ; Tue, 2 Jul 2019 11:10:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E4F585689; Tue, 2 Jul 2019 11:10:56 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C87205680 for ; Tue, 2 Jul 2019 11:10:55 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2019 01:29:00 -0700 X-IronPort-AV: E=Sophos;i="5.63,442,1557212400"; d="scan'208";a="157558498" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.3.62]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2019 01:28:59 -0700 Date: Tue, 2 Jul 2019 09:28:56 +0100 From: Bruce Richardson To: "Hu, Jiayu" Cc: "dev@dpdk.org" , "thomas@monjalon.net" , "jerinj@marvell.com" , "Van Haaren, Harry" Message-ID: <20190702082855.GA401@bricha3-MOBL.ger.corp.intel.com> References: <20190530212525.40370-1-bruce.richardson@intel.com> <20190701155600.43695-1-bruce.richardson@intel.com> <20190701155600.43695-7-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH v4 6/9] raw/ioat: add device info function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Tue, Jul 02, 2019 at 03:33:25AM +0100, Hu, Jiayu wrote: > > > -----Original Message----- > > From: Richardson, Bruce > > Sent: Monday, July 1, 2019 11:56 PM > > To: dev@dpdk.org > > Cc: thomas@monjalon.net; jerinj@marvell.com; Hu, Jiayu > > ; Richardson, Bruce ; > > Van Haaren, Harry > > Subject: [PATCH v4 6/9] raw/ioat: add device info function > > > > Add in the "info_get" function to the driver, to allow us to query the > > device. This allows us to have the unit test pick up the presence of > > supported hardware or not. > > > > Signed-off-by: Bruce Richardson > > Tested-by: Harry van Haaren > > --- > > V4: Use TEST_SUCCESS in place of 0, when returning from test case. > > Minor documentation updates. > > > > V2: Test case is placed in driver self-test routine > > --- > > app/test/test_rawdev.c | 11 ++++++++++ > > doc/guides/rawdevs/ioat_rawdev.rst | 34 > > ++++++++++++++++++++++++++++++ > > drivers/raw/ioat/ioat_rawdev.c | 11 ++++++++++ > > drivers/raw/ioat/rte_ioat_rawdev.h | 11 ++++++++++ > > 4 files changed, 67 insertions(+) > > > > diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c > > index 86b5b2a77..2bfe2544d 100644 > > --- a/drivers/raw/ioat/ioat_rawdev.c > > +++ b/drivers/raw/ioat/ioat_rawdev.c > > @@ -34,10 +34,21 @@ static struct rte_pci_driver ioat_pmd_drv; > > #define IOAT_PMD_ERR(fmt, args...) IOAT_PMD_LOG(ERR, fmt, ## args) > > #define IOAT_PMD_WARN(fmt, args...) IOAT_PMD_LOG(WARNING, fmt, ## > > args) > > > > +static void > > +ioat_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info) > > +{ > > + struct rte_ioat_rawdev_config *cfg = dev_info; > > + struct rte_ioat_rawdev *ioat = dev->dev_private; > > + > > + if (cfg != NULL) > > + cfg->ring_size = ioat->ring_size; > > +} > > The CBDMA user may want to know the maximum copy length that the device > supports and the NUMA location of the device. So can ioat_dev_info_get() > return more device information? > The NUMA node id is already part of the rawdev info structure returned to the user. As for maximum copy length, yes, that could be added. However, since it's actually a characteristic of the hardware, it could be just a define inside the header file rather than needing to be returned per instance. Unlike with ethdevs and cryptodevs, rawdevs always have a device-specific dependency so using defines from the header should work fine, and not everything needs to come via dev_info. Regards, /Bruce