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 4FA2FA046B for ; Thu, 27 Jun 2019 14:16:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A6FC4C99; Thu, 27 Jun 2019 14:16:06 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DEFF24C93 for ; Thu, 27 Jun 2019 14:16:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2019 05:16:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,423,1557212400"; d="scan'208";a="313775629" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.252.3.102]) ([10.252.3.102]) by orsmga004.jf.intel.com with ESMTP; 27 Jun 2019 05:16:02 -0700 To: Bruce Richardson , dev@dpdk.org Cc: thomas@monjalon.net, jerinj@marvell.com References: <20190530212525.40370-1-bruce.richardson@intel.com> <20190627104055.8244-1-bruce.richardson@intel.com> <20190627104055.8244-6-bruce.richardson@intel.com> From: "Burakov, Anatoly" Message-ID: <839985e7-138d-1bc6-dbc8-efceb110afcc@intel.com> Date: Thu, 27 Jun 2019 13:16:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190627104055.8244-6-bruce.richardson@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > > --- > > 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? > + } > + > + printf("No IOAT rawdev found, skipping tests\n"); > return TEST_SKIPPED; > } > > diff --git a/doc/guides/rawdevs/ioat_rawdev.rst b/doc/guides/rawdevs/ioat_rawdev.rst > index 4b7fe8a8f..0ce984490 100644 > --- a/doc/guides/rawdevs/ioat_rawdev.rst > +++ b/doc/guides/rawdevs/ioat_rawdev.rst > @@ -83,3 +83,37 @@ parameters need to be passed to create or initialize the device. > 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 > ``rte_rawdev`` library. > + > +Using IOAT Rawdev Devices > +-------------------------- > + > +To use the devices from an application, the rawdev API can be used, along > +with definitions taken from the device-specific header file > +``rte_ioat_rawdev.h``. This header is needed to get the definition of > +structure parameters used by some of the rawdev APIs for IOAT rawdev > +devices, as well as providing key functions for using the device for memory > +copies. > + > +Getting Device Information > +~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Basic information about each rawdev device can be got using the According to certain unreliable sources [1], usage of "can be got" has not been used since the end of 19th century. I didn't think you were *that* old, Bruce! > +``rte_rawdev_info_get()`` API. For most applications, this API will be > +needed to verify that the rawdev in question is of the expected type. For > +example, the following code in ``test_ioat_rawdev.c`` is used to identify > +the IOAT rawdev device for use for the tests: > + > +.. code-block:: C > + > + for (i = 0; i < count && !found; i++) { > + struct rte_rawdev_info info = { .dev_private = NULL }; > + found = (rte_rawdev_info_get(i, &info) == 0 && > + strcmp(info.driver_name, > + IOAT_PMD_RAWDEV_NAME_STR) == 0); > + } The code here doesn't match the actual implementation in the autotest. -- Thanks, Anatoly