Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/756516/?format=api
{ "id": 756516, "url": "http://patchwork.ozlabs.org/api/patches/756516/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170428184421.20216-4-jacob.e.keller@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": "<20170428184421.20216-4-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2017-04-28T18:44:19", "name": "[v3,3/5] net-intel: add statistic indicating number of skipped Tx timestamps", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "82590c8816ef340525af8148275f068cc700107f", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@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/20170428184421.20216-4-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/756516/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/756516/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3wF2mJ3qk1z9s7y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 29 Apr 2017 04:44:32 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1EDAE8841D;\n\tFri, 28 Apr 2017 18:44:31 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id eG7gc_2Ce_S1; Fri, 28 Apr 2017 18:44:28 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id ADB81884C8;\n\tFri, 28 Apr 2017 18:44:28 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2D3FC1CE8F3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Apr 2017 18:44:26 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 20E6E8A23D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Apr 2017 18:44:26 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id b0PJ1kHNxjOl for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Apr 2017 18:44:25 +0000 (UTC)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 2FB368A28B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Apr 2017 18:44:25 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga105.jf.intel.com with ESMTP; 28 Apr 2017 11:44:24 -0700", "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([10.166.35.158])\n\tby fmsmga001.fm.intel.com with ESMTP; 28 Apr 2017 11:44:24 -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.37,389,1488873600\"; d=\"scan'208\";\n\ta=\"1141484705\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Fri, 28 Apr 2017 11:44:19 -0700", "Message-Id": "<20170428184421.20216-4-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.13.0.rc0.317.gcc792a6cad5a", "In-Reply-To": "<20170428184421.20216-1-jacob.e.keller@intel.com>", "References": "<20170428184421.20216-1-jacob.e.keller@intel.com>", "Cc": "Richard Cochran <richardcochran@gmail.com>", "Subject": "[Intel-wired-lan] [PATCH v3 3/5] net-intel: add statistic\n\tindicating number of skipped Tx timestamps", "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": "The e1000e, igb, i40e, and ixgbe drivers share similar code for handling\nTx timestamps, with a similar limitation of only one Tx timestamp\nregister set. Because the hardware only supports one Tx timestamp at\na time, the drivers may silently ignore timestamp requests for packets\nwhile waiting for a previous packet timestamp to complete. Add a new\nstatistic, tx_hwtstamp_skipped, which indicates how many times this has\nhappened. This is useful when trying to determine why a specific\napplication is not receiving timestamps. Without this statistic, the\ndeveloper may not have any indication that the timestamp was\nintentionally skipped.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/e1000e/e1000.h | 1 +\n drivers/net/ethernet/intel/e1000e/ethtool.c | 1 +\n drivers/net/ethernet/intel/e1000e/netdev.c | 17 ++++++++++-------\n drivers/net/ethernet/intel/i40e/i40e.h | 1 +\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 +\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 1 +\n drivers/net/ethernet/intel/igb/igb.h | 1 +\n drivers/net/ethernet/intel/igb/igb_ethtool.c | 1 +\n drivers/net/ethernet/intel/igb/igb_main.c | 2 ++\n drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 3 +++\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 21 ++++++++++++---------\n 12 files changed, 35 insertions(+), 16 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h\nindex c7c994eb410e..98e68888abb1 100644\n--- a/drivers/net/ethernet/intel/e1000e/e1000.h\n+++ b/drivers/net/ethernet/intel/e1000e/e1000.h\n@@ -268,6 +268,7 @@ struct e1000_adapter {\n \tu32 tx_fifo_size;\n \tu32 tx_dma_failed;\n \tu32 tx_hwtstamp_timeouts;\n+\tu32 tx_hwtstamp_skipped;\n \n \t/* Rx */\n \tbool (*clean_rx)(struct e1000_ring *ring, int *work_done,\ndiff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c\nindex e23dbd9190d6..c658f6ebf7cb 100644\n--- a/drivers/net/ethernet/intel/e1000e/ethtool.c\n+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c\n@@ -105,6 +105,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {\n \tE1000_STAT(\"uncorr_ecc_errors\", uncorr_errors),\n \tE1000_STAT(\"corr_ecc_errors\", corr_errors),\n \tE1000_STAT(\"tx_hwtstamp_timeouts\", tx_hwtstamp_timeouts),\n+\tE1000_STAT(\"tx_hwtstamp_skipped\", tx_hwtstamp_skipped),\n };\n \n #define E1000_GLOBAL_STATS_LEN\tARRAY_SIZE(e1000_gstrings_stats)\ndiff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex ec9a50a72550..42424274853c 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -5866,13 +5866,16 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,\n \t\t\t nr_frags);\n \tif (count) {\n \t\tif (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&\n-\t\t (adapter->flags & FLAG_HAS_HW_TIMESTAMP) &&\n-\t\t !adapter->tx_hwtstamp_skb) {\n-\t\t\tskb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;\n-\t\t\ttx_flags |= E1000_TX_FLAGS_HWTSTAMP;\n-\t\t\tadapter->tx_hwtstamp_skb = skb_get(skb);\n-\t\t\tadapter->tx_hwtstamp_start = jiffies;\n-\t\t\tschedule_work(&adapter->tx_hwtstamp_work);\n+\t\t (adapter->flags & FLAG_HAS_HW_TIMESTAMP)) {\n+\t\t\tif (!adapter->tx_hwtstamp_skb) {\n+\t\t\t\tskb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;\n+\t\t\t\ttx_flags |= E1000_TX_FLAGS_HWTSTAMP;\n+\t\t\t\tadapter->tx_hwtstamp_skb = skb_get(skb);\n+\t\t\t\tadapter->tx_hwtstamp_start = jiffies;\n+\t\t\t\tschedule_work(&adapter->tx_hwtstamp_work);\n+\t\t\t} else {\n+\t\t\t\tadapter->tx_hwtstamp_skipped++;\n+\t\t\t}\n \t\t} else {\n \t\t\tskb_tx_timestamp(skb);\n \t\t}\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex cdde3cc28fb5..aa46ae016539 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -506,6 +506,7 @@ struct i40e_pf {\n \tstruct mutex tmreg_lock; /* Used to protect the SYSTIME registers. */\n \tu64 ptp_base_adj;\n \tu32 tx_hwtstamp_timeouts;\n+\tu32 tx_hwtstamp_skipped;\n \tu32 rx_hwtstamp_cleared;\n \tu32 latch_event_flags;\n \tspinlock_t ptp_rx_lock; /* Used to protect Rx timestamp registers. */\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 7a8eb486b9ea..35a246f05520 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -147,6 +147,7 @@ static const struct i40e_stats i40e_gstrings_stats[] = {\n \tI40E_PF_STAT(\"VF_admin_queue_requests\", vf_aq_requests),\n \tI40E_PF_STAT(\"arq_overflows\", arq_overflows),\n \tI40E_PF_STAT(\"rx_hwtstamp_cleared\", rx_hwtstamp_cleared),\n+\tI40E_PF_STAT(\"tx_hwtstamp_skipped\", tx_hwtstamp_skipped),\n \tI40E_PF_STAT(\"fdir_flush_cnt\", fd_flush_cnt),\n \tI40E_PF_STAT(\"fdir_atr_match\", stats.fd_atr_match),\n \tI40E_PF_STAT(\"fdir_atr_tunnel_match\", stats.fd_atr_tunnel_match),\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 19984be0f70c..c69ee4b0cfe2 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -2630,6 +2630,7 @@ static int i40e_tsyn(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \t\tskb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;\n \t\tpf->ptp_tx_skb = skb_get(skb);\n \t} else {\n+\t\tpf->tx_hwtstamp_skipped++;\n \t\treturn 0;\n \t}\n \ndiff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex bf9bf9056d0c..be35edcf6b08 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -563,6 +563,7 @@ struct igb_adapter {\n \tstruct cyclecounter cc;\n \tstruct timecounter tc;\n \tu32 tx_hwtstamp_timeouts;\n+\tu32 tx_hwtstamp_skipped;\n \tu32 rx_hwtstamp_cleared;\n \tbool pps_sys_wrap_on;\n \ndiff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c\nindex 0efb62db6efd..8730f7cbce68 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c\n@@ -90,6 +90,7 @@ static const struct igb_stats igb_gstrings_stats[] = {\n \tIGB_STAT(\"os2bmc_tx_by_host\", stats.o2bspc),\n \tIGB_STAT(\"os2bmc_rx_by_host\", stats.b2ogprc),\n \tIGB_STAT(\"tx_hwtstamp_timeouts\", tx_hwtstamp_timeouts),\n+\tIGB_STAT(\"tx_hwtstamp_skipped\", tx_hwtstamp_skipped),\n \tIGB_STAT(\"rx_hwtstamp_cleared\", rx_hwtstamp_cleared),\n };\n \ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 978908f426a7..21b455bfb4ca 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -5392,6 +5392,8 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,\n \t\t\tadapter->ptp_tx_start = jiffies;\n \t\t\tif (adapter->hw.mac.type == e1000_82576)\n \t\t\t\tschedule_work(&adapter->ptp_tx_work);\n+\t\t} else {\n+\t\t\tadapter->tx_hwtstamp_skipped++;\n \t\t}\n \t}\n \ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 76263762bea1..eb36106218ad 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -733,6 +733,7 @@ struct ixgbe_adapter {\n \tstruct timecounter hw_tc;\n \tu32 base_incval;\n \tu32 tx_hwtstamp_timeouts;\n+\tu32 tx_hwtstamp_skipped;\n \tu32 rx_hwtstamp_cleared;\n \tvoid (*ptp_setup_sdp)(struct ixgbe_adapter *);\n \ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\nindex cced74dd5a63..0b75d304b009 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n@@ -111,6 +111,9 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = {\n \t{\"os2bmc_tx_by_bmc\", IXGBE_STAT(stats.b2ospc)},\n \t{\"os2bmc_tx_by_host\", IXGBE_STAT(stats.o2bspc)},\n \t{\"os2bmc_rx_by_host\", IXGBE_STAT(stats.b2ogprc)},\n+\t{\"tx_hwtstamp_timeouts\", IXGBE_STAT(tx_hwtstamp_timeouts)},\n+\t{\"tx_hwtstamp_skipped\", IXGBE_STAT(tx_hwtstamp_skipped)},\n+\t{\"rx_hwtstamp_cleared\", IXGBE_STAT(rx_hwtstamp_cleared)},\n #ifdef IXGBE_FCOE\n \t{\"fcoe_bad_fccrc\", IXGBE_STAT(stats.fccrc)},\n \t{\"rx_fcoe_dropped\", IXGBE_STAT(stats.fcoerpdc)},\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 54bf0f9f5573..c61459fcc21e 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -8346,16 +8346,19 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,\n \tprotocol = vlan_get_protocol(skb);\n \n \tif (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&\n-\t adapter->ptp_clock &&\n-\t !test_and_set_bit_lock(__IXGBE_PTP_TX_IN_PROGRESS,\n-\t\t\t\t &adapter->state)) {\n-\t\tskb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;\n-\t\ttx_flags |= IXGBE_TX_FLAGS_TSTAMP;\n+\t adapter->ptp_clock) {\n+\t\tif (!test_and_set_bit_lock(__IXGBE_PTP_TX_IN_PROGRESS,\n+\t\t\t\t\t &adapter->state)) {\n+\t\t\tskb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;\n+\t\t\ttx_flags |= IXGBE_TX_FLAGS_TSTAMP;\n \n-\t\t/* schedule check for Tx timestamp */\n-\t\tadapter->ptp_tx_skb = skb_get(skb);\n-\t\tadapter->ptp_tx_start = jiffies;\n-\t\tschedule_work(&adapter->ptp_tx_work);\n+\t\t\t/* schedule check for Tx timestamp */\n+\t\t\tadapter->ptp_tx_skb = skb_get(skb);\n+\t\t\tadapter->ptp_tx_start = jiffies;\n+\t\t\tschedule_work(&adapter->ptp_tx_work);\n+\t\t} else {\n+\t\t\tadapter->tx_hwtstamp_skipped++;\n+\t\t}\n \t}\n \n \tskb_tx_timestamp(skb);\n", "prefixes": [ "v3", "3/5" ] }