Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/28198/?format=api
https://patches.dpdk.org/api/patches/28198/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20170901022631.19529-1-dharton@cisco.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": "<20170901022631.19529-1-dharton@cisco.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20170901022631.19529-1-dharton@cisco.com", "date": "2017-09-01T02:26:31", "name": "[dpdk-dev,v5] ethdev: add return code to rte_eth_stats_reset()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d569b65553aa56d6ae914deb41fb75fd1ce81fd8", "submitter": { "id": 252, "url": "https://patches.dpdk.org/api/people/252/?format=api", "name": "David Harton", "email": "dharton@cisco.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20170901022631.19529-1-dharton@cisco.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/28198/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/28198/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 716CF3255;\n\tFri, 1 Sep 2017 04:26:46 +0200 (CEST)", "from alln-iport-4.cisco.com (alln-iport-4.cisco.com\n\t[173.37.142.91]) by dpdk.org (Postfix) with ESMTP id 6350216E\n\tfor <dev@dpdk.org>; Fri, 1 Sep 2017 04:26:44 +0200 (CEST)", "from rcdn-core-11.cisco.com ([173.37.93.147])\n\tby alln-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t01 Sep 2017 02:26:43 +0000", "from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com\n\t[172.18.5.114])\n\tby rcdn-core-11.cisco.com (8.14.5/8.14.5) with ESMTP id\n\tv812Qh67005784; Fri, 1 Sep 2017 02:26:43 GMT", "by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087)\n\tid 0D6DC3D3; Thu, 31 Aug 2017 22:26:43 -0400 (EDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=3282; q=dns/txt; s=iport;\n\tt=1504232804; x=1505442404;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=BaF5gj9YTobDhaPslvHU5stFd0w2vMRvlX+u/gT3bmY=;\n\tb=nA1syHpETAprp430oESOj5BhGodl967gKDkOIIsrieQn9jJq66KTeDoo\n\tb1nUjtDsZwB3kFyfoTmYH9hFFHBfBhui6GbuvqIzxzP2EJWBpRoWqVOAs\n\tYJtndNvwlIrv9mLcyYWlYzqWhBouUACPIWZo4wTXahf/hIkQSDyZJ2VWO M=;", "X-IronPort-AV": "E=Sophos;i=\"5.41,456,1498521600\"; d=\"scan'208\";a=\"477717816\"", "From": "David Harton <dharton@cisco.com>", "To": "thomas@monjalon.net", "Cc": "dev@dpdk.org, David Harton <dharton@cisco.com>", "Date": "Thu, 31 Aug 2017 22:26:31 -0400", "Message-Id": "<20170901022631.19529-1-dharton@cisco.com>", "X-Mailer": "git-send-email 2.10.3.dirty", "In-Reply-To": "<20170810132952.26974-1-dharton@cisco.com>", "References": "<20170810132952.26974-1-dharton@cisco.com>", "Subject": "[dpdk-dev] [PATCH v5] ethdev: add return code to\n\trte_eth_stats_reset()", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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": "Some devices do not support reset of eth stats. An application may\nneed to know not to clear shadow stats if the device cannot.\n\nrte_eth_stats_reset is updated to provide a return code to share\nwhether the device supports reset or not.\n\nSigned-off-by: David Harton <dharton@cisco.com>\n---\n\nv5:\n* squashed doc patch\n* moved rel_note change from ABI to API section\n\nv4:\n* commented return values\n\nv3:\n* overcame noob errors and figured out patch challenged\n\nv2:\n* fixed soft tab issue inserted while moving changes\n\n doc/guides/rel_notes/release_17_11.rst | 13 +++++++++++++\n lib/librte_ether/rte_ethdev.c | 8 +++++---\n lib/librte_ether/rte_ethdev.h | 6 +++++-\n 3 files changed, 23 insertions(+), 4 deletions(-)", "diff": "diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst\nindex 22df4fd..6282667 100644\n--- a/doc/guides/rel_notes/release_17_11.rst\n+++ b/doc/guides/rel_notes/release_17_11.rst\n@@ -110,6 +110,19 @@ API Changes\n Also, make sure to start the actual text at the margin.\n =========================================================\n \n+* **Modified the return type of rte_eth_stats_reset.**\n+\n+ Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``\n+ so the caller may know whether a device supports the operation or not\n+ and if the operation was carried out.\n+\n+* **Modified the vlan_offload_set_t function prototype in the ethdev library.**\n+\n+ Changed the function prototype of ``vlan_offload_set_t``. The return value\n+ has been changed from ``void`` to ``int`` so the caller to knows whether\n+ the backing device supports the operation or if the operation was\n+ successfully performed.\n+\n * **Modified the vlan_offload_set_t function prototype in the ethdev library.**\n \n Changed the function prototype of ``vlan_offload_set_t``. The return value\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 05e52b8..f0f1775 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -1341,17 +1341,19 @@ struct rte_eth_dev *\n \treturn 0;\n }\n \n-void\n+int\n rte_eth_stats_reset(uint8_t port_id)\n {\n \tstruct rte_eth_dev *dev;\n \n-\tRTE_ETH_VALID_PORTID_OR_RET(port_id);\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n-\tRTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);\n \t(*dev->dev_ops->stats_reset)(dev);\n \tdev->data->rx_mbuf_alloc_failed = 0;\n+\n+\treturn 0;\n }\n \n static int\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 7254fd0..9110725 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -2246,8 +2246,12 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,\n *\n * @param port_id\n * The port identifier of the Ethernet device.\n+ * @return\n+ * - (0) if device notified to reset stats.\n+ * - (-ENOTSUP) if hardware doesn't support.\n+ * - (-ENODEV) if *port_id* invalid.\n */\n-void rte_eth_stats_reset(uint8_t port_id);\n+int rte_eth_stats_reset(uint8_t port_id);\n \n /**\n * Retrieve names of extended statistics of an Ethernet device.\n", "prefixes": [ "dpdk-dev", "v5" ] }{ "id": 28198, "url": "