Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/57611/?format=api
https://patches.dpdk.org/api/patches/57611/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190811160607.16441-2-stephen@networkplumber.org/", "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": "<20190811160607.16441-2-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190811160607.16441-2-stephen@networkplumber.org", "date": "2019-08-11T16:06:06", "name": "[v3,1/2] ethdev: expose basic xstats for driver use", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4743c113225189c0b1f1690df01d66cc435df834", "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190811160607.16441-2-stephen@networkplumber.org/mbox/", "series": [ { "id": 6007, "url": "https://patches.dpdk.org/api/series/6007/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6007", "date": "2019-08-11T16:06:05", "name": "failsafe: add xstats", "version": 3, "mbox": "https://patches.dpdk.org/series/6007/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/57611/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/57611/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 828FA375B;\n\tSun, 11 Aug 2019 18:06:19 +0200 (CEST)", "from mail-pl1-f193.google.com (mail-pl1-f193.google.com\n\t[209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 659FE326D\n\tfor <dev@dpdk.org>; Sun, 11 Aug 2019 18:06:17 +0200 (CEST)", "by mail-pl1-f193.google.com with SMTP id g4so458767plo.3\n\tfor <dev@dpdk.org>; Sun, 11 Aug 2019 09:06:17 -0700 (PDT)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tv13sm116890936pfn.109.2019.08.11.09.06.14\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tSun, 11 Aug 2019 09:06:15 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=eDlnGK4hbL/EzjLtP47RrBz4RlbUoKG7nsPFIArAhf8=;\n\tb=OHOcjRdMIpWhlW7sPrqIc9L1gu3sJfVc+1jumRFBL7lVxZhBFusjqvTL+rREVxRSvh\n\tcXp22WORUny+wlDPyR87Uut8p+pcFfJW+jFjoBuIWExJ51IC3dp5qzIhOujd9epxnItC\n\tTFwFQJV5WSmK+uHuZ0g/ycQEWwWL6oyM4o8yQFf+xTwPdrJgvKwMQ4B+QwIl1Aexu8XV\n\tVsuuJ85yh7+b9uqyt6f1NLpi7BaxgWBl43QBaPfJOvLuIIJTJZdMRi3PXBpA1rSyfmO0\n\tA6cwm8Noha+rWNoJTOCv7L0Cg2mj/z0X4pRLg+oJevU/Dq+m0iWt6l1hNkr6L16ATL8n\n\tjiNw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=eDlnGK4hbL/EzjLtP47RrBz4RlbUoKG7nsPFIArAhf8=;\n\tb=iyMcmA3P6c0BhMpHcqerqefrsz/e5S7crGeHAzgzLGL380auhskPRKflknEGmpJ5ky\n\t6l+fjOFAH7x8lozZYyFndQQQE9YhaRNNB6bUdFKAwRVnkUVERkwFbicedKAg35a9UTTz\n\twrMpqROr/H7FZ16UbqXPkxgGj48Rt/8AFLIWxrUhSpiazjdx5yZp+tAgykTy47CLteZE\n\tB4EUd/WOhtXY4wp71S1bXYxWb8VMvVpdfZKLPoTnvd10cb2TiuU1Q//RBO+1+fICGRPo\n\tLI6Yj7HrL3EiP0bNB5SkJTjH7vKh35wp9gzxRYJvW8WkvnfGVpGL+zF15xWVK8rN6HE2\n\tJD4w==", "X-Gm-Message-State": "APjAAAUoeYbyQ/airQWSU3Vdp4eIrI8Dy90ybwuUVRm/JBZdd36EcRG9\n\tMQaNzQqZWCmeimjfHWmAXJdMMdYOc60=", "X-Google-Smtp-Source": "APXvYqy6Nz6EQeXnYQseJAunbjQiAtspLpMRBzSgT9L7ZgXWAhCHVArKLPDnrW78kq9a98rfmC9mQA==", "X-Received": "by 2002:a17:902:7d8b:: with SMTP id\n\ta11mr28843908plm.306.1565539576156; \n\tSun, 11 Aug 2019 09:06:16 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n\tGaetan Rivet <gaetan.rivet@6wind.com>", "Date": "Sun, 11 Aug 2019 09:06:06 -0700", "Message-Id": "<20190811160607.16441-2-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190811160607.16441-1-stephen@networkplumber.org>", "References": "<20190626222135.11368-1-stephen@networkplumber.org>\n\t<20190811160607.16441-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v3 1/2] ethdev: expose basic xstats for driver use", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Avoid duplication by having generic basic xstats available\nfor use by drivers. A later patch uses this for failsafe\ndriver.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Gaetan Rivet <gaetan.rivet@6wind.com>\n---\n lib/librte_ethdev/rte_ethdev.c | 17 +++----\n lib/librte_ethdev/rte_ethdev_driver.h | 65 ++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_version.map | 24 +++++++++\n 3 files changed, 97 insertions(+), 9 deletions(-)", "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 17d183e1f0ec..88e3065d06fd 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -1996,8 +1996,8 @@ rte_eth_stats_reset(uint16_t port_id)\n \treturn 0;\n }\n \n-static inline int\n-get_xstats_basic_count(struct rte_eth_dev *dev)\n+int\n+rte_eth_basic_stats_count(struct rte_eth_dev *dev)\n {\n \tuint16_t nb_rxqs, nb_txqs;\n \tint count;\n@@ -2034,7 +2034,7 @@ get_xstats_count(uint16_t port_id)\n \t\tcount = 0;\n \n \n-\tcount += get_xstats_basic_count(dev);\n+\tcount += rte_eth_basic_stats_count(dev);\n \n \treturn count;\n }\n@@ -2084,7 +2084,7 @@ rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name,\n }\n \n /* retrieve basic stats names */\n-static int\n+int\n rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,\n \tstruct rte_eth_xstat_name *xstats_names)\n {\n@@ -2140,7 +2140,7 @@ rte_eth_xstats_get_names_by_id(uint16_t port_id,\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n-\tbasic_count = get_xstats_basic_count(dev);\n+\tbasic_count = rte_eth_basic_stats_count(dev);\n \tret = get_xstats_count(port_id);\n \tif (ret < 0)\n \t\treturn ret;\n@@ -2268,8 +2268,7 @@ rte_eth_xstats_get_names(uint16_t port_id,\n \treturn cnt_used_entries;\n }\n \n-\n-static int\n+int\n rte_eth_basic_stats_get(uint16_t port_id, struct rte_eth_xstat *xstats)\n {\n \tstruct rte_eth_dev *dev;\n@@ -2341,7 +2340,7 @@ rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids,\n \texpected_entries = (uint16_t)ret;\n \tstruct rte_eth_xstat xstats[expected_entries];\n \tdev = &rte_eth_devices[port_id];\n-\tbasic_count = get_xstats_basic_count(dev);\n+\tbasic_count = rte_eth_basic_stats_count(dev);\n \n \t/* Return max number of stats if no ids given */\n \tif (!ids) {\n@@ -2355,7 +2354,7 @@ rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids,\n \t\treturn -EINVAL;\n \n \tif (ids && dev->dev_ops->xstats_get_by_id != NULL && size) {\n-\t\tunsigned int basic_count = get_xstats_basic_count(dev);\n+\t\tunsigned int basic_count = rte_eth_basic_stats_count(dev);\n \t\tuint64_t ids_copy[size];\n \n \t\tfor (i = 0; i < size; i++) {\ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex 936ff8c98651..489889a72203 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -208,6 +208,71 @@ rte_eth_linkstatus_get(const struct rte_eth_dev *dev,\n #endif\n }\n \n+/**\n+ * @internal\n+ * Get basic stats part of xstats for an ethernet device.\n+ *\n+ * @param dev\n+ * Pointer to struct rte_eth_dev.\n+ */\n+__rte_experimental\n+int\n+rte_eth_basic_stats_count(struct rte_eth_dev *dev);\n+\n+/**\n+ * @internal\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Retrieve the names for the basic part of extended statistics.\n+ *\n+ * @param dev\n+ * Pointer to struct rte_eth_dev.\n+ * @param xstats_names\n+ * An rte_eth_xstat_name array of at least *size* elements to\n+ * be filled. If set to NULL, the function returns the required number\n+ * of elements.\n+ * @return\n+ * - A positive value lower or equal to size: success. The return value\n+ * is the number of entries filled in the stats table.\n+ * - A 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+ * - A negative value on error (invalid port id).\n+ */\n+__rte_experimental\n+int\n+rte_eth_basic_stats_get_names(struct rte_eth_dev *dev,\n+\t\t\t struct rte_eth_xstat_name *xstats_names);\n+\n+/**\n+ * @internal\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Retrieve the basic part of the extended statistics.\n+ *\n+ * @param dev\n+ * Pointer to struct rte_eth_dev.\n+ * @param xstats\n+ * A pointer to a table of structure of type *rte_eth_xstat*\n+ * to be filled with device statistics ids and values.\n+ * This parameter can be set to NULL if n is 0.\n+ * @param n\n+ * The size of the xstats array (number of elements).\n+ * @return\n+ * - A positive value lower or equal to n: success. The return value\n+ * is the number of entries filled in the stats table.\n+ * - A positive value higher than n: 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+ * - A negative value on error (invalid port id).\n+ */\n+__rte_experimental\n+int\n+rte_eth_basic_stats_get(uint16_t port_id, struct rte_eth_xstat *xstats);\n+\n+\n /**\n * @warning\n * @b EXPERIMENTAL: this API may change without prior notice.\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 6df42a47b89d..f2198b0367d1 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -240,6 +240,25 @@ EXPERIMENTAL {\n \tglobal:\n \n \t# added in 17.11\n+\trte_eth_devargs_parse;\n+\trte_eth_dev_create;\n+\trte_eth_dev_destroy;\n+\trte_eth_dev_get_module_eeprom;\n+\trte_eth_dev_get_module_info;\n+\trte_eth_dev_is_removed;\n+\trte_eth_dev_owner_delete;\n+\trte_eth_dev_owner_get;\n+\trte_eth_dev_owner_new;\n+\trte_eth_dev_owner_set;\n+\trte_eth_dev_owner_unset;\n+\trte_eth_dev_rx_intr_ctl_q_get_fd;\n+\trte_eth_find_next_of;\n+\trte_eth_find_next_sibling;\n+\trte_eth_read_clock;\n+\trte_eth_switch_domain_alloc;\n+\trte_eth_switch_domain_free;\n+\trte_flow_conv;\n+\trte_flow_expand_rss;\n \trte_mtr_capabilities_get;\n \trte_mtr_create;\n \trte_mtr_destroy;\n@@ -283,4 +302,9 @@ EXPERIMENTAL {\n \n \t# added in 19.08\n \trte_eth_read_clock;\n+\n+\t# added in 19.11\n+\trte_eth_basic_stats_count;\n+\trte_eth_basic_stats_get;\n+\trte_eth_basic_stats_get_names;\n };\n", "prefixes": [ "v3", "1/2" ] }{ "id": 57611, "url": "