Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/75835/?format=api
http://patchwork.dpdk.org/api/patches/75835/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200821162944.29840-11-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20200821162944.29840-11-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200821162944.29840-11-bruce.richardson@intel.com", "date": "2020-08-21T16:29:36", "name": "[v2,10/18] raw/ioat: add datapath data structures for idxd devices", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4e0ee5ed22929527ad7d66f13411ec5aaa060c2b", "submitter": { "id": 20, "url": "http://patchwork.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200821162944.29840-11-bruce.richardson@intel.com/mbox/", "series": [ { "id": 11744, "url": "http://patchwork.dpdk.org/api/series/11744/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=11744", "date": "2020-08-21T16:29:26", "name": "raw/ioat: enhancements and new hardware support", "version": 2, "mbox": "http://patchwork.dpdk.org/series/11744/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/75835/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/75835/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id F119BA04AF;\n\tFri, 21 Aug 2020 18:31:54 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7DA391C131;\n\tFri, 21 Aug 2020 18:30:33 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id F2B1B1C12F\n for <dev@dpdk.org>; Fri, 21 Aug 2020 18:30:30 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Aug 2020 09:30:30 -0700", "from silpixa00399126.ir.intel.com ([10.237.222.56])\n by orsmga006.jf.intel.com with ESMTP; 21 Aug 2020 09:30:28 -0700" ], "IronPort-SDR": [ "\n Kpc6v13rl+2UIUjSJNYU6u/5oZYTvnERTDXSDf1YvbURtx3sJtrbXQbXYCY+JlDtBIc7fqW7dW\n GVT1Eko6KODA==", "\n asjjUn9y6XVlLX4tH6MEAkyk5KhYrEKMaD7oO2fkP2eOf7w8BJZ7VgPdSy5P1j1qoK3mrRuzTl\n XbiGCZSv/Dhg==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9719\"; a=\"173615866\"", "E=Sophos;i=\"5.76,337,1592895600\"; d=\"scan'208\";a=\"173615866\"", "E=Sophos;i=\"5.76,337,1592895600\"; d=\"scan'208\";a=\"297992851\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "cheng1.jiang@intel.com, patrick.fu@intel.com, ping.yu@intel.com,\n kevin.laatz@intel.com, Bruce Richardson <bruce.richardson@intel.com>", "Date": "Fri, 21 Aug 2020 17:29:36 +0100", "Message-Id": "<20200821162944.29840-11-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200821162944.29840-1-bruce.richardson@intel.com>", "References": "<20200721095140.719297-1-bruce.richardson@intel.com>\n <20200821162944.29840-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 10/18] raw/ioat: add datapath data structures\n\tfor idxd devices", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add in the relevant data structures for the data path for DSA devices. Also\ninclude a device dump function to output the status of each device.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n drivers/raw/ioat/idxd_pci.c | 3 +-\n drivers/raw/ioat/idxd_vdev.c | 1 +\n drivers/raw/ioat/ioat_common.c | 34 +++++++++++\n drivers/raw/ioat/ioat_private.h | 2 +\n drivers/raw/ioat/ioat_rawdev_test.c | 3 +-\n drivers/raw/ioat/rte_ioat_rawdev_fns.h | 80 ++++++++++++++++++++++++++\n 6 files changed, 121 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c\nindex 72f4ecebb7..ce238ae04c 100644\n--- a/drivers/raw/ioat/idxd_pci.c\n+++ b/drivers/raw/ioat/idxd_pci.c\n@@ -52,7 +52,8 @@ idxd_is_wq_enabled(struct idxd_rawdev *idxd)\n }\n \n static const struct rte_rawdev_ops idxd_pci_ops = {\n-\t\t.dev_selftest = idxd_rawdev_test\n+\t\t.dev_selftest = idxd_rawdev_test,\n+\t\t.dump = idxd_dev_dump,\n };\n \n /* each portal uses 4 x 4k pages */\ndiff --git a/drivers/raw/ioat/idxd_vdev.c b/drivers/raw/ioat/idxd_vdev.c\nindex 93c023a6e8..0f9aa48e84 100644\n--- a/drivers/raw/ioat/idxd_vdev.c\n+++ b/drivers/raw/ioat/idxd_vdev.c\n@@ -32,6 +32,7 @@ struct idxd_vdev_args {\n \n static const struct rte_rawdev_ops idxd_vdev_ops = {\n \t\t.dev_selftest = idxd_rawdev_test,\n+\t\t.dump = idxd_dev_dump,\n };\n \n static void *\ndiff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c\nindex 37a14e514d..fb4f7055de 100644\n--- a/drivers/raw/ioat/ioat_common.c\n+++ b/drivers/raw/ioat/ioat_common.c\n@@ -7,6 +7,36 @@\n \n #include \"ioat_private.h\"\n \n+int\n+idxd_dev_dump(struct rte_rawdev *dev, FILE *f)\n+{\n+\tstruct idxd_rawdev *idxd = dev->dev_private;\n+\tstruct rte_idxd_rawdev *rte_idxd = &idxd->public;\n+\tint i;\n+\n+\tfprintf(f, \"Raw Device #%d\\n\", dev->dev_id);\n+\tfprintf(f, \"Driver: %s\\n\\n\", dev->driver_name);\n+\n+\tfprintf(f, \"Portal: %p\\n\", rte_idxd->portal);\n+\tfprintf(f, \"Batch Ring size: %u\\n\", rte_idxd->batch_ring_sz);\n+\tfprintf(f, \"Comp Handle Ring size: %u\\n\\n\", rte_idxd->hdl_ring_sz);\n+\n+\tfprintf(f, \"Next batch: %u\\n\", rte_idxd->next_batch);\n+\tfprintf(f, \"Next batch to be completed: %u\\n\", rte_idxd->next_completed);\n+\tfor (i = 0; i < rte_idxd->batch_ring_sz; i++) {\n+\t\tstruct rte_idxd_desc_batch *b = &rte_idxd->batch_ring[i];\n+\t\tfprintf(f, \"Batch %u @%p: submitted=%u, op_count=%u, hdl_end=%u\\n\",\n+\t\t\t\ti, b, b->submitted, b->op_count, b->hdl_end);\n+\t}\n+\n+\tfprintf(f, \"\\n\");\n+\tfprintf(f, \"Next free hdl: %u\\n\", rte_idxd->next_free_hdl);\n+\tfprintf(f, \"Last completed hdl: %u\\n\", rte_idxd->last_completed_hdl);\n+\tfprintf(f, \"Next returned hdl: %u\\n\", rte_idxd->next_ret_hdl);\n+\n+\treturn 0;\n+}\n+\n int\n idxd_rawdev_create(const char *name, struct rte_device *dev,\n \t\t const struct idxd_rawdev *base_idxd,\n@@ -18,6 +48,10 @@ idxd_rawdev_create(const char *name, struct rte_device *dev,\n \tchar mz_name[RTE_MEMZONE_NAMESIZE];\n \tint ret = 0;\n \n+\tRTE_BUILD_BUG_ON(sizeof(struct rte_idxd_hw_desc) != 64);\n+\tRTE_BUILD_BUG_ON(offsetof(struct rte_idxd_hw_desc, size) != 32);\n+\tRTE_BUILD_BUG_ON(sizeof(struct rte_idxd_completion) != 32);\n+\n \tif (!name) {\n \t\tIOAT_PMD_ERR(\"Invalid name of the device!\");\n \t\tret = -EINVAL;\ndiff --git a/drivers/raw/ioat/ioat_private.h b/drivers/raw/ioat/ioat_private.h\nindex bd2bef3834..974eeb0106 100644\n--- a/drivers/raw/ioat/ioat_private.h\n+++ b/drivers/raw/ioat/ioat_private.h\n@@ -59,4 +59,6 @@ extern int idxd_rawdev_create(const char *name, struct rte_device *dev,\n \n extern int idxd_rawdev_test(uint16_t dev_id);\n \n+extern int idxd_dev_dump(struct rte_rawdev *dev, FILE *f);\n+\n #endif /* _IOAT_PRIVATE_H_ */\ndiff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c\nindex 4f14b3d1bd..082b3091c4 100644\n--- a/drivers/raw/ioat/ioat_rawdev_test.c\n+++ b/drivers/raw/ioat/ioat_rawdev_test.c\n@@ -271,7 +271,8 @@ ioat_rawdev_test(uint16_t dev_id)\n }\n \n int\n-idxd_rawdev_test(uint16_t dev_id __rte_unused)\n+idxd_rawdev_test(uint16_t dev_id)\n {\n+\trte_rawdev_dump(dev_id, stdout);\n \treturn 0;\n }\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\nindex db377fbfa7..d258ad9fd2 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n@@ -88,6 +88,86 @@ struct rte_ioat_rawdev {\n #define RTE_IOAT_CHANSTS_HALTED\t\t0x3\n #define RTE_IOAT_CHANSTS_ARMED\t\t\t0x4\n \n+/*\n+ * Defines used in the data path for interacting with hardware.\n+ */\n+#define IDXD_CMD_OP_SHIFT 24\n+enum rte_idxd_ops {\n+\tidxd_op_nop = 0,\n+\tidxd_op_batch,\n+\tidxd_op_drain,\n+\tidxd_op_memmove,\n+\tidxd_op_fill\n+};\n+\n+#define IDXD_FLAG_FENCE (1 << 0)\n+#define IDXD_FLAG_COMPLETION_ADDR_VALID (1 << 2)\n+#define IDXD_FLAG_REQUEST_COMPLETION (1 << 3)\n+#define IDXD_FLAG_CACHE_CONTROL (1 << 8)\n+\n+/**\n+ * Hardware descriptor used by DSA hardware, for both bursts and\n+ * for individual operations.\n+ */\n+struct rte_idxd_hw_desc {\n+\tuint32_t pasid;\n+\tuint32_t op_flags;\n+\trte_iova_t completion;\n+\n+\tRTE_STD_C11\n+\tunion {\n+\t\trte_iova_t src; /* source address for copy ops etc. */\n+\t\trte_iova_t desc_addr; /* descriptor pointer for batch */\n+\t};\n+\trte_iova_t dst;\n+\n+\tuint32_t size; /* length of data for op, or batch size */\n+\n+\t/* 28 bytes of padding here */\n+} __rte_aligned(64);\n+\n+/**\n+ * Completion record structure written back by DSA\n+ */\n+struct rte_idxd_completion {\n+\tuint8_t status;\n+\tuint8_t result;\n+\t/* 16-bits pad here */\n+\tuint32_t completed_size; /* data length, or descriptors for batch */\n+\n+\trte_iova_t fault_address;\n+\tuint32_t invalid_flags;\n+} __rte_aligned(32);\n+\n+#define BATCH_SIZE 64\n+\n+/**\n+ * Structure used inside the driver for building up and submitting\n+ * a batch of operations to the DSA hardware.\n+ */\n+struct rte_idxd_desc_batch {\n+\tstruct rte_idxd_completion comp; /* the completion record for batch */\n+\n+\tuint16_t submitted;\n+\tuint16_t op_count;\n+\tuint16_t hdl_end;\n+\n+\tstruct rte_idxd_hw_desc batch_desc;\n+\n+\t/* batches must always have 2 descriptors, so put a null at the start */\n+\tstruct rte_idxd_hw_desc null_desc;\n+\tstruct rte_idxd_hw_desc ops[BATCH_SIZE];\n+};\n+\n+/**\n+ * structure used to save the \"handles\" provided by the user to be\n+ * returned to the user on job completion.\n+ */\n+struct rte_idxd_user_hdl {\n+\tuint64_t src;\n+\tuint64_t dst;\n+};\n+\n /**\n * @internal\n * Structure representing an IDXD device instance\n", "prefixes": [ "v2", "10/18" ] }{ "id": 75835, "url": "