Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1303262/?format=api
{ "id": 1303262, "url": "http://patchwork.ozlabs.org/api/patches/1303262/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200604000105.15059-2-andre.guedes@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": "<20200604000105.15059-2-andre.guedes@intel.com>", "list_archive_url": null, "date": "2020-06-04T00:01:00", "name": "[1/6] igc: Clean up rx timestamping logic", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "8a3c1cb697b76183ec502fc99f987f38bdf00ff7", "submitter": { "id": 72323, "url": "http://patchwork.ozlabs.org/api/people/72323/?format=api", "name": "Andre Guedes", "email": "andre.guedes@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/20200604000105.15059-2-andre.guedes@intel.com/mbox/", "series": [ { "id": 181182, "url": "http://patchwork.ozlabs.org/api/series/181182/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=181182", "date": "2020-06-04T00:01:02", "name": "igc: PTP timestamping fixes", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/181182/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1303262/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1303262/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": [ "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)", "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49cmD80dDRz9sSc\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 4 Jun 2020 10:02:00 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 9DFB388650;\n\tThu, 4 Jun 2020 00:01:58 +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 Q1YAwvZrkTLx; Thu, 4 Jun 2020 00:01:56 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 69D838861A;\n\tThu, 4 Jun 2020 00:01:56 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by ash.osuosl.org (Postfix) with ESMTP id 81EAA1BF46A\n for <intel-wired-lan@lists.osuosl.org>; Thu, 4 Jun 2020 00:01:25 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by silver.osuosl.org (Postfix) with ESMTP id 7E38B203F2\n for <intel-wired-lan@lists.osuosl.org>; Thu, 4 Jun 2020 00:01:25 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id qAWkGAh5+eOB for <intel-wired-lan@lists.osuosl.org>;\n Thu, 4 Jun 2020 00:01:22 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by silver.osuosl.org (Postfix) with ESMTPS id D96C520445\n for <intel-wired-lan@lists.osuosl.org>; Thu, 4 Jun 2020 00:01:21 +0000 (UTC)", "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 03 Jun 2020 17:01:21 -0700", "from mrief-mobl1.amr.corp.intel.com ([10.209.62.192])\n by orsmga006.jf.intel.com with ESMTP; 03 Jun 2020 17:01:20 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "IronPort-SDR": [ "\n XA3eLM3yh6aZyl7P98+TRPTw15/UaevHkZF+KOI+E+JyT8hAM+qhNXEZvGsqtNi/1q7ViWrtfv\n bGI9Y5U/I5HA==", "\n uEbTPWPbbq2/ckSnRgCQixBINXXiKVv2ihzLbe2T0bOTXTQXJcjg5Oug0ACKmfh6UNDXqS5IIa\n QooKc9ncBmGw==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.73,470,1583222400\"; d=\"scan'208\";a=\"272932795\"", "From": "Andre Guedes <andre.guedes@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 3 Jun 2020 17:01:00 -0700", "Message-Id": "<20200604000105.15059-2-andre.guedes@intel.com>", "X-Mailer": "git-send-email 2.26.2", "In-Reply-To": "<20200604000105.15059-1-andre.guedes@intel.com>", "References": "<20200604000105.15059-1-andre.guedes@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 1/6] igc: Clean up rx timestamping logic", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "Differently from I210, I225 doesn't report rx timestamps via the TS bit\nrx descriptor + RXSTMPL/RXSTMPH registers mechanism. Rx timestamps are\nreported in the packet buffer only, which is implemented by igc_ptp_rx_\npktstamp(). So this patch removes igc_ptp_rx_rgtstamp() and all code\nrelated to it, copied from igb driver.\n\nSigned-off-by: Andre Guedes <andre.guedes@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc.h | 3 --\n drivers/net/ethernet/intel/igc/igc_defines.h | 2 -\n drivers/net/ethernet/intel/igc/igc_main.c | 12 ++----\n drivers/net/ethernet/intel/igc/igc_ptp.c | 44 +-------------------\n drivers/net/ethernet/intel/igc/igc_regs.h | 2 -\n 5 files changed, 5 insertions(+), 58 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h\nindex 9c57afad6afe..3070dfdb7eb4 100644\n--- a/drivers/net/ethernet/intel/igc/igc.h\n+++ b/drivers/net/ethernet/intel/igc/igc.h\n@@ -210,8 +210,6 @@ struct igc_adapter {\n \tstruct sk_buff *ptp_tx_skb;\n \tstruct hwtstamp_config tstamp_config;\n \tunsigned long ptp_tx_start;\n-\tunsigned long last_rx_ptp_check;\n-\tunsigned long last_rx_timestamp;\n \tunsigned int ptp_flags;\n \t/* System time value lock */\n \tspinlock_t tmreg_lock;\n@@ -549,7 +547,6 @@ void igc_ptp_init(struct igc_adapter *adapter);\n void igc_ptp_reset(struct igc_adapter *adapter);\n void igc_ptp_suspend(struct igc_adapter *adapter);\n void igc_ptp_stop(struct igc_adapter *adapter);\n-void igc_ptp_rx_rgtstamp(struct igc_q_vector *q_vector, struct sk_buff *skb);\n void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, void *va,\n \t\t\t struct sk_buff *skb);\n int igc_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);\ndiff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h\nindex 81df6de2b206..1c032c1ce4d3 100644\n--- a/drivers/net/ethernet/intel/igc/igc_defines.h\n+++ b/drivers/net/ethernet/intel/igc/igc_defines.h\n@@ -323,7 +323,6 @@\n \n /* Advanced Receive Descriptor bit definitions */\n #define IGC_RXDADV_STAT_TSIP\t0x08000 /* timestamp in packet */\n-#define IGC_RXDADV_STAT_TS\t0x10000 /* Pkt was time stamped */\n \n #define IGC_RXDEXT_STATERR_CE\t\t0x01000000\n #define IGC_RXDEXT_STATERR_SE\t\t0x02000000\n@@ -384,7 +383,6 @@\n #define IGC_FTQF_MASK_PROTO_BP\t0x10000000\n \n /* Time Sync Receive Control bit definitions */\n-#define IGC_TSYNCRXCTL_VALID\t\t0x00000001 /* Rx timestamp valid */\n #define IGC_TSYNCRXCTL_TYPE_MASK\t0x0000000E /* Rx type mask */\n #define IGC_TSYNCRXCTL_TYPE_L2_V2\t0x00\n #define IGC_TSYNCRXCTL_TYPE_L4_V1\t0x02\ndiff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex c767f5326ac9..4412ff573bcd 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -1480,9 +1480,9 @@ static inline void igc_rx_hash(struct igc_ring *ring,\n * @rx_desc: pointer to the EOP Rx descriptor\n * @skb: pointer to current skb being populated\n *\n- * This function checks the ring, descriptor, and packet information in\n- * order to populate the hash, checksum, VLAN, timestamp, protocol, and\n- * other fields within the skb.\n+ * This function checks the ring, descriptor, and packet information in order\n+ * to populate the hash, checksum, VLAN, protocol, and other fields within the\n+ * skb.\n */\n static void igc_process_skb_fields(struct igc_ring *rx_ring,\n \t\t\t\t union igc_adv_rx_desc *rx_desc,\n@@ -1492,10 +1492,6 @@ static void igc_process_skb_fields(struct igc_ring *rx_ring,\n \n \tigc_rx_checksum(rx_ring, rx_desc, skb);\n \n-\tif (igc_test_staterr(rx_desc, IGC_RXDADV_STAT_TS) &&\n-\t !igc_test_staterr(rx_desc, IGC_RXDADV_STAT_TSIP))\n-\t\tigc_ptp_rx_rgtstamp(rx_ring->q_vector, skb);\n-\n \tskb_record_rx_queue(skb, rx_ring->queue_index);\n \n \tskb->protocol = eth_type_trans(skb, rx_ring->netdev);\n@@ -1976,7 +1972,7 @@ static int igc_clean_rx_irq(struct igc_q_vector *q_vector, const int budget)\n \t\t/* probably a little skewed due to removing CRC */\n \t\ttotal_bytes += skb->len;\n \n-\t\t/* populate checksum, timestamp, VLAN, and protocol */\n+\t\t/* populate checksum, VLAN, and protocol */\n \t\tigc_process_skb_fields(rx_ring, rx_desc, skb);\n \n \t\tnapi_gro_receive(&q_vector->napi, skb);\ndiff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c\nindex 0d746f8588c8..82e6c6c962d5 100644\n--- a/drivers/net/ethernet/intel/igc/igc_ptp.c\n+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c\n@@ -205,46 +205,6 @@ void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, void *va,\n \t\tktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);\n }\n \n-/**\n- * igc_ptp_rx_rgtstamp - retrieve Rx timestamp stored in register\n- * @q_vector: Pointer to interrupt specific structure\n- * @skb: Buffer containing timestamp and packet\n- *\n- * This function is meant to retrieve a timestamp from the internal registers\n- * of the adapter and store it in the skb.\n- */\n-void igc_ptp_rx_rgtstamp(struct igc_q_vector *q_vector,\n-\t\t\t struct sk_buff *skb)\n-{\n-\tstruct igc_adapter *adapter = q_vector->adapter;\n-\tstruct igc_hw *hw = &adapter->hw;\n-\tu64 regval;\n-\n-\t/* If this bit is set, then the RX registers contain the time\n-\t * stamp. No other packet will be time stamped until we read\n-\t * these registers, so read the registers to make them\n-\t * available again. Because only one packet can be time\n-\t * stamped at a time, we know that the register values must\n-\t * belong to this one here and therefore we don't need to\n-\t * compare any of the additional attributes stored for it.\n-\t *\n-\t * If nothing went wrong, then it should have a shared\n-\t * tx_flags that we can turn into a skb_shared_hwtstamps.\n-\t */\n-\tif (!(rd32(IGC_TSYNCRXCTL) & IGC_TSYNCRXCTL_VALID))\n-\t\treturn;\n-\n-\tregval = rd32(IGC_RXSTMPL);\n-\tregval |= (u64)rd32(IGC_RXSTMPH) << 32;\n-\n-\tigc_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval);\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-\tadapter->last_rx_timestamp = jiffies;\n-}\n-\n /**\n * igc_ptp_enable_tstamp_rxqueue - Enable RX timestamp for a queue\n * @rx_ring: Pointer to RX queue\n@@ -419,11 +379,9 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,\n \t}\n \twrfl();\n \n-\t/* clear TX/RX time stamp registers, just to be sure */\n+\t/* clear TX time stamp registers, just to be sure */\n \tregval = rd32(IGC_TXSTMPL);\n \tregval = rd32(IGC_TXSTMPH);\n-\tregval = rd32(IGC_RXSTMPL);\n-\tregval = rd32(IGC_RXSTMPH);\n \n \treturn 0;\n }\ndiff --git a/drivers/net/ethernet/intel/igc/igc_regs.h b/drivers/net/ethernet/intel/igc/igc_regs.h\nindex 97f9b928509f..d53f49833db5 100644\n--- a/drivers/net/ethernet/intel/igc/igc_regs.h\n+++ b/drivers/net/ethernet/intel/igc/igc_regs.h\n@@ -228,8 +228,6 @@\n #define IGC_SYSTIMR\t0x0B6F8 /* System time register Residue */\n #define IGC_TIMINCA\t0x0B608 /* Increment attributes register - RW */\n \n-#define IGC_RXSTMPL\t0x0B624 /* Rx timestamp Low - RO */\n-#define IGC_RXSTMPH\t0x0B628 /* Rx timestamp High - RO */\n #define IGC_TXSTMPL\t0x0B618 /* Tx timestamp value Low - RO */\n #define IGC_TXSTMPH\t0x0B61C /* Tx timestamp value High - RO */\n \n", "prefixes": [ "1/6" ] }