Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/82336/?format=api
https://patches.dpdk.org/api/patches/82336/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1603810749-22285-5-git-send-email-liang.j.ma@intel.com/", "project": { "id": 1, "url": "https://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": "<1603810749-22285-5-git-send-email-liang.j.ma@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1603810749-22285-5-git-send-email-liang.j.ma@intel.com", "date": "2020-10-27T14:59:04", "name": "[v10,4/9] ethdev: add simple power management API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "f015ef5d91b2c8eefe20a75c09e0f4fda320cc1e", "submitter": { "id": 904, "url": "https://patches.dpdk.org/api/people/904/?format=api", "name": "Liang, Ma", "email": "liang.j.ma@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1603810749-22285-5-git-send-email-liang.j.ma@intel.com/mbox/", "series": [ { "id": 13382, "url": "https://patches.dpdk.org/api/series/13382/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13382", "date": "2020-10-27T14:59:00", "name": "Add PMD power mgmt", "version": 10, "mbox": "https://patches.dpdk.org/series/13382/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/82336/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/82336/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 09067A04B5;\n\tTue, 27 Oct 2020 16:01:18 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B23EC6C96;\n\tTue, 27 Oct 2020 15:59:56 +0100 (CET)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by dpdk.org (Postfix) with ESMTP id A86056A1C\n for <dev@dpdk.org>; Tue, 27 Oct 2020 15:59:53 +0100 (CET)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Oct 2020 07:59:52 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n by fmsmga008.fm.intel.com with ESMTP; 27 Oct 2020 07:59:47 -0700", "from sivswdev09.ir.intel.com (sivswdev09.ir.intel.com\n [10.237.217.48])\n by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n 09RExjiH015721; Tue, 27 Oct 2020 14:59:45 GMT", "from sivswdev09.ir.intel.com (localhost [127.0.0.1])\n by sivswdev09.ir.intel.com with ESMTP id 09RExjdS022718;\n Tue, 27 Oct 2020 14:59:45 GMT", "(from lma25@localhost)\n by sivswdev09.ir.intel.com with LOCAL id 09RExjoW022706;\n Tue, 27 Oct 2020 14:59:45 GMT" ], "IronPort-SDR": [ "\n 4/Dr3k4NAuWJOFM48LROGtEzUaoDKKDtqe6dyuO2glEkznMgVOYnoC2NVwOzVCGN2YKIfydAod\n 43PboviV7DaQ==", "\n xfZ8S7rOwHcvwR9GJ3bZvb+50gGQ3WKGpw9vqRwgvB/oO6UeKIqyPFgojZ/lYgqMM4k5l0JK0M\n 37YhYUI0p+EA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9786\"; a=\"168193245\"", "E=Sophos;i=\"5.77,424,1596524400\"; d=\"scan'208\";a=\"168193245\"", "E=Sophos;i=\"5.77,424,1596524400\"; d=\"scan'208\";a=\"303779189\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Liang Ma <liang.j.ma@intel.com>", "To": "dev@dpdk.org", "Cc": "ruifeng.wang@arm.com, haiyue.wang@intel.com, bruce.richardson@intel.com,\n konstantin.ananyev@intel.com, david.hunt@intel.com,\n jerinjacobk@gmail.com, nhorman@tuxdriver.com, thomas@monjalon.net,\n timothy.mcdaniel@intel.com, gage.eads@intel.com, mw@semihalf.com,\n gtzalik@amazon.com, ajit.khaparde@broadcom.com, hkalra@marvell.com,\n johndale@cisco.com, xavier.huwei@huawei.com, xuanziyang2@huawei.com,\n matan@nvidia.com, yongwang@vmware.com,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ray Kinsella <mdr@ashroe.eu>", "Date": "Tue, 27 Oct 2020 14:59:04 +0000", "Message-Id": "<1603810749-22285-5-git-send-email-liang.j.ma@intel.com>", "X-Mailer": "git-send-email 1.7.7.4", "In-Reply-To": [ "<1603810749-22285-1-git-send-email-liang.j.ma@intel.com>", "<1603494392-7181-1-git-send-email-liang.j.ma@intel.com>" ], "References": [ "<1603810749-22285-1-git-send-email-liang.j.ma@intel.com>", "<1603494392-7181-1-git-send-email-liang.j.ma@intel.com>" ], "Subject": "[dpdk-dev] [PATCH v10 4/9] ethdev: add simple power management API", "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 a simple API to allow getting address of next RX descriptor from the\nPMD, as well as release notes information.\n\nSigned-off-by: Liang Ma <liang.j.ma@intel.com>\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n\nNotes:\n v10:\n - Address minor issue on comments and release notes\n\n v8:\n - Rename version map file name\n\n v7:\n - Fixed race condition (Konstantin)\n - Slight rework of the structure of monitor code\n - Added missing inline for wakeup\n\n v6:\n - Added wakeup mechanism for UMWAIT\n - Removed memory allocation (everything is now allocated statically)\n - Fixed various typos and comments\n - Check for invalid queue ID\n - Moved release notes to this patch\n\n v5:\n - Make error checking more robust\n - Prevent initializing scaling if ACPI or PSTATE env wasn't set\n - Prevent initializing UMWAIT path if PMD doesn't support get_wake_addr\n - Add some debug logging\n - Replace x86-specific code path to generic path using the intrinsic check\n---\n doc/guides/rel_notes/release_20_11.rst | 4 ++++\n lib/librte_ethdev/rte_ethdev.c | 23 ++++++++++++++++++\n lib/librte_ethdev/rte_ethdev.h | 33 ++++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_driver.h | 28 ++++++++++++++++++++++\n lib/librte_ethdev/version.map | 1 +\n 5 files changed, 89 insertions(+)", "diff": "diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex dca8d41eb6..2bdc8f9948 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -139,6 +139,10 @@ New Features\n Hairpin Tx part flow rules can be inserted explicitly.\n New API is added to get the hairpin peer ports list.\n \n+* **ethdev: added 1 new API for PMD power management.**\n+\n+ * ``rte_eth_get_wake_addr()`` is added to get the wake up address from device.\n+\n * **Updated Broadcom bnxt driver.**\n \n Updated the Broadcom bnxt driver with new features and improvements, including:\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex b12bb3854d..4f3115fe8e 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -5138,6 +5138,29 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,\n \t\t dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode));\n }\n \n+int\n+rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id,\n+\t\tvolatile void **wake_addr, uint64_t *expected, uint64_t *mask,\n+\t\tuint8_t *data_sz)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_wake_addr, -ENOTSUP);\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+\treturn eth_err(port_id,\n+\t\tdev->dev_ops->get_wake_addr(dev->data->rx_queues[queue_id],\n+\t\t\twake_addr, expected, mask, data_sz));\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 e341a08817..e522d5d433 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -4364,6 +4364,39 @@ __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 the wake up address for device queue or other data structure.\n+ * Depend on the HW design, any write back mechanism can be used as a signal\n+ * to wake up the processor.\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 will be\n+ * retrieved.\n+ * @param wake_addr\n+ * The pointer to the address which will be monitored and filled by driver.\n+ * @param expected\n+ * The pointer to value to be expected when target address is set.\n+ * filled by driver.\n+ * @param mask\n+ * The pointer to comparison bitmask for the expected value that is filled by\n+ * driver.\n+ * @param data_sz\n+ * The pointer to data size for the expected value and comparison bitmask that\n+ * is filled by driver.\n+ *\n+ * @return\n+ * - 0: Success.\n+ * -ENOTSUP: Operation not supported.\n+ * -EINVAL: Invalid parameters.\n+ * -ENODEV: Invalid port ID.\n+ */\n+__rte_experimental\n+int rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id,\n+\t\tvolatile void **wake_addr, uint64_t *expected, uint64_t *mask,\n+\t\tuint8_t *data_sz);\n+\n /**\n * Retrieve device registers and register attributes (number of registers and\n * register size)\ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex c63b9f7eb7..d7548dfe74 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -752,6 +752,32 @@ typedef int (*eth_hairpin_queue_peer_unbind_t)\n \t(struct rte_eth_dev *dev, uint16_t cur_queue, uint32_t direction);\n /**< @internal Unbind peer queue from the current queue. */\n \n+/**\n+ * @internal\n+ * Get address of memory location whose contents will change whenever there is\n+ * new data to be received on an RX queue.\n+ *\n+ * @param rxq\n+ * Ethdev queue pointer.\n+ * @param tail_desc_addr\n+ * The pointer point to where the address will be stored.\n+ * @param expected\n+ * The pointer point to value to be expected when descriptor is set.\n+ * @param mask\n+ * The pointer point to comparison bitmask for the expected value.\n+ * @param data_sz\n+ * Data size for the expected value (can be 1, 2, 4, or 8 bytes)\n+ * @return\n+ * Negative errno value on error, 0 on success.\n+ *\n+ * @retval 0\n+ * Success\n+ * @retval -EINVAL\n+ * Invalid parameters\n+ */\n+typedef int (*eth_get_wake_addr_t)(void *rxq, volatile void **tail_desc_addr,\n+\t\tuint64_t *expected, uint64_t *mask, uint8_t *data_sz);\n+\n /**\n * @internal A structure containing the functions exported by an Ethernet driver.\n */\n@@ -910,6 +936,8 @@ struct eth_dev_ops {\n \t/**< Set up the connection between the pair of hairpin queues. */\n \teth_hairpin_queue_peer_unbind_t hairpin_queue_peer_unbind;\n \t/**< Disconnect the hairpin queues of a pair from each other. */\n+\teth_get_wake_addr_t get_wake_addr;\n+\t/**< Get next RX queue ring entry address. */\n };\n \n /**\ndiff --git a/lib/librte_ethdev/version.map b/lib/librte_ethdev/version.map\nindex 8ddda2547f..f9ce4e3c8d 100644\n--- a/lib/librte_ethdev/version.map\n+++ b/lib/librte_ethdev/version.map\n@@ -235,6 +235,7 @@ EXPERIMENTAL {\n \trte_eth_fec_get_capability;\n \trte_eth_fec_get;\n \trte_eth_fec_set;\n+\trte_eth_get_wake_addr;\n \trte_flow_shared_action_create;\n \trte_flow_shared_action_destroy;\n \trte_flow_shared_action_query;\n", "prefixes": [ "v10", "4/9" ] }{ "id": 82336, "url": "