Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/8570/?format=api
https://patches.dpdk.org/api/patches/8570/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446552059-5446-4-git-send-email-bruce.richardson@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": "<1446552059-5446-4-git-send-email-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1446552059-5446-4-git-send-email-bruce.richardson@intel.com", "date": "2015-11-03T12:00:58", "name": "[dpdk-dev,v3,3/4] ethdev: remove duplicated debug functions", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "f2fb2937b8791c5a8c32e0466a9778313570f2dd", "submitter": { "id": 20, "url": "https://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446552059-5446-4-git-send-email-bruce.richardson@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/8570/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/8570/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 8B4ED91AB;\n\tTue, 3 Nov 2015 13:01:10 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 11A458F9B\n\tfor <dev@dpdk.org>; Tue, 3 Nov 2015 13:01:06 +0100 (CET)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga101.jf.intel.com with ESMTP; 03 Nov 2015 04:01:01 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga002.fm.intel.com with ESMTP; 03 Nov 2015 04:01:00 -0800", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ttA3C0xgT020572; Tue, 3 Nov 2015 12:00:59 GMT", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id tA3C0xPG005501;\n\tTue, 3 Nov 2015 12:00:59 GMT", "(from bricha3@localhost)\n\tby sivswdev01.ir.intel.com with id tA3C0xXY005497;\n\tTue, 3 Nov 2015 12:00:59 GMT" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.20,238,1444719600\"; d=\"scan'208\";a=\"841965614\"", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Date": "Tue, 3 Nov 2015 12:00:58 +0000", "Message-Id": "<1446552059-5446-4-git-send-email-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1446552059-5446-1-git-send-email-bruce.richardson@intel.com>", "References": "<1441811374-28984-1-git-send-email-bruce.richardson@intel.com>\n\t<1446552059-5446-1-git-send-email-bruce.richardson@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 3/4] ethdev: remove duplicated debug functions", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The functions for rx/tx burst, for rx_queue_count and descriptor_done in\nthe ethdev library all had two copies of the code. One copy in\nrte_ethdev.h was inlined for performance, while a second was in\nrte_ethdev.c for debugging purposes only. We can eliminate the second\ncopy of the functions by moving the additional debug checks into the\ncopies of the functions in the header file. [Any compilation for\ndebugging at optimization level 0 will not inline the function so the\nresult should be same as when the function was in the .c file.]\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_ether/rte_ethdev.c | 64 -------------------------------------------\n lib/librte_ether/rte_ethdev.h | 59 ++++++++++++++++++++-------------------\n 2 files changed, 29 insertions(+), 94 deletions(-)", "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex f95c4d2..f884813 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -2428,70 +2428,6 @@ rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id)\n \treturn (*dev->dev_ops->mirror_rule_reset)(dev, rule_id);\n }\n \n-#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n-uint16_t\n-rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,\n-\t\t struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n-{\n-\tstruct rte_eth_dev *dev;\n-\n-\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n-\n-\tdev = &rte_eth_devices[port_id];\n-\tRTE_ETH_FPTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);\n-\tif (queue_id >= dev->data->nb_rx_queues) {\n-\t\tRTE_PMD_DEBUG_TRACE(\"Invalid RX queue_id=%d\\n\", queue_id);\n-\t\treturn 0;\n-\t}\n-\treturn (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],\n-\t\t\t\t\t\trx_pkts, nb_pkts);\n-}\n-\n-uint16_t\n-rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,\n-\t\t struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n-{\n-\tstruct rte_eth_dev *dev;\n-\n-\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n-\n-\tdev = &rte_eth_devices[port_id];\n-\n-\tRTE_ETH_FPTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);\n-\tif (queue_id >= dev->data->nb_tx_queues) {\n-\t\tRTE_PMD_DEBUG_TRACE(\"Invalid TX queue_id=%d\\n\", queue_id);\n-\t\treturn 0;\n-\t}\n-\treturn (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id],\n-\t\t\t\t\t\ttx_pkts, nb_pkts);\n-}\n-\n-uint32_t\n-rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id)\n-{\n-\tstruct rte_eth_dev *dev;\n-\n-\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n-\n-\tdev = &rte_eth_devices[port_id];\n-\tRTE_ETH_FPTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, 0);\n-\treturn (*dev->dev_ops->rx_queue_count)(dev, queue_id);\n-}\n-\n-int\n-rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset)\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-\tRTE_ETH_FPTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);\n-\treturn (*dev->dev_ops->rx_descriptor_done)(dev->data->rx_queues[queue_id],\n-\t\t\t\t\t\t offset);\n-}\n-#endif\n-\n int\n rte_eth_dev_callback_register(uint8_t port_id,\n \t\t\tenum rte_eth_event_type event,\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 334fc7b..2b702c6 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -2484,18 +2484,21 @@ extern int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on);\n * of pointers to *rte_mbuf* structures effectively supplied to the\n * *rx_pkts* array.\n */\n-#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n-extern uint16_t rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,\n-\t\t\t\t struct rte_mbuf **rx_pkts, uint16_t nb_pkts);\n-#else\n static inline uint16_t\n rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,\n \t\t struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)\n {\n-\tstruct rte_eth_dev *dev;\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n \n-\tdev = &rte_eth_devices[port_id];\n+#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n+\tRTE_ETH_FPTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);\n \n+\tif (queue_id >= dev->data->nb_rx_queues) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid RX queue_id=%d\\n\", queue_id);\n+\t\treturn 0;\n+\t}\n+#endif\n \tint16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],\n \t\t\trx_pkts, nb_pkts);\n \n@@ -2513,7 +2516,6 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,\n \n \treturn nb_rx;\n }\n-#endif\n \n /**\n * Get the number of used descriptors in a specific queue\n@@ -2525,18 +2527,16 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,\n * @return\n * The number of used descriptors in the specific queue.\n */\n-#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n-extern uint32_t rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id);\n-#else\n static inline uint32_t\n rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id)\n {\n- struct rte_eth_dev *dev;\n-\n- dev = &rte_eth_devices[port_id];\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n+\tRTE_ETH_FPTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, 0);\n+#endif\n return (*dev->dev_ops->rx_queue_count)(dev, queue_id);\n }\n-#endif\n \n /**\n * Check if the DD bit of the specific RX descriptor in the queue has been set\n@@ -2552,21 +2552,17 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id)\n * - (0) if the specific DD bit is not set.\n * - (-ENODEV) if *port_id* invalid.\n */\n-#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n-extern int rte_eth_rx_descriptor_done(uint8_t port_id,\n-\t\t\t\t uint16_t queue_id,\n-\t\t\t\t uint16_t offset);\n-#else\n static inline int\n rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset)\n {\n-\tstruct rte_eth_dev *dev;\n-\n-\tdev = &rte_eth_devices[port_id];\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tRTE_ETH_FPTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);\n+#endif\n \treturn (*dev->dev_ops->rx_descriptor_done)( \\\n \t\tdev->data->rx_queues[queue_id], offset);\n }\n-#endif\n \n /**\n * Send a burst of output packets on a transmit queue of an Ethernet device.\n@@ -2626,17 +2622,21 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset)\n * the transmit ring. The return value can be less than the value of the\n * *tx_pkts* parameter when the transmit ring is full or has been filled up.\n */\n-#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n-extern uint16_t rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,\n-\t\t\t\t struct rte_mbuf **tx_pkts, uint16_t nb_pkts);\n-#else\n static inline uint16_t\n rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,\n \t\t struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n {\n-\tstruct rte_eth_dev *dev;\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n+\n+#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);\n+\tRTE_ETH_FPTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);\n \n-\tdev = &rte_eth_devices[port_id];\n+\tif (queue_id >= dev->data->nb_tx_queues) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid TX queue_id=%d\\n\", queue_id);\n+\t\treturn 0;\n+\t}\n+#endif\n \n #ifdef RTE_ETHDEV_RXTX_CALLBACKS\n \tstruct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];\n@@ -2652,7 +2652,6 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,\n \n \treturn (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);\n }\n-#endif\n \n /**\n * The eth device event type for interrupt, and maybe others in the future.\n", "prefixes": [ "dpdk-dev", "v3", "3/4" ] }{ "id": 8570, "url": "