Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/20101/?format=api
http://patches.dpdk.org/api/patches/20101/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1485879273-86228-3-git-send-email-harry.van.haaren@intel.com/", "project": { "id": 1, "url": "http://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": "<1485879273-86228-3-git-send-email-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1485879273-86228-3-git-send-email-harry.van.haaren@intel.com", "date": "2017-01-31T16:14:20", "name": "[dpdk-dev,v2,02/15] eventdev: add APIs for extended stats", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b2558891c564d39bebf94e0af92a9a77e09d139a", "submitter": { "id": 317, "url": "http://patches.dpdk.org/api/people/317/?format=api", "name": "Van Haaren, Harry", "email": "harry.van.haaren@intel.com" }, "delegate": { "id": 10, "url": "http://patches.dpdk.org/api/users/10/?format=api", "username": "bruce", "first_name": "Bruce", "last_name": "Richardson", "email": "bruce.richardson@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1485879273-86228-3-git-send-email-harry.van.haaren@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/20101/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/20101/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 C5B235583;\n\tTue, 31 Jan 2017 17:15:11 +0100 (CET)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 01A10FFA\n\tfor <dev@dpdk.org>; Tue, 31 Jan 2017 17:14:47 +0100 (CET)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP; 31 Jan 2017 08:14:47 -0800", "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby FMSMGA003.fm.intel.com with ESMTP; 31 Jan 2017 08:14:46 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.33,315,1477983600\"; d=\"scan'208\";a=\"815468130\"", "From": "Harry van Haaren <harry.van.haaren@intel.com>", "To": "dev@dpdk.org", "Cc": "jerin.jacob@caviumnetworks.com,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tHarry van Haaren <harry.van.haaren@intel.com>", "Date": "Tue, 31 Jan 2017 16:14:20 +0000", "Message-Id": "<1485879273-86228-3-git-send-email-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1485879273-86228-1-git-send-email-harry.van.haaren@intel.com>", "References": "<1484580885-148524-1-git-send-email-harry.van.haaren@intel.com>\n\t<1485879273-86228-1-git-send-email-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 02/15] eventdev: add APIs for extended stats", "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": "From: Bruce Richardson <bruce.richardson@intel.com>\n\nAdd in APIs for extended stats so that eventdev implementations can report\nout information on their internal state. The APIs are based on, but not\nidentical to, the equivalent ethdev functions.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n lib/librte_eventdev/rte_eventdev.c | 63 ++++++++++++++++++++++\n lib/librte_eventdev/rte_eventdev.h | 80 ++++++++++++++++++++++++++++\n lib/librte_eventdev/rte_eventdev_pmd.h | 60 +++++++++++++++++++++\n lib/librte_eventdev/rte_eventdev_version.map | 3 ++\n 4 files changed, 206 insertions(+)", "diff": "diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c\nindex c8f3e94..95572f4 100644\n--- a/lib/librte_eventdev/rte_eventdev.c\n+++ b/lib/librte_eventdev/rte_eventdev.c\n@@ -920,6 +920,69 @@ rte_event_dev_dump(uint8_t dev_id, FILE *f)\n \n }\n \n+static int\n+get_xstats_count(uint8_t dev_id)\n+{\n+\tstruct rte_eventdev *dev = &rte_eventdevs[dev_id];\n+\tif (dev->dev_ops->get_xstat_names != NULL)\n+\t\treturn (*dev->dev_ops->get_xstat_names)(dev, NULL, 0);\n+\treturn 0;\n+}\n+\n+int\n+rte_event_dev_xstats_names_get(uint8_t dev_id,\n+\tstruct rte_event_dev_xstat_name *xstats_names,\n+\tunsigned int size)\n+{\n+\tRTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);\n+\tconst int cnt_expected_entries = get_xstats_count(dev_id);\n+\tif (xstats_names == NULL || cnt_expected_entries < 0 ||\n+\t\t\t(int)size < cnt_expected_entries)\n+\t\treturn cnt_expected_entries;\n+\n+\t/* dev_id checked above */\n+\tconst struct rte_eventdev *dev = &rte_eventdevs[dev_id];\n+\n+\tif (dev->dev_ops->get_xstat_names != NULL)\n+\t\treturn (*dev->dev_ops->get_xstat_names)(dev,\n+\t\t\t\txstats_names, size);\n+\n+\treturn -ENOTSUP;\n+}\n+\n+/* retrieve eventdev extended statistics */\n+int\n+rte_event_dev_xstats_get(uint8_t dev_id, const unsigned int ids[],\n+\tuint64_t values[], unsigned int n)\n+{\n+\tRTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);\n+\tconst struct rte_eventdev *dev = &rte_eventdevs[dev_id];\n+\n+\t/* implemented by the driver */\n+\tif (dev->dev_ops->get_xstats != NULL)\n+\t\treturn (*dev->dev_ops->get_xstats)(dev, ids, values, n);\n+\treturn -ENOTSUP;\n+}\n+\n+uint64_t\n+rte_event_dev_xstats_by_name_get(uint8_t dev_id, const char *name,\n+\t\tunsigned int *id)\n+{\n+\tRTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, 0);\n+\tconst struct rte_eventdev *dev = &rte_eventdevs[dev_id];\n+\tunsigned int temp = -1;\n+\n+\tif (id != NULL)\n+\t\t*id = (unsigned int)-1;\n+\telse\n+\t\tid = &temp; /* ensure driver never gets a NULL value */\n+\n+\t/* implemented by driver */\n+\tif (dev->dev_ops->get_xstat_by_name != NULL)\n+\t\treturn (*dev->dev_ops->get_xstat_by_name)(dev, name, id);\n+\treturn -ENOTSUP;\n+}\n+\n int\n rte_event_dev_start(uint8_t dev_id)\n {\ndiff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h\nindex c2f9310..66fc35a 100644\n--- a/lib/librte_eventdev/rte_eventdev.h\n+++ b/lib/librte_eventdev/rte_eventdev.h\n@@ -1401,6 +1401,86 @@ rte_event_port_links_get(uint8_t dev_id, uint8_t port_id,\n int\n rte_event_dev_dump(uint8_t dev_id, FILE *f);\n \n+/** Maximum name length for extended statistics counters */\n+#define RTE_EVENT_DEV_XSTAT_NAME_SIZE 64\n+\n+/**\n+ * A name-key lookup element for extended statistics.\n+ *\n+ * This structure is used to map between names and ID numbers\n+ * for extended ethdev statistics.\n+ */\n+struct rte_event_dev_xstat_name {\n+\tchar name[RTE_EVENT_DEV_XSTAT_NAME_SIZE];\n+};\n+\n+/**\n+ * Retrieve names of extended statistics of an event device.\n+ *\n+ * @param dev_id\n+ * The identifier of the event device.\n+ * @param[out] xstat_names\n+ * Block of memory to insert names into. Must be at least size in capacity.\n+ * If set to NULL, function returns required capacity.\n+ * @param size\n+ * Capacity of xstat_names (number of names).\n+ * @return\n+ * - positive value lower or equal to size: success. The return value\n+ * is the number of entries filled in the stats table.\n+ * - positive value higher than size: error, the given statistics table\n+ * is too small. The return value corresponds to the size that should\n+ * be given to succeed. The entries in the table are not valid and\n+ * shall not be used by the caller.\n+ * - negative value on error. -EINVAL for invalid dev id, -ENOTSUP if the\n+ * device doesn't support this function.\n+ */\n+int\n+rte_event_dev_xstats_names_get(uint8_t dev_id,\n+\t\t\t struct rte_event_dev_xstat_name *xstat_names,\n+\t\t\t unsigned int size);\n+\n+/**\n+ * Retrieve extended statistics of an event device.\n+ *\n+ * @param dev_id\n+ * The identifier of the device.\n+ * @param ids\n+ * The id numbers of the stats to get. The ids can be got from the stat\n+ * position in the stat list from rte_event_dev_get_xstat_names(), or\n+ * by using rte_eventdev_get_xstat_by_name()\n+ * @param[out] values\n+ * The values for each stats request by ID.\n+ * @param n\n+ * The number of stats requested\n+ * @return\n+ * - positive value: number of stat entries filled into the values array\n+ * - negative value on error. -EINVAL for invalid dev id, -ENOTSUP if the\n+ * device doesn't support this function.\n+ */\n+int\n+rte_event_dev_xstats_get(uint8_t dev_id, const unsigned int ids[],\n+\t\t\t uint64_t values[], unsigned int n);\n+\n+/**\n+ * Retrieve the value of a single stat by requesting it by name.\n+ *\n+ * @param dev_id\n+ * The identifier of the device\n+ * @param name\n+ * The stat name to retrieve\n+ * @param[out] id\n+ * If non-NULL, the numerical id of the stat will be returned, so that further\n+ * requests for the stat can be got using rte_eventdev_xstats_get, which will\n+ * be faster as it doesn't need to scan a list of names for the stat.\n+ * If the stat cannot be found, the id returned will be (unsigned)-1.\n+ * @return\n+ * - positive value or zero: the stat value\n+ * - negative value: -EINVAL if stat not found, -ENOTSUP if not supported.\n+ */\n+uint64_t\n+rte_event_dev_xstats_by_name_get(uint8_t dev_id, const char *name,\n+\t\t\t\t unsigned int *id);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h\nindex c84c9a2..15843c6 100644\n--- a/lib/librte_eventdev/rte_eventdev_pmd.h\n+++ b/lib/librte_eventdev/rte_eventdev_pmd.h\n@@ -418,6 +418,59 @@ typedef void (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,\n */\n typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f);\n \n+/**\n+ * Retrieve a set of statistics from device\n+ *\n+ * @param dev\n+ * Event device pointer\n+ * @param ids\n+ * The stat ids to retrieve\n+ * @param values\n+ * The returned stat values\n+ * @param n\n+ * The number of id values and entries in the values array\n+ * @return\n+ * The number of stat values successfully filled into the values array\n+ */\n+typedef int (*eventdev_get_xstats_t)(const struct rte_eventdev *dev,\n+\tconst unsigned int ids[], uint64_t values[], unsigned int n);\n+\n+/**\n+ * Get names of extended stats of an event device\n+ *\n+ * @param dev\n+ * Event device pointer\n+ * @param xstat_names\n+ * Array of name values to be filled in\n+ * @param size\n+ * Number of values in the xstat_names array\n+ * @return\n+ * When size >= the number of stats, return the number of stat values filled\n+ * into the array.\n+ * When size < the number of available stats, return the number of stats\n+ * values, and do not fill in any data into xstat_names.\n+ */\n+typedef int (*eventdev_get_xstat_names_t)(const struct rte_eventdev *dev,\n+\tstruct rte_event_dev_xstat_name *xstat_names, unsigned int size);\n+\n+/**\n+ * Get value of one stats and optionally return its id\n+ *\n+ * @param dev\n+ * Event device pointer\n+ * @param name\n+ * The name of the stat to retrieve\n+ * @param id\n+ * Pointer to an unsigned int where we store the stat-id for future reference.\n+ * This pointer may be null if the id is not required.\n+ * @return\n+ * The value of the stat, or (uint64_t)-1 if the stat is not found.\n+ * If the stat is not found, the id value will be returned as (unsigned)-1,\n+ * if id pointer is non-NULL\n+ */\n+typedef uint64_t (*eventdev_get_xstat_by_name)(const struct rte_eventdev *dev,\n+\t\tconst char *name, unsigned int *id);\n+\n /** Event device operations function pointer table */\n struct rte_eventdev_ops {\n \teventdev_info_get_t dev_infos_get;\t/**< Get device info. */\n@@ -448,6 +501,13 @@ struct rte_eventdev_ops {\n \t/**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */\n \teventdev_dump_t dump;\n \t/* Dump internal information */\n+\n+\teventdev_get_xstats_t get_xstats;\n+\t/**< Get extended device statistics. */\n+\teventdev_get_xstat_names_t get_xstat_names;\n+\t/**< Get names of extended stats. */\n+\teventdev_get_xstat_by_name get_xstat_by_name;\n+\t/**< Get one value by name */\n };\n \n /**\ndiff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map\nindex 68b8c81..b138eb3 100644\n--- a/lib/librte_eventdev/rte_eventdev_version.map\n+++ b/lib/librte_eventdev/rte_eventdev_version.map\n@@ -12,6 +12,9 @@ DPDK_17.02 {\n \trte_event_dev_stop;\n \trte_event_dev_close;\n \trte_event_dev_dump;\n+\trte_event_dev_get_xstats;\n+\trte_event_dev_get_xstat_names;\n+\trte_event_dev_get_xstat_by_name;\n \n \trte_event_port_default_conf_get;\n \trte_event_port_setup;\n", "prefixes": [ "dpdk-dev", "v2", "02/15" ] }{ "id": 20101, "url": "