Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/55319/?format=api
http://patches.dpdk.org/api/patches/55319/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190625145811.22154-6-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20190625145811.22154-6-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190625145811.22154-6-bruce.richardson@intel.com", "date": "2019-06-25T14:58:08", "name": "[v2,5/8] raw/ioat: add device info function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "851e257b0a4f9727a0a7bdbce45564488de8a6bf", "submitter": { "id": 20, "url": "http://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190625145811.22154-6-bruce.richardson@intel.com/mbox/", "series": [ { "id": 5158, "url": "http://patches.dpdk.org/api/series/5158/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5158", "date": "2019-06-25T14:58:03", "name": "raw/ioat: driver for Intel QuickData Technology", "version": 2, "mbox": "http://patches.dpdk.org/series/5158/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/55319/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/55319/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B41711BACD;\n\tTue, 25 Jun 2019 16:58:40 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 163871BA7F\n\tfor <dev@dpdk.org>; Tue, 25 Jun 2019 16:58:30 +0200 (CEST)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jun 2019 07:58:29 -0700", "from silpixa00399126.ir.intel.com (HELO\n\tsilpixa00399126.ger.corp.intel.com) ([10.237.223.2])\n\tby fmsmga006.fm.intel.com with ESMTP; 25 Jun 2019 07:58:28 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.63,416,1557212400\"; d=\"scan'208\";a=\"360422232\"", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, jerinj@marvell.com,\n\tBruce Richardson <bruce.richardson@intel.com>", "Date": "Tue, 25 Jun 2019 15:58:08 +0100", "Message-Id": "<20190625145811.22154-6-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190625145811.22154-1-bruce.richardson@intel.com>", "References": "<20190530212525.40370-1-bruce.richardson@intel.com>\n\t<20190625145811.22154-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 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>,\n\t<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>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add in the \"info_get\" function to the driver, to allow us to query the\ndevice. This allows us to have the unit test pick up the presence of\nsupported hardware or not.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n\n---\n\nV2: Test case is placed in driver self-test routine\n---\n app/test/test_rawdev.c | 11 ++++++++++\n doc/guides/rawdevs/ioat_rawdev.rst | 34 ++++++++++++++++++++++++++++++\n drivers/raw/ioat/ioat_rawdev.c | 11 ++++++++++\n drivers/raw/ioat/rte_ioat_rawdev.h | 11 ++++++++++\n 4 files changed, 67 insertions(+)", "diff": "diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c\nindex 88549fb61..4db762b4c 100644\n--- a/app/test/test_rawdev.c\n+++ b/app/test/test_rawdev.c\n@@ -29,6 +29,17 @@ REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftest_skeleton);\n static int\n test_rawdev_selftest_ioat(void)\n {\n+\tconst int count = rte_rawdev_count();\n+\tint i;\n+\n+\tfor (i = 0; i < count; i++) {\n+\t\tstruct rte_rawdev_info info = { .dev_private = NULL };\n+\t\tif (rte_rawdev_info_get(i, &info) == 0 &&\n+\t\t\t\tstrstr(info.driver_name, \"ioat\") != NULL)\n+\t\t\treturn 0;\n+\t}\n+\n+\tprintf(\"No IOAT rawdev found, skipping tests\\n\");\n \treturn TEST_SKIPPED;\n }\n \ndiff --git a/doc/guides/rawdevs/ioat_rawdev.rst b/doc/guides/rawdevs/ioat_rawdev.rst\nindex 4b7fe8a8f..0ce984490 100644\n--- a/doc/guides/rawdevs/ioat_rawdev.rst\n+++ b/doc/guides/rawdevs/ioat_rawdev.rst\n@@ -83,3 +83,37 @@ parameters need to be passed to create or initialize the device.\n Once probed successfully, the device will appear as a ``rawdev``, that is a\n \"raw device type\" inside DPDK, and can be accessed using APIs from the\n ``rte_rawdev`` library.\n+\n+Using IOAT Rawdev Devices\n+--------------------------\n+\n+To use the devices from an application, the rawdev API can be used, along\n+with definitions taken from the device-specific header file\n+``rte_ioat_rawdev.h``. This header is needed to get the definition of\n+structure parameters used by some of the rawdev APIs for IOAT rawdev\n+devices, as well as providing key functions for using the device for memory\n+copies.\n+\n+Getting Device Information\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Basic information about each rawdev device can be got using the\n+``rte_rawdev_info_get()`` API. For most applications, this API will be\n+needed to verify that the rawdev in question is of the expected type. For\n+example, the following code in ``test_ioat_rawdev.c`` is used to identify\n+the IOAT rawdev device for use for the tests:\n+\n+.. code-block:: C\n+\n+ for (i = 0; i < count && !found; i++) {\n+ struct rte_rawdev_info info = { .dev_private = NULL };\n+ found = (rte_rawdev_info_get(i, &info) == 0 &&\n+ strcmp(info.driver_name,\n+ IOAT_PMD_RAWDEV_NAME_STR) == 0);\n+ }\n+\n+When calling the ``rte_rawdev_info_get()`` API for an IOAT rawdev device,\n+the ``dev_private`` field in the ``rte_rawdev_info`` struct should either\n+be NULL, or else be set to point to a structure of type\n+``rte_ioat_rawdev_config``, in which case the size of the configured device\n+input ring will be returned in that structure.\ndiff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c\nindex d13391dd5..08e7586c6 100644\n--- a/drivers/raw/ioat/ioat_rawdev.c\n+++ b/drivers/raw/ioat/ioat_rawdev.c\n@@ -24,10 +24,21 @@ static struct rte_pci_driver ioat_pmd_drv;\n #define IOAT_PMD_ERR(fmt, args...) IOAT_PMD_LOG(ERR, fmt, ## args)\n #define IOAT_PMD_WARN(fmt, args...) IOAT_PMD_LOG(WARNING, fmt, ## args)\n \n+static void\n+ioat_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info)\n+{\n+\tstruct rte_ioat_rawdev_config *cfg = dev_info;\n+\tstruct rte_ioat_rawdev *ioat = dev->dev_private;\n+\n+\tif (cfg != NULL)\n+\t\tcfg->ring_size = ioat->ring_size;\n+}\n+\n static int\n ioat_rawdev_create(const char *name, struct rte_pci_device *dev)\n {\n \tstatic const struct rte_rawdev_ops ioat_rawdev_ops = {\n+\t\t\t.dev_info_get = ioat_dev_info_get,\n \t};\n \n \tstruct rte_rawdev *rawdev = NULL;\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h\nindex c3216a174..7e0d72ca3 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev.h\n@@ -24,6 +24,17 @@\n /** Name used to adjust the log level for this driver */\n #define IOAT_PMD_LOG_NAME \"rawdev.ioat\"\n \n+/**\n+ * Configuration structure for an ioat rawdev instance\n+ *\n+ * This structure is to be passed as the \".dev_private\" parameter when\n+ * calling the rte_rawdev_get_info() and rte_rawdev_configure() APIs on\n+ * an ioat rawdev instance.\n+ */\n+struct rte_ioat_rawdev_config {\n+\tunsigned short ring_size;\n+};\n+\n /**\n * @internal\n * Structure representing a device instance\n", "prefixes": [ "v2", "5/8" ] }{ "id": 55319, "url": "