Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/19397/?format=api
http://patches.dpdk.org/api/patches/19397/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1484545911-40432-26-git-send-email-wenzhuo.lu@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": "<1484545911-40432-26-git-send-email-wenzhuo.lu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1484545911-40432-26-git-send-email-wenzhuo.lu@intel.com", "date": "2017-01-16T05:51:50", "name": "[dpdk-dev,v10,25/26] net/i40e: set/clear VF stats from PF", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c1171086151b179eff0ce0dde795ce7573f5610a", "submitter": { "id": 258, "url": "http://patches.dpdk.org/api/people/258/?format=api", "name": "Wenzhuo Lu", "email": "wenzhuo.lu@intel.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1484545911-40432-26-git-send-email-wenzhuo.lu@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/19397/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/19397/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 20D53FB49;\n\tMon, 16 Jan 2017 06:53:00 +0100 (CET)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 501EDFA6A\n\tfor <dev@dpdk.org>; Mon, 16 Jan 2017 06:52:22 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga103.jf.intel.com with ESMTP; 15 Jan 2017 21:52:21 -0800", "from dpdk26.sh.intel.com ([10.239.128.228])\n\tby orsmga002.jf.intel.com with ESMTP; 15 Jan 2017 21:52:21 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.33,237,1477983600\"; d=\"scan'208\";a=\"31011533\"", "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>", "To": "dev@dpdk.org", "Cc": "Qi Zhang <qi.z.zhang@intel.com>", "Date": "Mon, 16 Jan 2017 13:51:50 +0800", "Message-Id": "<1484545911-40432-26-git-send-email-wenzhuo.lu@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1484545911-40432-1-git-send-email-wenzhuo.lu@intel.com>", "References": "<1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com>\n\t<1484545911-40432-1-git-send-email-wenzhuo.lu@intel.com>", "Subject": "[dpdk-dev] [PATCH v10 25/26] net/i40e: set/clear VF stats from PF", "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: Qi Zhang <qi.z.zhang@intel.com>\n\nThis patch add support to get/clear VF statistics\nfrom PF side.\nTwo APIs are added:\nrte_pmd_i40e_get_vf_stats.\nrte_pmd_i40e_reset_vf_stats.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/i40e/i40e_ethdev.c | 79 +++++++++++++++++++++++++++++++\n drivers/net/i40e/rte_pmd_i40e.h | 41 ++++++++++++++++\n drivers/net/i40e/rte_pmd_i40e_version.map | 2 +\n 3 files changed, 122 insertions(+)", "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex b084c39..f92f148 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -11075,3 +11075,82 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,\n \n \treturn ret;\n }\n+\n+int\n+rte_pmd_i40e_get_vf_stats(uint8_t port,\n+\t\t\t uint16_t vf_id,\n+\t\t\t struct rte_eth_stats *stats)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tstruct i40e_pf *pf;\n+\tstruct i40e_vsi *vsi;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);\n+\n+\tdev = &rte_eth_devices[port];\n+\n+\tif (is_i40e_pmd(dev->data->drv_name))\n+\t\treturn -ENOTSUP;\n+\n+\tpf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\n+\tif (vf_id >= pf->vf_num || !pf->vfs) {\n+\t\tPMD_DRV_LOG(ERR, \"Invalid VF ID.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tvsi = pf->vfs[vf_id].vsi;\n+\tif (!vsi) {\n+\t\tPMD_DRV_LOG(ERR, \"Invalid VSI.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\ti40e_update_vsi_stats(vsi);\n+\n+\tstats->ipackets = vsi->eth_stats.rx_unicast +\n+\t\t\tvsi->eth_stats.rx_multicast +\n+\t\t\tvsi->eth_stats.rx_broadcast;\n+\tstats->opackets = vsi->eth_stats.tx_unicast +\n+\t\t\tvsi->eth_stats.tx_multicast +\n+\t\t\tvsi->eth_stats.tx_broadcast;\n+\tstats->ibytes = vsi->eth_stats.rx_bytes;\n+\tstats->obytes = vsi->eth_stats.tx_bytes;\n+\tstats->ierrors = vsi->eth_stats.rx_discards;\n+\tstats->oerrors = vsi->eth_stats.tx_errors + vsi->eth_stats.tx_discards;\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_pmd_i40e_reset_vf_stats(uint8_t port,\n+\t\t\t uint16_t vf_id)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tstruct i40e_pf *pf;\n+\tstruct i40e_vsi *vsi;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);\n+\n+\tdev = &rte_eth_devices[port];\n+\n+\tif (is_i40e_pmd(dev->data->drv_name))\n+\t\treturn -ENOTSUP;\n+\n+\tpf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\n+\tif (vf_id >= pf->vf_num || !pf->vfs) {\n+\t\tPMD_DRV_LOG(ERR, \"Invalid VF ID.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tvsi = pf->vfs[vf_id].vsi;\n+\tif (!vsi) {\n+\t\tPMD_DRV_LOG(ERR, \"Invalid VSI.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tvsi->offset_loaded = false;\n+\ti40e_update_vsi_stats(vsi);\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h\nindex 2c87029..f4bd0fd 100644\n--- a/drivers/net/i40e/rte_pmd_i40e.h\n+++ b/drivers/net/i40e/rte_pmd_i40e.h\n@@ -291,4 +291,45 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id,\n int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,\n \t\t\t\t uint64_t vf_mask, uint8_t on);\n \n+/**\n+ * Get VF's statistics\n+ *\n+ * @param port\n+ * The port identifier of the Ethernet device.\n+ * @param vf_id\n+ * VF on which to get.\n+ * @param stats\n+ * A pointer to a structure of type *rte_eth_stats* to be filled with\n+ * the values of device counters for the following set of statistics:\n+ * - *ipackets* with the total of successfully received packets.\n+ * - *opackets* with the total of successfully transmitted packets.\n+ * - *ibytes* with the total of successfully received bytes.\n+ * - *obytes* with the total of successfully transmitted bytes.\n+ * - *ierrors* with the total of erroneous received packets.\n+ * - *oerrors* with the total of failed transmitted packets.\n+ * @return\n+ * - (0) if successful.\n+ * - (-ENODEV) if *port* invalid.\n+ * - (-EINVAL) if bad parameter.\n+ */\n+\n+int rte_pmd_i40e_get_vf_stats(uint8_t port,\n+\t\t\t uint16_t vf_id,\n+\t\t\t struct rte_eth_stats *stats);\n+\n+/**\n+ * Clear VF's statistics\n+ *\n+ * @param port\n+ * The port identifier of the Ethernet device.\n+ * @param vf_id\n+ * VF on which to get.\n+ * @return\n+ * - (0) if successful.\n+ * - (-ENODEV) if *port* invalid.\n+ * - (-EINVAL) if bad parameter.\n+ */\n+int rte_pmd_i40e_reset_vf_stats(uint8_t port,\n+\t\t\t\tuint16_t vf_id);\n+\n #endif /* _PMD_I40E_H_ */\ndiff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map\nindex 8ac1bc8..7a5d211 100644\n--- a/drivers/net/i40e/rte_pmd_i40e_version.map\n+++ b/drivers/net/i40e/rte_pmd_i40e_version.map\n@@ -6,7 +6,9 @@ DPDK_2.0 {\n DPDK_17.02 {\n \tglobal:\n \n+\trte_pmd_i40e_get_vf_stats;\n \trte_pmd_i40e_ping_vfs;\n+\trte_pmd_i40e_reset_vf_stats;\n \trte_pmd_i40e_set_tx_loopback;\n \trte_pmd_i40e_set_vf_broadcast;\n \trte_pmd_i40e_set_vf_mac_addr;\n", "prefixes": [ "dpdk-dev", "v10", "25/26" ] }{ "id": 19397, "url": "