From: Aaron Conole <aconole@redhat.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, jiayu.hu@intel.com,
Anatoly Burakov <anatoly.burakov@intel.com>,
Harry van Haaren <harry.van.haaren@intel.com>
Subject: Re: [dpdk-dev] [PATCH v5 7/9] raw/ioat: add configure, start and stop functions
Date: Wed, 03 Jul 2019 16:26:45 -0400 [thread overview]
Message-ID: <f7tblyayid6.fsf@dhcp-25.97.bos.redhat.com> (raw)
In-Reply-To: <20190703164400.GA416@bricha3-MOBL.ger.corp.intel.com> (Bruce Richardson's message of "Wed, 3 Jul 2019 17:44:00 +0100")
Bruce Richardson <bruce.richardson@intel.com> writes:
> On Wed, Jul 03, 2019 at 12:21:39PM -0400, Aaron Conole wrote:
>> Bruce Richardson <bruce.richardson@intel.com> writes:
>>
>> > Allow initializing a driver instance. Include selftest to validate
>> > these functions.
>> >
>> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by:
>> > Anatoly Burakov <anatoly.burakov@intel.com> Tested-by: Harry van Haaren
>> > <harry.van.haaren@intel.com> ---
>> >
>> > V4: Guarantee correct SUCCESS/FAILURE return values from test function
>> > Use memzone rather than malloc for ring allocation so we can guarantee
>> > contiguous memory. V3: don't add a new descriptor format struct, reuse
>> > from rte_ioat_spec.h V2: test cases placed in self-test routine ---
>> > app/test/test_rawdev.c | 3 +-
>> > doc/guides/rawdevs/ioat_rawdev.rst | 32 +++++++++++
>> > drivers/raw/ioat/Makefile | 1 +
>> > drivers/raw/ioat/ioat_rawdev.c | 82 +++++++++++++++++++++++++++++
>> > drivers/raw/ioat/ioat_rawdev_test.c | 41 +++++++++++++++
>> > drivers/raw/ioat/meson.build | 3 +-
>> > drivers/raw/ioat/rte_ioat_rawdev.h | 2 + 7 files changed, 162
>> > insertions(+), 2 deletions(-) create mode 100644
>> > drivers/raw/ioat/ioat_rawdev_test.c
>> >
>> > diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c index
>> > 623117af9..524a9d5f3 100644 --- a/app/test/test_rawdev.c +++
>> > b/app/test/test_rawdev.c @@ -36,7 +36,8 @@
>> > test_rawdev_selftest_ioat(void) struct rte_rawdev_info info = {
>> > .dev_private = NULL }; if (rte_rawdev_info_get(i, &info) == 0 &&
>> > strstr(info.driver_name, "ioat") != NULL) - return
>> > TEST_SUCCESS; + return rte_rawdev_selftest(i) == 0
>> > ? + TEST_SUCCESS : TEST_FAILED;
>> > }
>> >
>> > printf("No IOAT rawdev found, skipping tests\n"); diff --git
>> > a/doc/guides/rawdevs/ioat_rawdev.rst
>> > b/doc/guides/rawdevs/ioat_rawdev.rst index efed9c64c..a0594d2cb
>> > 100644 --- a/doc/guides/rawdevs/ioat_rawdev.rst +++
>> > b/doc/guides/rawdevs/ioat_rawdev.rst @@ -117,3 +117,35 @@ the
>> > ``dev_private`` field in the ``rte_rawdev_info`` struct should
>> > either be NULL, or else be set to point to a structure of type
>> > ``rte_ioat_rawdev_config``, in which case the size of the
>> > configured device input ring will be returned in that structure. +
>> > +Device Configuration +~~~~~~~~~~~~~~~~~~~~~ + +Configuring an IOAT
>> > rawdev device is done using the +``rte_rawdev_configure()`` API,
>> > which takes the same structure parameters +as the, previously
>> > referenced, ``rte_rawdev_info_get()`` API. The main +difference is
>> > that, because the parameter is used as input rather than +output,
>> > the ``dev_private`` structure element cannot be NULL, and must
>> > +point to a valid ``rte_ioat_rawdev_config`` structure, containing
>> > the ring +size to be used by the device. The ring size must be a
>> > power of two, +between 64 and 4096. + +The following code shows
>> > how the device is configured in +``test_ioat_rawdev.c``: + +..
>> > code-block:: C + + #define IOAT_TEST_RINGSIZE 512 + struct
>> > rte_ioat_rawdev_config p = { .ring_size = -1 }; + struct
>> > rte_rawdev_info info = { .dev_private = &p }; + + /* ... */
>> > + + p.ring_size = IOAT_TEST_RINGSIZE; + if
>> > (rte_rawdev_configure(dev_id, &info) != 0) { +
>> > printf("Error with rte_rawdev_configure()\n"); +
>> > return -1; + } + +Once configured, the device can then be
>> > made ready for use by calling the +``rte_rawdev_start()`` API.
>> > diff --git a/drivers/raw/ioat/Makefile b/drivers/raw/ioat/Makefile
>> > index 1e10938f3..b1af9c666 100644 --- a/drivers/raw/ioat/Makefile
>> > +++ b/drivers/raw/ioat/Makefile @@ -21,6 +21,7 @@ EXPORT_MAP :=
>> > rte_pmd_ioat_version.map
>> >
>> > # library source files SRCS-$(CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV) +=
>> > ioat_rawdev.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV) +=
>> > ioat_rawdev_test.c
>> >
>> > # export include files SYMLINK-y-include += rte_ioat_rawdev.h diff
>> > --git a/drivers/raw/ioat/ioat_rawdev.c
>> > b/drivers/raw/ioat/ioat_rawdev.c index 2bfe2544d..0c91b3579 100644 ---
>> > a/drivers/raw/ioat/ioat_rawdev.c +++ b/drivers/raw/ioat/ioat_rawdev.c
>> > @@ -34,6 +34,81 @@ 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)
>> >
>> > +#define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc) +#define
>> > COMPLETION_SZ sizeof(__m128i) + +static int +ioat_dev_configure(const
>> > struct rte_rawdev *dev, rte_rawdev_obj_t config) +{ + struct
>> > rte_ioat_rawdev_config *params = config; + struct rte_ioat_rawdev
>> > *ioat = dev->dev_private; + char mz_name[RTE_MEMZONE_NAMESIZE]; +
>> > unsigned short i; + + if (dev->started) + return
>> > -EBUSY; + + if (params == NULL) + return -EINVAL; + + if
>> > (params->ring_size > 4096 || params->ring_size < 64 || +
>> > !rte_is_power_of_2(params->ring_size)) + return -EINVAL; + +
>> > ioat->ring_size = params->ring_size; + if (ioat->desc_ring !=
>> > NULL) { + rte_memzone_free(ioat->desc_mz); +
>> > ioat->desc_ring = NULL; + ioat->desc_mz = NULL; + } + + /*
>> > allocate one block of memory for both descriptors + * and completion
>> > handles. + */ + snprintf(mz_name, sizeof(mz_name),
>> > "rawdev%u_desc_ring", dev->dev_id); + ioat->desc_mz =
>> > rte_memzone_reserve(mz_name, + (DESC_SZ +
>> > COMPLETION_SZ) * ioat->ring_size, +
>> > dev->device->numa_node, RTE_MEMZONE_IOVA_CONTIG); + if (ioat->desc_mz
>> > == NULL) + return -ENOMEM; + ioat->desc_ring =
>> > ioat->desc_mz->addr; + ioat->hdls = (void
>> > *)&ioat->desc_ring[ioat->ring_size]; + + ioat->ring_addr =
>> > ioat->desc_mz->iova; + + /* configure descriptor ring - each one
>> > points to next */ + for (i = 0; i < ioat->ring_size; i++) { +
>> > ioat->desc_ring[i].next = ioat->ring_addr + +
>> > (((i + 1) % ioat->ring_size) * DESC_SZ); + } + + return 0; +} +
>> > +static int +ioat_dev_start(struct rte_rawdev *dev) +{ + struct
>> > rte_ioat_rawdev *ioat = dev->dev_private; + + if (ioat->ring_size
>> > == 0 || ioat->desc_ring == NULL) + return -EBUSY; + + /*
>> > inform hardware of where the descriptor ring is */ +
>> > ioat->regs->chainaddr = ioat->ring_addr; + /* inform hardware of where
>> > to write the status/completions */ + ioat->regs->chancmp =
>> > ioat->status_addr; + + /* prime the status register to be set to
>> > the last element */ + ioat->status = ioat->ring_addr +
>> > ((ioat->ring_size - 1) * DESC_SZ); + return 0; +} + +static void
>> > +ioat_dev_stop(struct rte_rawdev *dev) +{ + RTE_SET_USED(dev); +} +
>> > static void ioat_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t
>> > dev_info) { @@ -44,11 +119,17 @@ ioat_dev_info_get(struct rte_rawdev
>> > *dev, rte_rawdev_obj_t dev_info) cfg->ring_size = ioat->ring_size; }
>> >
>> > +extern int ioat_rawdev_test(uint16_t dev_id); +
>>
>> This signature doesn't match with the rte_rawdev_ops definition (which
>> should be int(*func)(void)).
>>
>> It will generate an error as such:
>>
>> ../drivers/raw/ioat/ioat_rawdev.c:176:20: error: initialization from
>> incompatible pointer type [-Werror=incompatible-pointer-types]
>> .dev_selftest = ioat_rawdev_test, ^
>> ../drivers/raw/ioat/ioat_rawdev.c:176:20: note: (near initialization for
>> ‘ioat_rawdev_ops.dev_selftest’)
>>
> That was changed by commit 863fd2930bbe ("rawdev: pass the device id as
> parameter to selftest") which was part of the patchset on which this set
> depended.
Strange - the robot didn't pick that commit up. Was this submitted
before that commit was live?
> /Bruce
next prev parent reply other threads:[~2019-07-03 20:26 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 21:25 [dpdk-dev] [PATCH 0/8] raw/ioat: driver for Intel QuickData Technology Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 1/8] raw/ioat: add initial support for ioat rawdev driver Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 2/8] usertools/dpdk-devbind.py: add support for IOAT devices Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 3/8] raw/ioat: add register definition file Bruce Richardson
2019-05-30 23:53 ` Stephen Hemminger
2019-06-06 13:19 ` Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 4/8] raw/ioat: create device on probe and destroy on release Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 5/8] raw/ioat: add device info function Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 6/8] raw/ioat: add configure, start and stop functions Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 7/8] raw/ioat: add statistics functions Bruce Richardson
2019-05-30 21:25 ` [dpdk-dev] [PATCH 8/8] raw/ioat: add local API to perform copies Bruce Richardson
2019-06-03 14:44 ` Thomas Monjalon
2019-06-04 12:23 ` Bruce Richardson
2019-06-05 13:52 ` Jerin Jacob Kollanukkaran
2019-06-05 13:57 ` Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 0/8] raw/ioat: driver for Intel QuickData Technology Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 1/8] raw/ioat: add initial support for ioat rawdev driver Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 2/8] usertools/dpdk-devbind.py: add support for IOAT devices Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 3/8] raw/ioat: add register definition file Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 4/8] raw/ioat: create device on probe and destroy on release Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 5/8] raw/ioat: add device info function Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 6/8] raw/ioat: add configure, start and stop functions Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 7/8] raw/ioat: add statistics functions Bruce Richardson
2019-06-25 14:58 ` [dpdk-dev] [PATCH v2 8/8] raw/ioat: add local API to perform copies Bruce Richardson
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 0/8] raw/ioat: driver for Intel QuickData Technology Bruce Richardson
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 1/8] raw/ioat: add initial support for ioat rawdev driver Bruce Richardson
2019-06-27 11:55 ` Burakov, Anatoly
2019-06-28 12:43 ` Bruce Richardson
2019-07-01 7:38 ` Hu, Jiayu
2019-07-01 7:51 ` Thomas Monjalon
2019-07-01 8:29 ` Hu, Jiayu
2019-07-01 14:30 ` Bruce Richardson
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 2/8] usertools/dpdk-devbind.py: add support for IOAT devices Bruce Richardson
2019-06-27 11:57 ` Burakov, Anatoly
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 3/8] raw/ioat: add register definition file Bruce Richardson
2019-06-27 12:01 ` Burakov, Anatoly
2019-06-28 12:44 ` Bruce Richardson
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 4/8] raw/ioat: create device on probe and destroy on release Bruce Richardson
2019-06-27 12:09 ` Burakov, Anatoly
2019-06-28 16:21 ` Bruce Richardson
2019-06-27 12:28 ` Burakov, Anatoly
2019-06-28 12:46 ` Bruce Richardson
2019-06-28 12:59 ` Burakov, Anatoly
2019-06-28 13:15 ` Bruce Richardson
2019-06-28 13:28 ` Burakov, Anatoly
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 5/8] raw/ioat: add device info function Bruce Richardson
2019-06-27 12:16 ` Burakov, Anatoly
2019-06-28 21:09 ` Bruce Richardson
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 6/8] raw/ioat: add configure, start and stop functions Bruce Richardson
2019-06-27 12:29 ` Burakov, Anatoly
2019-06-27 16:37 ` Pattan, Reshma
2019-06-28 21:21 ` Bruce Richardson
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 7/8] raw/ioat: add statistics functions Bruce Richardson
2019-06-27 12:38 ` Burakov, Anatoly
2019-07-01 10:11 ` Pattan, Reshma
2019-07-01 12:56 ` Bruce Richardson
2019-06-27 10:40 ` [dpdk-dev] [PATCH v3 8/8] raw/ioat: add local API to perform copies Bruce Richardson
2019-06-27 12:45 ` Burakov, Anatoly
2019-06-27 15:34 ` [dpdk-dev] [PATCH v3 0/8] raw/ioat: driver for Intel QuickData Technology Van Haaren, Harry
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 0/9] " Bruce Richardson
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 1/9] rawdev: allow devices to skip extra memory allocation Bruce Richardson
2019-07-02 11:34 ` Hemant Agrawal
2019-07-02 11:43 ` Shreyansh Jain
2019-07-02 12:41 ` Bruce Richardson
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 2/9] raw/ioat: add initial support for ioat rawdev driver Bruce Richardson
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 3/9] usertools/dpdk-devbind.py: add support for IOAT devices Bruce Richardson
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 4/9] raw/ioat: add register definition file Bruce Richardson
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 5/9] raw/ioat: create device on probe and destroy on release Bruce Richardson
2019-07-02 9:39 ` Burakov, Anatoly
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 6/9] raw/ioat: add device info function Bruce Richardson
2019-07-02 2:33 ` Hu, Jiayu
2019-07-02 8:28 ` Bruce Richardson
2019-07-02 9:40 ` Burakov, Anatoly
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 7/9] raw/ioat: add configure, start and stop functions Bruce Richardson
2019-07-02 9:49 ` Burakov, Anatoly
2019-07-02 9:59 ` Bruce Richardson
2019-07-01 15:55 ` [dpdk-dev] [PATCH v4 8/9] raw/ioat: add statistics functions Bruce Richardson
2019-07-02 9:50 ` Burakov, Anatoly
2019-07-01 15:56 ` [dpdk-dev] [PATCH v4 9/9] raw/ioat: add local API to perform copies Bruce Richardson
2019-07-01 15:58 ` [dpdk-dev] [PATCH v4 0/9] raw/ioat: driver for Intel QuickData Technology Bruce Richardson
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 " Bruce Richardson
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 1/9] rawdev: allow devices to skip extra memory allocation Bruce Richardson
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 2/9] raw/ioat: add initial support for ioat rawdev driver Bruce Richardson
2019-07-03 1:53 ` Hu, Jiayu
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 3/9] usertools/dpdk-devbind.py: add support for IOAT devices Bruce Richardson
2019-07-03 1:54 ` Hu, Jiayu
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 4/9] raw/ioat: add register definition file Bruce Richardson
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 5/9] raw/ioat: create device on probe and destroy on release Bruce Richardson
2019-07-03 1:57 ` Hu, Jiayu
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 6/9] raw/ioat: add device info function Bruce Richardson
2019-07-03 1:58 ` Hu, Jiayu
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 7/9] raw/ioat: add configure, start and stop functions Bruce Richardson
2019-07-03 1:59 ` Hu, Jiayu
2019-07-03 16:21 ` Aaron Conole
2019-07-03 16:44 ` Bruce Richardson
2019-07-03 20:26 ` Aaron Conole [this message]
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 8/9] raw/ioat: add statistics functions Bruce Richardson
2019-07-03 2:00 ` Hu, Jiayu
2019-07-02 14:12 ` [dpdk-dev] [PATCH v5 9/9] raw/ioat: add local API to perform copies Bruce Richardson
2019-07-03 2:01 ` Hu, Jiayu
2019-07-04 7:45 ` [dpdk-dev] [PATCH v5 0/9] raw/ioat: driver for Intel QuickData Technology Thomas Monjalon
2019-07-04 22:17 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7tblyayid6.fsf@dhcp-25.97.bos.redhat.com \
--to=aconole@redhat.com \
--cc=anatoly.burakov@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=harry.van.haaren@intel.com \
--cc=jiayu.hu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).