get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 649685,
    "url": "http://patchwork.ozlabs.org/api/patches/649685/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1468653825-806-1-git-send-email-kshitiz.gupta@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": "<1468653825-806-1-git-send-email-kshitiz.gupta@ni.com>",
    "list_archive_url": null,
    "date": "2016-07-16T07:23:45",
    "name": "igb: fix adjusting ptp timestamps for tx/rx latency",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b9a42d517a3280190bb8df7f4575e071ca6a7a5c",
    "submitter": {
        "id": 69483,
        "url": "http://patchwork.ozlabs.org/api/people/69483/?format=api",
        "name": "Kshitiz Gupta",
        "email": "kshitiz.gupta@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/1468653825-806-1-git-send-email-kshitiz.gupta@ni.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/649685/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/649685/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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 3rtWPB6qSTz9s5J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Jul 2016 04:07:58 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 32DA430E4A;\n\tMon, 18 Jul 2016 18:07:57 +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 xg84IdQmM5YP; Mon, 18 Jul 2016 18:07:54 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 989DB30D2E;\n\tMon, 18 Jul 2016 18:07:54 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 075091C0975\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 16 Jul 2016 07:23:52 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 064348C613\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 16 Jul 2016 07:23:52 +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 pQ-wDTU0ym2m for <intel-wired-lan@lists.osuosl.org>;\n\tSat, 16 Jul 2016 07:23:50 +0000 (UTC)",
            "from ni.com (skprod2.natinst.com [130.164.80.23])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id B7A0E8C612\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 16 Jul 2016 07:23:50 +0000 (UTC)",
            "from us-aus-mgwout1.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\tu6G7NmY4019512; Sat, 16 Jul 2016 02:23:48 -0500",
            "from yuxuan-ubuntu.amer.corp.natinst.com ([130.164.14.198])\n\tby us-aus-mgwout1.amer.corp.natinst.com (Lotus Domino Release\n\t8.5.3FP6 HF1218) with ESMTP id 2016071602234797-912584 ;\n\tSat, 16 Jul 2016 02:23:47 -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": "Kshitiz Gupta <kshitiz.gupta@ni.com>",
        "To": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>,\n\tNathan Sullivan <nathan.sullivan@ni.com>,\n\tAaron Brown <aaron.f.brown@intel.com>",
        "Date": "Sat, 16 Jul 2016 02:23:45 -0500",
        "Message-Id": "<1468653825-806-1-git-send-email-kshitiz.gupta@ni.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1468620496-7849-1-git-send-email-kshitiz.gupta@ni.com>",
        "References": "<1468620496-7849-1-git-send-email-kshitiz.gupta@ni.com>",
        "X-MIMETrack": "Itemize by SMTP Server on US-AUS-MGWOut1/AUS/H/NIC(Release\n\t8.5.3FP6 HF1218|December 12, 2014) at 07/16/2016 02:23:48 AM,\n\tSerialize by Router on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6\n\tHF1218|December 12, 2014) at 07/16/2016 02:23:48 AM,\n\tSerialize complete at 07/16/2016 02:23:48 AM",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2016-07-16_05:, , signatures=0",
        "X-Mailman-Approved-At": "Mon, 18 Jul 2016 18:07:53 +0000",
        "Cc": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,\n\tKshitiz Gupta <kshitiz.gupta@ni.com>",
        "Subject": "[Intel-wired-lan] [PATCH] igb: fix adjusting ptp timestamps for\n\ttx/rx latency",
        "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": "Fix PHY delay compensation math in igb_ptp_tx_hwtstamp() and\nigb_ptp_rx_rgtstamp. Add PHY delay compensation in\nigb_ptp_rx_pktstamp().\n\nIn the IGB driver, there are two functions that retrieve timestamps\nreceived by the PHY - igb_ptp_rx_rgtstamp() and igb_ptp_rx_pktstamp().\nThe previous commit only changed igb_ptp_rx_rgtstamp(), and the change\nwas incorrect.\n\nThere are two instances in which PHY delay compensations should be\nmade:\n\n- Before the packet transmission over the PHY, the latency between\n  when the packet is timestamped and transmission of the packets,\n  should be an add operation, but it is currently a subtract.\n\n- After the packets are received from the PHY, the latency between\n  the receiving and timestamping of the packets should be a subtract\n  operation, but it is currently an add.\n\nSigned-off-by: Kshitiz Gupta <kshitiz.gupta@ni.com>\nFixes: 3f544d2 (igb: adjust ptp timestamps for tx/rx latency)\n---\n drivers/net/ethernet/intel/igb/igb_ptp.c | 26 +++++++++++++++++++++++---\n 1 file changed, 23 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c\nindex f097c5a..3c7bcdf 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ptp.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c\n@@ -743,7 +743,8 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)\n \t\t}\n \t}\n \n-\tshhwtstamps.hwtstamp = ktime_sub_ns(shhwtstamps.hwtstamp, adjust);\n+\tshhwtstamps.hwtstamp =\n+\t\tktime_add_ns(shhwtstamps.hwtstamp, adjust);\n \n \tskb_tstamp_tx(adapter->ptp_tx_skb, &shhwtstamps);\n \tdev_kfree_skb_any(adapter->ptp_tx_skb);\n@@ -766,13 +767,32 @@ void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector,\n \t\t\t struct sk_buff *skb)\n {\n \t__le64 *regval = (__le64 *)va;\n+\tstruct igb_adapter *adapter = q_vector->adapter;\n+\tint adjust = 0;\n \n \t/* The timestamp is recorded in little endian format.\n \t * DWORD: 0        1        2        3\n \t * Field: Reserved Reserved SYSTIML  SYSTIMH\n \t */\n-\tigb_ptp_systim_to_hwtstamp(q_vector->adapter, skb_hwtstamps(skb),\n+\tigb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb),\n \t\t\t\t   le64_to_cpu(regval[1]));\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_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);\n }\n \n /**\n@@ -824,7 +844,7 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,\n \t\t}\n \t}\n \tskb_hwtstamps(skb)->hwtstamp =\n-\t\tktime_add_ns(skb_hwtstamps(skb)->hwtstamp, adjust);\n+\t\tktime_sub_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",
    "prefixes": []
}