Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/78813/?format=api
http://patchwork.dpdk.org/api/patches/78813/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200925110910.284098-8-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": "<20200925110910.284098-8-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200925110910.284098-8-bruce.richardson@intel.com", "date": "2020-09-25T11:08:52", "name": "[v3,07/25] raw/ioat: rename functions to be operation-agnostic", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c72ad0c723ebfb74306ad3008a8edfba5a94ecff", "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/20200925110910.284098-8-bruce.richardson@intel.com/mbox/", "series": [ { "id": 12509, "url": "http://patchwork.dpdk.org/api/series/12509/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12509", "date": "2020-09-25T11:08:45", "name": "raw/ioat: enhancements and new hardware support", "version": 3, "mbox": "http://patchwork.dpdk.org/series/12509/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/78813/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/78813/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 182ECA04C0;\n\tFri, 25 Sep 2020 13:10:45 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 92E1D1E8FF;\n\tFri, 25 Sep 2020 13:09:53 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id AA4DD1E8D6\n for <dev@dpdk.org>; Fri, 25 Sep 2020 13:09:45 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 25 Sep 2020 04:09:45 -0700", "from unknown (HELO silpixa00399126.ir.intel.com) ([10.237.222.4])\n by orsmga004.jf.intel.com with ESMTP; 25 Sep 2020 04:09:43 -0700" ], "IronPort-SDR": [ "\n ZPcYEGuFoHBK/oL8Bocmk38VJv0VweTxeyF71Ca2QjLMyaS1utCxC8mFDCip9eJoJ37k532OZu\n v7gSg071Ci+g==", "\n ehthXBdana1bP3htDh6omHrwQWE8gNpIMtSvL0wZ36XcoVmTU0Z+p6kwphU3MwkKqZ8VICKDy9\n +tb2iq6ZvuzA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9754\"; a=\"149263082\"", "E=Sophos;i=\"5.77,301,1596524400\"; d=\"scan'208\";a=\"149263082\"", "E=Sophos;i=\"5.77,301,1596524400\"; d=\"scan'208\";a=\"455787852\"" ], "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": "patrick.fu@intel.com, Bruce Richardson <bruce.richardson@intel.com>,\n Kevin Laatz <kevin.laatz@intel.com>", "Date": "Fri, 25 Sep 2020 12:08:52 +0100", "Message-Id": "<20200925110910.284098-8-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200925110910.284098-1-bruce.richardson@intel.com>", "References": "<20200721095140.719297-1-bruce.richardson@intel.com>\n <20200925110910.284098-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v3 07/25] raw/ioat: rename functions to be\n\toperation-agnostic", "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": "Since the hardware supported by the ioat driver is capable of operations\nother than just copies, we can rename the doorbell and completion-return\nfunctions to not have \"copies\" in their names. These functions are not\ncopy-specific, and so would apply for other operations which may be added\nlater to the driver.\n\nAlso add a suitable warning using deprecation attribute for any code using\nthe old functions names.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\n\n---\nNote: The checkpatches warning on this patch is a false positive due to\nthe addition of the new __rte_deprecated_msg macro in rte_common.h\n---\n doc/guides/rawdevs/ioat.rst | 16 ++++++++--------\n doc/guides/rel_notes/release_20_11.rst | 9 +++++++++\n doc/guides/sample_app_ug/ioat.rst | 8 ++++----\n drivers/raw/ioat/ioat_rawdev_test.c | 12 ++++++------\n drivers/raw/ioat/rte_ioat_rawdev.h | 14 +++++++-------\n drivers/raw/ioat/rte_ioat_rawdev_fns.h | 20 ++++++++++++++++----\n examples/ioat/ioatfwd.c | 4 ++--\n lib/librte_eal/include/rte_common.h | 1 +\n 8 files changed, 53 insertions(+), 31 deletions(-)", "diff": "diff --git a/doc/guides/rawdevs/ioat.rst b/doc/guides/rawdevs/ioat.rst\nindex af00d77fb..3db5f5d09 100644\n--- a/doc/guides/rawdevs/ioat.rst\n+++ b/doc/guides/rawdevs/ioat.rst\n@@ -157,9 +157,9 @@ Performing Data Copies\n ~~~~~~~~~~~~~~~~~~~~~~~\n \n To perform data copies using IOAT rawdev devices, the functions\n-``rte_ioat_enqueue_copy()`` and ``rte_ioat_do_copies()`` should be used.\n+``rte_ioat_enqueue_copy()`` and ``rte_ioat_perform_ops()`` should be used.\n Once copies have been completed, the completion will be reported back when\n-the application calls ``rte_ioat_completed_copies()``.\n+the application calls ``rte_ioat_completed_ops()``.\n \n The ``rte_ioat_enqueue_copy()`` function enqueues a single copy to the\n device ring for copying at a later point. The parameters to that function\n@@ -172,11 +172,11 @@ pointers if packet data is being copied.\n \n While the ``rte_ioat_enqueue_copy()`` function enqueues a copy operation on\n the device ring, the copy will not actually be performed until after the\n-application calls the ``rte_ioat_do_copies()`` function. This function\n+application calls the ``rte_ioat_perform_ops()`` function. This function\n informs the device hardware of the elements enqueued on the ring, and the\n device will begin to process them. It is expected that, for efficiency\n reasons, a burst of operations will be enqueued to the device via multiple\n-enqueue calls between calls to the ``rte_ioat_do_copies()`` function.\n+enqueue calls between calls to the ``rte_ioat_perform_ops()`` function.\n \n The following code from ``test_ioat_rawdev.c`` demonstrates how to enqueue\n a burst of copies to the device and start the hardware processing of them:\n@@ -210,10 +210,10 @@ a burst of copies to the device and start the hardware processing of them:\n return -1;\n }\n }\n- rte_ioat_do_copies(dev_id);\n+ rte_ioat_perform_ops(dev_id);\n \n To retrieve information about completed copies, the API\n-``rte_ioat_completed_copies()`` should be used. This API will return to the\n+``rte_ioat_completed_ops()`` should be used. This API will return to the\n application a set of completion handles passed in when the relevant copies\n were enqueued.\n \n@@ -223,9 +223,9 @@ is correct before freeing the data buffers using the returned handles:\n \n .. code-block:: C\n \n- if (rte_ioat_completed_copies(dev_id, 64, (void *)completed_src,\n+ if (rte_ioat_completed_ops(dev_id, 64, (void *)completed_src,\n (void *)completed_dst) != RTE_DIM(srcs)) {\n- printf(\"Error with rte_ioat_completed_copies\\n\");\n+ printf(\"Error with rte_ioat_completed_ops\\n\");\n return -1;\n }\n for (i = 0; i < RTE_DIM(srcs); i++) {\ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex 196209f63..c99c0b33f 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -83,6 +83,11 @@ New Features\n The ioat rawdev driver has been updated and enhanced. Changes include:\n \n * Added a per-device configuration flag to disable management of user-provided completion handles\n+ * Renamed the ``rte_ioat_do_copies()`` API to ``rte_ioat_perform_ops()``,\n+ and renamed the ``rte_ioat_completed_copies()`` API to ``rte_ioat_completed_ops()``\n+ to better reflect the APIs' purposes, and remove the implication that\n+ they are limited to copy operations only.\n+ [Note: The old API is still provided but marked as deprecated in the code]\n \n \n Removed Items\n@@ -178,6 +183,10 @@ API Changes\n \n * bpf: ``RTE_BPF_XTYPE_NUM`` has been dropped from ``rte_bpf_xtype``.\n \n+* raw/ioat: As noted above, the ``rte_ioat_do_copies()`` and\n+ ``rte_ioat_completed_copies()`` functions have been renamed to\n+ ``rte_ioat_perform_ops()`` and ``rte_ioat_completed_ops()`` respectively.\n+\n \n ABI Changes\n -----------\ndiff --git a/doc/guides/sample_app_ug/ioat.rst b/doc/guides/sample_app_ug/ioat.rst\nindex 3f7d5c34a..964160dff 100644\n--- a/doc/guides/sample_app_ug/ioat.rst\n+++ b/doc/guides/sample_app_ug/ioat.rst\n@@ -394,7 +394,7 @@ packet using ``pktmbuf_sw_copy()`` function and enqueue them to an rte_ring:\n nb_enq = ioat_enqueue_packets(pkts_burst,\n nb_rx, rx_config->ioat_ids[i]);\n if (nb_enq > 0)\n- rte_ioat_do_copies(rx_config->ioat_ids[i]);\n+ rte_ioat_perform_ops(rx_config->ioat_ids[i]);\n } else {\n /* Perform packet software copy, free source packets */\n int ret;\n@@ -433,7 +433,7 @@ The packets are received in burst mode using ``rte_eth_rx_burst()``\n function. When using hardware copy mode the packets are enqueued in\n copying device's buffer using ``ioat_enqueue_packets()`` which calls\n ``rte_ioat_enqueue_copy()``. When all received packets are in the\n-buffer the copy operations are started by calling ``rte_ioat_do_copies()``.\n+buffer the copy operations are started by calling ``rte_ioat_perform_ops()``.\n Function ``rte_ioat_enqueue_copy()`` operates on physical address of\n the packet. Structure ``rte_mbuf`` contains only physical address to\n start of the data buffer (``buf_iova``). Thus the address is adjusted\n@@ -490,7 +490,7 @@ or indirect mbufs, then multiple copy operations must be used.\n \n \n All completed copies are processed by ``ioat_tx_port()`` function. When using\n-hardware copy mode the function invokes ``rte_ioat_completed_copies()``\n+hardware copy mode the function invokes ``rte_ioat_completed_ops()``\n on each assigned IOAT channel to gather copied packets. If software copy\n mode is used the function dequeues copied packets from the rte_ring. Then each\n packet MAC address is changed if it was enabled. After that copies are sent\n@@ -510,7 +510,7 @@ in burst mode using `` rte_eth_tx_burst()``.\n for (i = 0; i < tx_config->nb_queues; i++) {\n if (copy_mode == COPY_MODE_IOAT_NUM) {\n /* Deque the mbufs from IOAT device. */\n- nb_dq = rte_ioat_completed_copies(\n+ nb_dq = rte_ioat_completed_ops(\n tx_config->ioat_ids[i], MAX_PKT_BURST,\n (void *)mbufs_src, (void *)mbufs_dst);\n } else {\ndiff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c\nindex 8e7fd96af..bb40eab6b 100644\n--- a/drivers/raw/ioat/ioat_rawdev_test.c\n+++ b/drivers/raw/ioat/ioat_rawdev_test.c\n@@ -62,12 +62,12 @@ test_enqueue_copies(int dev_id)\n \t\t\tPRINT_ERR(\"Error with rte_ioat_enqueue_copy\\n\");\n \t\t\treturn -1;\n \t\t}\n-\t\trte_ioat_do_copies(dev_id);\n+\t\trte_ioat_perform_ops(dev_id);\n \t\tusleep(10);\n \n-\t\tif (rte_ioat_completed_copies(dev_id, 1, (void *)&completed[0],\n+\t\tif (rte_ioat_completed_ops(dev_id, 1, (void *)&completed[0],\n \t\t\t\t(void *)&completed[1]) != 1) {\n-\t\t\tPRINT_ERR(\"Error with rte_ioat_completed_copies\\n\");\n+\t\t\tPRINT_ERR(\"Error with rte_ioat_completed_ops\\n\");\n \t\t\treturn -1;\n \t\t}\n \t\tif (completed[0] != src || completed[1] != dst) {\n@@ -116,12 +116,12 @@ test_enqueue_copies(int dev_id)\n \t\t\t\treturn -1;\n \t\t\t}\n \t\t}\n-\t\trte_ioat_do_copies(dev_id);\n+\t\trte_ioat_perform_ops(dev_id);\n \t\tusleep(100);\n \n-\t\tif (rte_ioat_completed_copies(dev_id, 64, (void *)completed_src,\n+\t\tif (rte_ioat_completed_ops(dev_id, 64, (void *)completed_src,\n \t\t\t\t(void *)completed_dst) != RTE_DIM(srcs)) {\n-\t\t\tPRINT_ERR(\"Error with rte_ioat_completed_copies\\n\");\n+\t\t\tPRINT_ERR(\"Error with rte_ioat_completed_ops\\n\");\n \t\t\treturn -1;\n \t\t}\n \t\tfor (i = 0; i < RTE_DIM(srcs); i++) {\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h\nindex 7067b352f..5b2c47e8c 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev.h\n@@ -74,19 +74,19 @@ rte_ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n \t\tint fence);\n \n /**\n- * Trigger hardware to begin performing enqueued copy operations\n+ * Trigger hardware to begin performing enqueued operations\n *\n * This API is used to write the \"doorbell\" to the hardware to trigger it\n- * to begin the copy operations previously enqueued by rte_ioat_enqueue_copy()\n+ * to begin the operations previously enqueued by rte_ioat_enqueue_copy()\n *\n * @param dev_id\n * The rawdev device id of the ioat instance\n */\n static inline void\n-rte_ioat_do_copies(int dev_id);\n+rte_ioat_perform_ops(int dev_id);\n \n /**\n- * Returns details of copy operations that have been completed\n+ * Returns details of operations that have been completed\n *\n * If the hdls_disable option was not set when the device was configured,\n * the function will return to the caller the user-provided \"handles\" for\n@@ -104,11 +104,11 @@ rte_ioat_do_copies(int dev_id);\n * NOTE: If hdls_disable configuration option for the device is set, this\n * parameter is ignored.\n * @param src_hdls\n- * Array to hold the source handle parameters of the completed copies.\n+ * Array to hold the source handle parameters of the completed ops.\n * NOTE: If hdls_disable configuration option for the device is set, this\n * parameter is ignored.\n * @param dst_hdls\n- * Array to hold the destination handle parameters of the completed copies.\n+ * Array to hold the destination handle parameters of the completed ops.\n * NOTE: If hdls_disable configuration option for the device is set, this\n * parameter is ignored.\n * @return\n@@ -117,7 +117,7 @@ rte_ioat_do_copies(int dev_id);\n * to the src_hdls and dst_hdls array parameters.\n */\n static inline int\n-rte_ioat_completed_copies(int dev_id, uint8_t max_copies,\n+rte_ioat_completed_ops(int dev_id, uint8_t max_copies,\n \t\tuintptr_t *src_hdls, uintptr_t *dst_hdls);\n \n /* include the implementation details from a separate file */\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\nindex 4b7bdb8e2..b155d79c4 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n@@ -83,10 +83,10 @@ rte_ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n }\n \n /*\n- * Trigger hardware to begin performing enqueued copy operations\n+ * Trigger hardware to begin performing enqueued operations\n */\n static inline void\n-rte_ioat_do_copies(int dev_id)\n+rte_ioat_perform_ops(int dev_id)\n {\n \tstruct rte_ioat_rawdev *ioat =\n \t\t\t(struct rte_ioat_rawdev *)rte_rawdevs[dev_id].dev_private;\n@@ -114,10 +114,10 @@ rte_ioat_get_last_completed(struct rte_ioat_rawdev *ioat, int *error)\n }\n \n /*\n- * Returns details of copy operations that have been completed\n+ * Returns details of operations that have been completed\n */\n static inline int\n-rte_ioat_completed_copies(int dev_id, uint8_t max_copies,\n+rte_ioat_completed_ops(int dev_id, uint8_t max_copies,\n \t\tuintptr_t *src_hdls, uintptr_t *dst_hdls)\n {\n \tstruct rte_ioat_rawdev *ioat =\n@@ -165,4 +165,16 @@ rte_ioat_completed_copies(int dev_id, uint8_t max_copies,\n \treturn count;\n }\n \n+static inline void\n+__rte_deprecated_msg(\"use rte_ioat_perform_ops() instead\")\n+rte_ioat_do_copies(int dev_id) { rte_ioat_perform_ops(dev_id); }\n+\n+static inline int\n+__rte_deprecated_msg(\"use rte_ioat_completed_ops() instead\")\n+rte_ioat_completed_copies(int dev_id, uint8_t max_copies,\n+\t\tuintptr_t *src_hdls, uintptr_t *dst_hdls)\n+{\n+\treturn rte_ioat_completed_ops(dev_id, max_copies, src_hdls, dst_hdls);\n+}\n+\n #endif /* _RTE_IOAT_RAWDEV_FNS_H_ */\ndiff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c\nindex 288a75c7b..67f75737b 100644\n--- a/examples/ioat/ioatfwd.c\n+++ b/examples/ioat/ioatfwd.c\n@@ -406,7 +406,7 @@ ioat_rx_port(struct rxtx_port_config *rx_config)\n \t\t\tnb_enq = ioat_enqueue_packets(pkts_burst,\n \t\t\t\tnb_rx, rx_config->ioat_ids[i]);\n \t\t\tif (nb_enq > 0)\n-\t\t\t\trte_ioat_do_copies(rx_config->ioat_ids[i]);\n+\t\t\t\trte_ioat_perform_ops(rx_config->ioat_ids[i]);\n \t\t} else {\n \t\t\t/* Perform packet software copy, free source packets */\n \t\t\tint ret;\n@@ -452,7 +452,7 @@ ioat_tx_port(struct rxtx_port_config *tx_config)\n \tfor (i = 0; i < tx_config->nb_queues; i++) {\n \t\tif (copy_mode == COPY_MODE_IOAT_NUM) {\n \t\t\t/* Deque the mbufs from IOAT device. */\n-\t\t\tnb_dq = rte_ioat_completed_copies(\n+\t\t\tnb_dq = rte_ioat_completed_ops(\n \t\t\t\ttx_config->ioat_ids[i], MAX_PKT_BURST,\n \t\t\t\t(void *)mbufs_src, (void *)mbufs_dst);\n \t\t} else {\ndiff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h\nindex 8f487a563..2920255fc 100644\n--- a/lib/librte_eal/include/rte_common.h\n+++ b/lib/librte_eal/include/rte_common.h\n@@ -85,6 +85,7 @@ typedef uint16_t unaligned_uint16_t;\n \n /******* Macro to mark functions and fields scheduled for removal *****/\n #define __rte_deprecated\t__attribute__((__deprecated__))\n+#define __rte_deprecated_msg(msg)\t__attribute__((__deprecated__(msg)))\n \n /**\n * Mark a function or variable to a weak reference.\n", "prefixes": [ "v3", "07/25" ] }{ "id": 78813, "url": "