get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/618196/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 618196,
    "url": "http://patchwork.ozlabs.org/api/patches/618196/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1462317056-28805-1-git-send-email-nathan.sullivan@ni.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": "<1462317056-28805-1-git-send-email-nathan.sullivan@ni.com>",
    "list_archive_url": null,
    "date": "2016-05-03T23:10:56",
    "name": "igb: adjust ptp timestamps for tx/rx latency",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1b8290e250d92248ff81bff759cdaa370f0a4097",
    "submitter": {
        "id": 66323,
        "url": "http://patchwork.ozlabs.org/api/people/66323/?format=api",
        "name": "Nathan Sullivan",
        "email": "nathan.sullivan@ni.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/1462317056-28805-1-git-send-email-nathan.sullivan@ni.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/618196/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/618196/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\tby ozlabs.org (Postfix) with ESMTP id 3qzyXC0dTvz9ssM\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  4 May 2016 09:47:38 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 79A1A8A246;\n\tTue,  3 May 2016 23:47:37 +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 rLqfwgLoRDqh; Tue,  3 May 2016 23:47:36 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 89DFF8A189;\n\tTue,  3 May 2016 23:47:36 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 681EF1C0E66\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:12:20 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6223086B01\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:12:20 +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 N-FOnd3vFcUa for <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:12:19 +0000 (UTC)",
            "from ni.com (skprod2.natinst.com [130.164.80.23])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 9013E82975\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:12:19 +0000 (UTC)",
            "from us-aus-mgwout2.amer.corp.natinst.com\n\t(nb-snip2-1338.natinst.com [130.164.19.135])\n\tby us-aus-skprod2.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id\n\tu43NCHxY016135; Tue, 3 May 2016 18:12:17 -0500",
            "from nathan3500-linux-VM.amer.corp.natinst.com ([130.164.14.198])\n\tby us-aus-mgwout2.amer.corp.natinst.com (Lotus Domino Release\n\t8.5.3FP6 HF1218) with ESMTP id 2016050318113983-621700 ;\n\tTue, 3 May 2016 18:11:39 -0500 "
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "From": "Nathan Sullivan <nathan.sullivan@ni.com>",
        "To": "jeffrey.t.kirsher@intel.com, jesse.brandeburg@intel.com,\n\tshannon.nelson@intel.com, carolyn.wyborny@intel.com,\n\tdonald.c.skidmore@intel.com, bruce.w.allan@intel.com,\n\tjohn.ronciak@intel.com, mitch.a.williams@intel.com",
        "Date": "Tue, 3 May 2016 18:10:56 -0500",
        "Message-Id": "<1462317056-28805-1-git-send-email-nathan.sullivan@ni.com>",
        "X-Mailer": "git-send-email 1.7.10.4",
        "X-MIMETrack": "Itemize by SMTP Server on US-AUS-MGWOut2/AUS/H/NIC(Release\n\t8.5.3FP6 HF1218|December 12, 2014) at 05/03/2016 06:11:40 PM,\n\tSerialize by Router on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6\n\tHF1218|December 12, 2014) at 05/03/2016 06:11:40 PM,\n\tSerialize complete at 05/03/2016 06:11:40 PM",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2016-05-03_10:, , signatures=0",
        "X-Mailman-Approved-At": "Tue, 03 May 2016 23:47:35 +0000",
        "Cc": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,\n\tlinux-kernel@vger.kernel.org, Nathan Sullivan <nathan.sullivan@ni.com>",
        "Subject": "[Intel-wired-lan] [PATCH] igb: adjust ptp timestamps for tx/rx\n\tlatency",
        "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": "Table 7-62 on page 338 of the i210 datasheet lists TX and RX latencies\nfor the various speeds the chip supports.  To give better ptp timestamp\naccuracy, adjust the timestamps by the amounts Intel gives based on\ncurrent link speed.\n\nSigned-off-by: Nathan Sullivan <nathan.sullivan@ni.com>\n---\n drivers/net/ethernet/intel/igb/igb.h     |    8 +++++++\n drivers/net/ethernet/intel/igb/igb_ptp.c |   36 ++++++++++++++++++++++++++++++\n 2 files changed, 44 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex 9413fa6..7cee61f9 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -91,6 +91,14 @@ struct igb_adapter;\n #define NVM_COMB_VER_OFF\t0x0083\n #define NVM_COMB_VER_PTR\t0x003d\n \n+/* Transmit and receive latency (for PTP timestamps) */\n+#define IGB_I210_TX_LATENCY_10\t\t9542\n+#define IGB_I210_TX_LATENCY_100\t\t1024\n+#define IGB_I210_TX_LATENCY_1000\t178\n+#define IGB_I210_RX_LATENCY_10\t\t20662\n+#define IGB_I210_RX_LATENCY_100\t\t2213\n+#define IGB_I210_RX_LATENCY_1000\t448\n+\n struct vf_data_storage {\n \tunsigned char vf_mac_addresses[ETH_ALEN];\n \tu16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES];\ndiff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c\nindex 22a8a29..76a896d 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ptp.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c\n@@ -722,11 +722,29 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)\n \tstruct e1000_hw *hw = &adapter->hw;\n \tstruct skb_shared_hwtstamps shhwtstamps;\n \tu64 regval;\n+\tint adjust = 0;\n \n \tregval = rd32(E1000_TXSTMPL);\n \tregval |= (u64)rd32(E1000_TXSTMPH) << 32;\n \n \tigb_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval);\n+\t/* adjust timestamp for the TX latency based on link speed */\n+\tif (adapter->hw.mac.type == e1000_i210) {\n+\t\tswitch (adapter->link_speed) {\n+\t\tcase SPEED_10:\n+\t\t\tadjust = IGB_I210_TX_LATENCY_10;\n+\t\t\tbreak;\n+\t\tcase SPEED_100:\n+\t\t\tadjust = IGB_I210_TX_LATENCY_100;\n+\t\t\tbreak;\n+\t\tcase SPEED_1000:\n+\t\t\tadjust = IGB_I210_TX_LATENCY_1000;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tshhwtstamps.hwtstamp = ktime_sub_ns(shhwtstamps.hwtstamp, adjust);\n+\n \tskb_tstamp_tx(adapter->ptp_tx_skb, &shhwtstamps);\n \tdev_kfree_skb_any(adapter->ptp_tx_skb);\n \tadapter->ptp_tx_skb = NULL;\n@@ -771,6 +789,7 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,\n \tstruct igb_adapter *adapter = q_vector->adapter;\n \tstruct e1000_hw *hw = &adapter->hw;\n \tu64 regval;\n+\tint adjust = 0;\n \n \t/* If this bit is set, then the RX registers contain the time stamp. No\n \t * other packet will be time stamped until we read these registers, so\n@@ -790,6 +809,23 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,\n \n \tigb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval);\n \n+\t/* adjust timestamp for the RX latency based on link speed */\n+\tif (adapter->hw.mac.type == e1000_i210) {\n+\t\tswitch (adapter->link_speed) {\n+\t\tcase SPEED_10:\n+\t\t\tadjust = IGB_I210_RX_LATENCY_10;\n+\t\t\tbreak;\n+\t\tcase SPEED_100:\n+\t\t\tadjust = IGB_I210_RX_LATENCY_100;\n+\t\t\tbreak;\n+\t\tcase SPEED_1000:\n+\t\t\tadjust = IGB_I210_RX_LATENCY_1000;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tskb_hwtstamps(skb)->hwtstamp =\n+\t\tktime_add_ns(skb_hwtstamps(skb)->hwtstamp, adjust);\n+\n \t/* Update the last_rx_timestamp timer in order to enable watchdog check\n \t * for error case of latched timestamp on a dropped packet.\n \t */\n",
    "prefixes": []
}