From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 47A12A046B
	for <public@inbox.dpdk.org>; Fri, 28 Jun 2019 23:09:45 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 11A7B4CAF;
	Fri, 28 Jun 2019 23:09:45 +0200 (CEST)
Received: from mga05.intel.com (mga05.intel.com [192.55.52.43])
 by dpdk.org (Postfix) with ESMTP id 2C3864CA9
 for <dev@dpdk.org>; Fri, 28 Jun 2019 23:09:44 +0200 (CEST)
X-Amp-Result: UNKNOWN
X-Amp-Original-Verdict: FILE UNKNOWN
X-Amp-File-Uploaded: False
Received: from orsmga006.jf.intel.com ([10.7.209.51])
 by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 28 Jun 2019 14:09:43 -0700
X-IronPort-AV: E=Sophos;i="5.63,429,1557212400"; d="scan'208";a="167874846"
Received: from bricha3-mobl.ger.corp.intel.com ([10.252.21.39])
 by orsmga006-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 28 Jun 2019 14:09:41 -0700
Date: Fri, 28 Jun 2019 22:09:38 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net, jerinj@marvell.com
Message-ID: <20190628210938.GD366@bricha3-MOBL.ger.corp.intel.com>
References: <20190530212525.40370-1-bruce.richardson@intel.com>
 <20190627104055.8244-1-bruce.richardson@intel.com>
 <20190627104055.8244-6-bruce.richardson@intel.com>
 <839985e7-138d-1bc6-dbc8-efceb110afcc@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <839985e7-138d-1bc6-dbc8-efceb110afcc@intel.com>
User-Agent: Mutt/1.11.4 (2019-03-13)
Subject: Re: [dpdk-dev] [PATCH v3 5/8] 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Thu, Jun 27, 2019 at 01:16:01PM +0100, Burakov, Anatoly wrote:
> On 27-Jun-19 11:40 AM, Bruce Richardson wrote:
> > 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 <bruce.richardson@intel.com>
> > 
> > ---
> > 
> > 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/app/test/test_rawdev.c b/app/test/test_rawdev.c
> > index 88549fb61..4db762b4c 100644
> > --- a/app/test/test_rawdev.c
> > +++ b/app/test/test_rawdev.c
> > @@ -29,6 +29,17 @@ REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftest_skeleton);
> >   static int
> >   test_rawdev_selftest_ioat(void)
> >   {
> > +	const int count = rte_rawdev_count();
> > +	int i;
> > +
> > +	for (i = 0; i < count; i++) {
> > +		struct rte_rawdev_info info = { .dev_private = NULL };
> > +		if (rte_rawdev_info_get(i, &info) == 0 &&
> > +				strstr(info.driver_name, "ioat") != NULL)
> > +			return 0;
> 
> TEST_SUCCESS? Also, didn't "ioat" have a macro for its name?
> 

Ack on the TEST_SUCCESS part.

For the seond point, yes, there is a macro for the name, but to get it one
has to include the header file for the driver, which will not be available
if the driver is not being built. Therefore, I just use a basic check for
the "ioat" name, rather than cluttering up the code with lots of
conditionals for handling cases where the driver won't be built.

/Bruce