Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1303257/?format=api
{ "id": 1303257, "url": "http://patchwork.ozlabs.org/api/patches/1303257/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200604000105.15059-3-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-3-andre.guedes@intel.com>", "list_archive_url": null, "date": "2020-06-04T00:01:01", "name": "[2/6] igc: Remove duplicate code in tx timestamp handling", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "22cbfeaba155ce805a6091e2d0964eea316e3676", "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-3-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/1303257/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1303257/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 49cmCY4SNjz9sRN\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 4 Jun 2020 10:01:29 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 0DB028789B;\n\tThu, 4 Jun 2020 00:01:27 +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 d-vhoP3e21LY; Thu, 4 Jun 2020 00:01:24 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 91D9F8753F;\n\tThu, 4 Jun 2020 00:01:24 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by ash.osuosl.org (Postfix) with ESMTP id 2DC151BF46A\n for <intel-wired-lan@lists.osuosl.org>; Thu, 4 Jun 2020 00:01:23 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by silver.osuosl.org (Postfix) with ESMTP id 24BCB203F2\n for <intel-wired-lan@lists.osuosl.org>; Thu, 4 Jun 2020 00:01:23 +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 PiSlS8gQhrg2 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 13E2522091\n for <intel-wired-lan@lists.osuosl.org>; Thu, 4 Jun 2020 00:01:22 +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:21 -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 OQdNj3kFMsEG+gRq92a44uYp8dygM1ZS4fjRXk5JQekHJ9qdvBTztLSa5fdoWWW1mpmc8zPHxh\n e6wtsGNSi/2A==", "\n Nokek+pEEWq3eLq0cL7HDJeojCMIkH7e3lec1xjRaF6I7w2SZ1hCIlWus92YSJCycb953WpbWn\n HLCCJKhs5ORQ==" ], "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=\"272932799\"", "From": "Andre Guedes <andre.guedes@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 3 Jun 2020 17:01:01 -0700", "Message-Id": "<20200604000105.15059-3-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 2/6] igc: Remove duplicate code in tx\n timestamp handling", "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": "The functions igc_ptp_tx_hang() and igc_ptp_tx_work() have duplicate\ncode which handles tx timestamp timeouts. This patch does a trivial\nrefactoring by moving that code to its own function and reusing it.\n\nSigned-off-by: Andre Guedes <andre.guedes@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc_ptp.c | 34 +++++++++++-------------\n 1 file changed, 15 insertions(+), 19 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c\nindex 82e6c6c962d5..b1b23c6bf689 100644\n--- a/drivers/net/ethernet/intel/igc/igc_ptp.c\n+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c\n@@ -386,11 +386,23 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,\n \treturn 0;\n }\n \n+static void igc_ptp_tx_timeout(struct igc_adapter *adapter)\n+{\n+\tstruct igc_hw *hw = &adapter->hw;\n+\n+\tdev_kfree_skb_any(adapter->ptp_tx_skb);\n+\tadapter->ptp_tx_skb = NULL;\n+\tadapter->tx_hwtstamp_timeouts++;\n+\tclear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);\n+\t/* Clear the tx valid bit in TSYNCTXCTL register to enable interrupt. */\n+\trd32(IGC_TXSTMPH);\n+\tnetdev_warn(adapter->netdev, \"Tx timestamp timeout\\n\");\n+}\n+\n void igc_ptp_tx_hang(struct igc_adapter *adapter)\n {\n \tbool timeout = time_is_before_jiffies(adapter->ptp_tx_start +\n \t\t\t\t\t IGC_PTP_TX_TIMEOUT);\n-\tstruct igc_hw *hw = &adapter->hw;\n \n \tif (!adapter->ptp_tx_skb)\n \t\treturn;\n@@ -404,15 +416,7 @@ void igc_ptp_tx_hang(struct igc_adapter *adapter)\n \t */\n \tif (timeout) {\n \t\tcancel_work_sync(&adapter->ptp_tx_work);\n-\t\tdev_kfree_skb_any(adapter->ptp_tx_skb);\n-\t\tadapter->ptp_tx_skb = NULL;\n-\t\tclear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);\n-\t\tadapter->tx_hwtstamp_timeouts++;\n-\t\t/* Clear the Tx valid bit in TSYNCTXCTL register to enable\n-\t\t * interrupt\n-\t\t */\n-\t\trd32(IGC_TXSTMPH);\n-\t\tnetdev_warn(adapter->netdev, \"Clearing Tx timestamp hang\\n\");\n+\t\tigc_ptp_tx_timeout(adapter);\n \t}\n }\n \n@@ -467,15 +471,7 @@ static void igc_ptp_tx_work(struct work_struct *work)\n \n \tif (time_is_before_jiffies(adapter->ptp_tx_start +\n \t\t\t\t IGC_PTP_TX_TIMEOUT)) {\n-\t\tdev_kfree_skb_any(adapter->ptp_tx_skb);\n-\t\tadapter->ptp_tx_skb = NULL;\n-\t\tclear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state);\n-\t\tadapter->tx_hwtstamp_timeouts++;\n-\t\t/* Clear the tx valid bit in TSYNCTXCTL register to enable\n-\t\t * interrupt\n-\t\t */\n-\t\trd32(IGC_TXSTMPH);\n-\t\tnetdev_warn(adapter->netdev, \"Clearing Tx timestamp hang\\n\");\n+\t\tigc_ptp_tx_timeout(adapter);\n \t\treturn;\n \t}\n \n", "prefixes": [ "2/6" ] }