Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/661667/?format=api
{ "id": 661667, "url": "http://patchwork.ozlabs.org/api/patches/661667/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1471905790-4222-3-git-send-email-sridhar.samudrala@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1471905790-4222-3-git-send-email-sridhar.samudrala@intel.com>", "list_archive_url": null, "date": "2016-08-22T22:43:09", "name": "[dev-queue,v3,2/3] i40e: Enable VF specific ethtool statistics via VF Port representor netdevs.", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "8e3835bc799566817794b44aaccb696dfc351bbf", "submitter": { "id": 65219, "url": "http://patchwork.ozlabs.org/api/people/65219/?format=api", "name": "Samudrala, Sridhar", "email": "sridhar.samudrala@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1471905790-4222-3-git-send-email-sridhar.samudrala@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/661667/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/661667/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3sJ9K95vY9z9s8x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 23 Aug 2016 09:49:33 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 6043E895D4;\n\tMon, 22 Aug 2016 23:49:32 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id cqp+VAP-RDsM; Mon, 22 Aug 2016 23:49:29 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 01CFF8A14D;\n\tMon, 22 Aug 2016 23:49:25 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 696CA1C2BE5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 22 Aug 2016 23:49:22 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 6126D31428\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 22 Aug 2016 23:49:22 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id xiRwht3W11LM for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 22 Aug 2016 23:49:20 +0000 (UTC)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 04F5B31429\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 22 Aug 2016 23:49:20 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga104.jf.intel.com with ESMTP; 22 Aug 2016 16:49:19 -0700", "from unknown (HELO sri-mi-02.jf.intel.com) ([10.166.31.66])\n\tby fmsmga004.fm.intel.com with ESMTP; 22 Aug 2016 16:49:19 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.28,562,1464678000\"; d=\"scan'208\";a=\"159588715\"", "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>", "To": "intel-wired-lan@lists.osuosl.org, anjali.singhai@intel.com,\n\tjohn.r.fastabend@intel.com, amritha.nambiar@intel.com,\n\talexander.h.duyck@intel.com", "Date": "Tue, 23 Aug 2016 00:43:09 +0200", "Message-Id": "<1471905790-4222-3-git-send-email-sridhar.samudrala@intel.com>", "X-Mailer": "git-send-email 2.5.5", "In-Reply-To": "<1471905790-4222-1-git-send-email-sridhar.samudrala@intel.com>", "References": "<1471905790-4222-1-git-send-email-sridhar.samudrala@intel.com>", "Subject": "[Intel-wired-lan] [dev-queue PATCH v3 2/3] i40e: Enable VF specific\n\tethtool statistics via VF Port representor netdevs.", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Sample script that shows ethtool stats on VF representor netdev\nPF: enp5s0f0, VF0: enp5s2 VF_REP0: enp5s0f0-vf0\n\n # echo 2 > /sys/class/net/enp5s0f0/device/sriov_numvfs\n # ip link set enp5s2 up\n # ethtool -S enp5s0f0-vf0\n NIC statistics:\n tx_bytes: 0\n tx_unicast: 0\n tx_multicast: 0\n tx_broadcast: 0\n tx_discards: 0\n tx_errors: 0\n rx_bytes: 140\n rx_unicast: 0\n rx_multicast: 2\n rx_broadcast: 0\n rx_discards: 0\n rx_unknown_protocol: 0\n\nSigned-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 1 +\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 72 ++++++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 1 +\n 3 files changed, 74 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 19103a6..13b1f75 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -866,4 +866,5 @@ i40e_status i40e_get_npar_bw_setting(struct i40e_pf *pf);\n i40e_status i40e_set_npar_bw_setting(struct i40e_pf *pf);\n i40e_status i40e_commit_npar_bw_setting(struct i40e_pf *pf);\n void i40e_print_link_message(struct i40e_vsi *vsi, bool isup);\n+void i40e_set_vf_netdev_ethtool_ops(struct net_device *netdev);\n #endif /* _I40E_H_ */\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 1835186..e2d3168 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -3116,3 +3116,75 @@ void i40e_set_ethtool_ops(struct net_device *netdev)\n {\n \tnetdev->ethtool_ops = &i40e_ethtool_ops;\n }\n+\n+/* As the VF Port representor(VFPR) represents the switch port corresponding\n+ * to a VF, the tx_ and rx_ strings are swapped to indicate that the frames\n+ * transmitted from VF are received on VFPR and the frames received on VF are\n+ * transmitted from VFPR.\n+ */\n+static const char i40e_vf_netdev_ethtool_sset[][ETH_GSTRING_LEN] = {\n+\t\"tx_bytes\",\n+\t\"tx_unicast\",\n+\t\"tx_multicast\",\n+\t\"tx_broadcast\",\n+\t\"tx_discards\",\n+\t\"tx_errors\",\n+\t\"rx_bytes\",\n+\t\"rx_unicast\",\n+\t\"rx_multicast\",\n+\t\"rx_broadcast\",\n+\t\"rx_discards\",\n+\t\"rx_unknown_protocol\",\n+};\n+\n+#define I40E_VF_NETDEV_ETHTOOL_STAT_COUNT \\\n+\t\t\tARRAY_SIZE(i40e_vf_netdev_ethtool_sset)\n+\n+static void i40e_vf_netdev_ethtool_get_strings(struct net_device *dev,\n+\t\t\t\t\t u32 stringset,\n+\t\t\t\t\t u8 *ethtool_strings)\n+{\n+\tswitch (stringset) {\n+\tcase ETH_SS_STATS:\n+\t\tmemcpy(ethtool_strings, &i40e_vf_netdev_ethtool_sset,\n+\t\t sizeof(i40e_vf_netdev_ethtool_sset));\n+\t\tbreak;\n+\t}\n+}\n+\n+static int i40e_vf_netdev_ethtool_get_sset_count(struct net_device *dev,\n+\t\t\t\t\t\t int stringset)\n+{\n+\tswitch (stringset) {\n+\tcase ETH_SS_STATS:\n+\t\treturn I40E_VF_NETDEV_ETHTOOL_STAT_COUNT;\n+\tdefault:\n+\t\treturn -EOPNOTSUPP;\n+\t}\n+}\n+\n+static void i40e_vf_netdev_ethtool_get_stats(struct net_device *dev,\n+\t\t\t\tstruct ethtool_stats *target_ethtool_stats,\n+\t\t\t\tu64 *target_stat_values)\n+{\n+\tstruct i40e_vf_netdev_priv *priv = netdev_priv(dev);\n+\tstruct i40e_vf *vf = priv->vf;\n+\tstruct i40e_pf *pf = vf->pf;\n+\tstruct i40e_vsi *vsi;\n+\n+\tvsi = pf->vsi[vf->lan_vsi_idx];\n+\ti40e_update_stats(vsi);\n+\tmemcpy(target_stat_values, &vsi->eth_stats,\n+\t I40E_VF_NETDEV_ETHTOOL_STAT_COUNT * 8);\n+}\n+\n+static const struct ethtool_ops i40e_vf_netdev_ethtool_ops = {\n+\t.get_strings\t\t= i40e_vf_netdev_ethtool_get_strings,\n+\t.get_ethtool_stats = i40e_vf_netdev_ethtool_get_stats,\n+\t.get_sset_count = i40e_vf_netdev_ethtool_get_sset_count,\n+};\n+\n+void i40e_set_vf_netdev_ethtool_ops(struct net_device *netdev)\n+{\n+\tnetdev->ethtool_ops = &i40e_vf_netdev_ethtool_ops;\n+}\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 6167e56..b5a716e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1049,6 +1049,7 @@ int i40e_alloc_vf_netdev(struct i40e_vf *vf, u16 vf_num)\n \tpriv->vf = &(pf->vf[vf_num]);\n \n \tnetdev->netdev_ops = &i40e_vf_netdev_ops;\n+\ti40e_set_vf_netdev_ethtool_ops(netdev);\n \n \tnetif_carrier_off(netdev);\n \tnetif_tx_disable(netdev);\n", "prefixes": [ "dev-queue", "v3", "2/3" ] }