Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/55878/?format=api
http://patches.dpdk.org/api/patches/55878/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190702141230.31925-7-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": "<20190702141230.31925-7-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190702141230.31925-7-bruce.richardson@intel.com", "date": "2019-07-02T14:12:27", "name": "[v5,6/9] raw/ioat: add device info function", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "8921715837589f8cf38beaea1e56cc6f80bb45d1", "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/20190702141230.31925-7-bruce.richardson@intel.com/mbox/", "series": [ { "id": 5283, "url": "http://patches.dpdk.org/api/series/5283/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5283", "date": "2019-07-02T14:12:21", "name": "raw/ioat: driver for Intel QuickData Technology", "version": 5, "mbox": "http://patches.dpdk.org/series/5283/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/55878/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/55878/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 3DAAA1B9C1;\n\tTue, 2 Jul 2019 16:13:13 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 9A1B91B9B4\n\tfor <dev@dpdk.org>; Tue, 2 Jul 2019 16:13:09 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Jul 2019 07:13:09 -0700", "from silpixa00399126.ir.intel.com (HELO\n\tsilpixa00399126.ger.corp.intel.com) ([10.237.223.2])\n\tby orsmga008.jf.intel.com with ESMTP; 02 Jul 2019 07:13:07 -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,443,1557212400\"; d=\"scan'208\";a=\"157652470\"", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "jiayu.hu@intel.com, Bruce Richardson <bruce.richardson@intel.com>,\n\tAnatoly Burakov <anatoly.burakov@intel.com>,\n\tHarry van Haaren <harry.van.haaren@intel.com>", "Date": "Tue, 2 Jul 2019 15:12:27 +0100", "Message-Id": "<20190702141230.31925-7-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190702141230.31925-1-bruce.richardson@intel.com>", "References": "<20190530212525.40370-1-bruce.richardson@intel.com>\n\t<20190702141230.31925-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v5 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 <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>\nAcked-by: Anatoly Burakov <anatoly.burakov@intel.com>\nTested-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n\nV2: Test case is placed in driver self-test routine\nV4: Use TEST_SUCCESS in place of 0, when returning from test case.\n Minor documentation updates.\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..623117af9 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 TEST_SUCCESS;\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..efed9c64c 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 queried 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 snippet can be used to identify an IOAT\n+rawdev device for use by an application:\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 86b5b2a77..2bfe2544d 100644\n--- a/drivers/raw/ioat/ioat_rawdev.c\n+++ b/drivers/raw/ioat/ioat_rawdev.c\n@@ -34,10 +34,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 f83d26ef0..1d0dbdd2e 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev.h\n@@ -25,6 +25,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": [ "v5", "6/9" ] }{ "id": 55878, "url": "