Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/59103/?format=api
http://patchwork.dpdk.org/api/patches/59103/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20190910163337.4843-2-haiyue.wang@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": "<20190910163337.4843-2-haiyue.wang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190910163337.4843-2-haiyue.wang@intel.com", "date": "2019-09-10T16:33:34", "name": "[RFC,v3,1/4] ethdev: add the API for getting burst mode information", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "73d403662fc334aa02aaaa97408cde377fe3fcde", "submitter": { "id": 1044, "url": "http://patchwork.dpdk.org/api/people/1044/?format=api", "name": "Wang, Haiyue", "email": "haiyue.wang@intel.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20190910163337.4843-2-haiyue.wang@intel.com/mbox/", "series": [ { "id": 6363, "url": "http://patchwork.dpdk.org/api/series/6363/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=6363", "date": "2019-09-10T16:33:33", "name": "get Rx/Tx packet burst mode information", "version": 3, "mbox": "http://patchwork.dpdk.org/series/6363/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/59103/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/59103/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 969231EF42;\n\tTue, 10 Sep 2019 18:39:14 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 52A451EDB4\n\tfor <dev@dpdk.org>; Tue, 10 Sep 2019 18:39:10 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Sep 2019 09:39:09 -0700", "from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.115])\n\tby orsmga008.jf.intel.com with ESMTP; 10 Sep 2019 09:39:08 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.64,490,1559545200\"; d=\"scan'208\";a=\"178732643\"", "From": "Haiyue Wang <haiyue.wang@intel.com>", "To": "dev@dpdk.org, ferruh.yigit@intel.com, mdr@ashroe.eu,\n\tchenmin.sun@intel.com", "Cc": "Haiyue Wang <haiyue.wang@intel.com>", "Date": "Wed, 11 Sep 2019 00:33:34 +0800", "Message-Id": "<20190910163337.4843-2-haiyue.wang@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190910163337.4843-1-haiyue.wang@intel.com>", "References": "<20190910163337.4843-1-haiyue.wang@intel.com>", "Subject": "[dpdk-dev] [RFC v3 1/4] ethdev: add the API for getting burst mode\n\tinformation", "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": "Some PMDs have more than one RX/TX burst paths, add the ethdev API\nthat allows an application to retrieve the mode information about\nRx/Tx packet burst such as Scalar or Vector, and Vector technology\nlike AVX2.\n\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n doc/guides/rel_notes/release_19_11.rst | 8 +++\n lib/librte_ethdev/rte_ethdev.c | 75 ++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev.h | 82 ++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_core.h | 5 ++\n lib/librte_ethdev/rte_ethdev_version.map | 5 ++\n 5 files changed, 175 insertions(+)", "diff": "diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst\nindex 27cfbd9e3..1d80e50fb 100644\n--- a/doc/guides/rel_notes/release_19_11.rst\n+++ b/doc/guides/rel_notes/release_19_11.rst\n@@ -56,6 +56,14 @@ New Features\n Also, make sure to start the actual text at the margin.\n =========================================================\n \n+* **Added RX/TX packet burst mode get API.**\n+\n+ Added two new functions ``rte_eth_rx_burst_mode_get`` and\n+ ``rte_eth_tx_burst_mode_get`` that allow an application\n+ to retrieve the mode information about RX/TX packet burst\n+ such as Scalar or Vector, and Vector technology like AVX2.\n+ Another new function ``rte_eth_burst_mode_option_name`` is\n+ provided for burst mode options stringification.\n \n Removed Items\n -------------\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 17d183e1f..aac0a81e9 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -4082,6 +4082,81 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,\n \treturn 0;\n }\n \n+int\n+rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,\n+\t\t\t struct rte_eth_burst_mode *mode)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tif (mode == NULL)\n+\t\treturn -EINVAL;\n+\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (queue_id >= dev->data->nb_rx_queues) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid RX queue_id=%u\\n\", queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_burst_mode_get, -ENOTSUP);\n+\n+\tmemset(mode, 0, sizeof(*mode));\n+\tdev->dev_ops->rx_burst_mode_get(dev, queue_id, mode);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,\n+\t\t\t struct rte_eth_burst_mode *mode)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tif (mode == NULL)\n+\t\treturn -EINVAL;\n+\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (queue_id >= dev->data->nb_tx_queues) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid TX queue_id=%u\\n\", queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_burst_mode_get, -ENOTSUP);\n+\n+\tmemset(mode, 0, sizeof(*mode));\n+\tdev->dev_ops->tx_burst_mode_get(dev, queue_id, mode);\n+\n+\treturn 0;\n+}\n+\n+const char *\n+rte_eth_burst_mode_option_name(uint64_t option)\n+{\n+\tswitch (option) {\n+\tcase RTE_ETH_BURST_SCALAR: return \"Scalar\";\n+\tcase RTE_ETH_BURST_VECTOR: return \"Vector\";\n+\n+\tcase RTE_ETH_BURST_ALTIVEC: return \"AltiVec\";\n+\tcase RTE_ETH_BURST_NEON: return \"Neon\";\n+\tcase RTE_ETH_BURST_SSE: return \"SSE\";\n+\tcase RTE_ETH_BURST_AVX2: return \"AVX2\";\n+\tcase RTE_ETH_BURST_AVX512: return \"AVX512\";\n+\n+\tcase RTE_ETH_BURST_SCATTERED: return \"Scattered\";\n+\tcase RTE_ETH_BURST_BULK_ALLOC: return \"Bulk Alloc\";\n+\tcase RTE_ETH_BURST_SIMPLE: return \"Simple\";\n+\n+\tcase RTE_ETH_BURST_PER_QUEUE: return \"Per Queue\";\n+\t}\n+\n+\treturn \"\";\n+}\n+\n int\n rte_eth_dev_set_mc_addr_list(uint16_t port_id,\n \t\t\t struct rte_ether_addr *mc_addr_set,\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex d9871782e..1c5c23160 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -1212,6 +1212,32 @@ struct rte_eth_txq_info {\n \tuint16_t nb_desc; /**< configured number of TXDs. */\n } __rte_cache_min_aligned;\n \n+enum rte_eth_burst_mode_option {\n+\tRTE_ETH_BURST_SCALAR = (1 << 0),\n+\tRTE_ETH_BURST_VECTOR = (1 << 1),\n+\n+\t/**< bits[15:2] are reserved for each vector type */\n+\tRTE_ETH_BURST_ALTIVEC = (1 << 2),\n+\tRTE_ETH_BURST_NEON = (1 << 3),\n+\tRTE_ETH_BURST_SSE = (1 << 4),\n+\tRTE_ETH_BURST_AVX2 = (1 << 5),\n+\tRTE_ETH_BURST_AVX512 = (1 << 6),\n+\n+\tRTE_ETH_BURST_SCATTERED = (1 << 16), /**< Support scattered packets */\n+\tRTE_ETH_BURST_BULK_ALLOC = (1 << 17), /**< Support mbuf bulk alloc */\n+\tRTE_ETH_BURST_SIMPLE = (1 << 18),\n+\n+\tRTE_ETH_BURST_PER_QUEUE = (1 << 19), /**< Support per queue burst */\n+};\n+\n+/**\n+ * Ethernet device RX/TX queue packet burst mode information structure.\n+ * Used to retrieve information about packet burst mode setting.\n+ */\n+struct rte_eth_burst_mode {\n+\tuint64_t options;\n+};\n+\n /** Maximum name length for extended statistics counters */\n #define RTE_ETH_XSTATS_NAME_SIZE 64\n \n@@ -3556,6 +3582,62 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,\n int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,\n \tstruct rte_eth_txq_info *qinfo);\n \n+/**\n+ * Retrieve information about the Rx packet burst mode.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param queue_id\n+ * The Rx queue on the Ethernet device for which information\n+ * will be retrieved.\n+ * @param mode\n+ * A pointer to a structure of type *rte_eth_burst_mode* to be filled\n+ * with the information of the packet burst mode.\n+ *\n+ * @return\n+ * - 0: Success\n+ * - -ENOTSUP: routine is not supported by the device PMD.\n+ * - -EINVAL: The port_id or the queue_id is out of range.\n+ */\n+__rte_experimental\n+int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,\n+\tstruct rte_eth_burst_mode *mode);\n+\n+/**\n+ * Retrieve information about the Tx packet burst mode.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param queue_id\n+ * The Tx queue on the Ethernet device for which information\n+ * will be retrieved.\n+ * @param mode\n+ * A pointer to a structure of type *rte_eth_burst_mode* to be filled\n+ * with the information of the packet burst mode.\n+ *\n+ * @return\n+ * - 0: Success\n+ * - -ENOTSUP: routine is not supported by the device PMD.\n+ * - -EINVAL: The port_id or the queue_id is out of range.\n+ */\n+__rte_experimental\n+int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,\n+\tstruct rte_eth_burst_mode *mode);\n+\n+/**\n+ * Retrieve name about burst mode option.\n+ *\n+ * @param mode\n+ * The burst mode option of type *rte_eth_burst_mode_option*.\n+ *\n+ * @return\n+ * - \"\": Not found\n+ * - \"xxx\": name of the mode option.\n+ */\n+__rte_experimental\n+const char *\n+rte_eth_burst_mode_option_name(uint64_t option);\n+\n /**\n * Retrieve device registers and register attributes (number of registers and\n * register size)\ndiff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h\nindex 2922d5b7c..f28c3da8e 100644\n--- a/lib/librte_ethdev/rte_ethdev_core.h\n+++ b/lib/librte_ethdev/rte_ethdev_core.h\n@@ -170,6 +170,9 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,\n typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,\n \tuint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);\n \n+typedef void (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,\n+\tuint16_t queue_id, struct rte_eth_burst_mode *mode);\n+\n typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);\n /**< @internal Set MTU. */\n \n@@ -418,6 +421,8 @@ struct eth_dev_ops {\n \teth_dev_infos_get_t dev_infos_get; /**< Get device info. */\n \teth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */\n \teth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */\n+\teth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */\n+\teth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */\n \teth_fw_version_get_t fw_version_get; /**< Get firmware version. */\n \teth_dev_supported_ptypes_get_t dev_supported_ptypes_get;\n \t/**< Get packet types supported and identified by device. */\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 6df42a47b..e59d51648 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -283,4 +283,9 @@ EXPERIMENTAL {\n \n \t# added in 19.08\n \trte_eth_read_clock;\n+\n+\t# added in 19.11\n+\trte_eth_rx_burst_mode_get;\n+\trte_eth_tx_burst_mode_get;\n+\trte_eth_burst_mode_option_name;\n };\n", "prefixes": [ "RFC", "v3", "1/4" ] }{ "id": 59103, "url": "