Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1099619/?format=api
{ "id": 1099619, "url": "http://patchwork.ozlabs.org/api/patches/1099619/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190514173709.62431-7-alice.michael@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": "<20190514173709.62431-7-alice.michael@intel.com>", "list_archive_url": null, "date": "2019-05-14T17:37:05", "name": "[next,S5,iavf,07/11] iavf: Remove timer forwork triggering, use delaying work instead", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c37116b8ae18897c1390a25bc347107d95711a32", "submitter": { "id": 71123, "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api", "name": "Michael, Alice", "email": "alice.michael@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/20190514173709.62431-7-alice.michael@intel.com/mbox/", "series": [ { "id": 107823, "url": "http://patchwork.ozlabs.org/api/series/107823/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=107823", "date": "2019-05-14T17:37:00", "name": "[next,S5,iavf,01/11] iavf: Create VLAN tagelements starting from the first element", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/107823/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1099619/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1099619/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\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 453Pyr5FPqz9sML\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 15 May 2019 03:37:40 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2DA84860B2;\n\tTue, 14 May 2019 17:37:39 +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 PBdAfnA-EzGg; Tue, 14 May 2019 17:37:38 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 13290860C0;\n\tTue, 14 May 2019 17:37:38 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id E306E1BF3FF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:34 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id E01068607D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:34 +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 5TKn9djgwM7f for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:32 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 496EE860C8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:32 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 May 2019 10:37:31 -0700", "from alicemic-2.jf.intel.com ([10.166.16.121])\n\tby orsmga003.jf.intel.com with ESMTP; 14 May 2019 10:37:30 -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-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Alice Michael <alice.michael@intel.com>", "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Tue, 14 May 2019 10:37:05 -0700", "Message-Id": "<20190514173709.62431-7-alice.michael@intel.com>", "X-Mailer": "git-send-email 2.19.2", "In-Reply-To": "<20190514173709.62431-1-alice.michael@intel.com>", "References": "<20190514173709.62431-1-alice.michael@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [next PATCH S5 iavf 07/11] iavf: Remove timer for\n\twork triggering, use delaying work instead", "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\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<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\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "Jakub Pawlak <jakub.pawlak@intel.com>", "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": "From: Jakub Pawlak <jakub.pawlak@intel.com>\n\nRemove the watchdog timer, instead declare watchdog task\nas delayed work and use dedicated workqueue to service driver\ntasks. The dedicated driver workqueue iavf_wq is common\nfor all driver instances.\n\nSigned-off-by: Jakub Pawlak <jakub.pawlak@intel.com>\n---\n drivers/net/ethernet/intel/iavf/iavf.h | 4 +-\n .../net/ethernet/intel/iavf/iavf_ethtool.c | 4 +-\n drivers/net/ethernet/intel/iavf/iavf_main.c | 66 ++++++++-----------\n .../net/ethernet/intel/iavf/iavf_virtchnl.c | 2 +-\n 4 files changed, 31 insertions(+), 45 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h\nindex 657019418693..45dfb1a3bb40 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf.h\n+++ b/drivers/net/ethernet/intel/iavf/iavf.h\n@@ -216,7 +216,6 @@ struct iavf_cloud_filter {\n \n /* board specific private data structure */\n struct iavf_adapter {\n-\tstruct timer_list watchdog_timer;\n \tstruct work_struct reset_task;\n \tstruct work_struct adminq_task;\n \tstruct delayed_work client_task;\n@@ -303,7 +302,7 @@ struct iavf_adapter {\n \tenum iavf_state_t state;\n \tunsigned long crit_section;\n \n-\tstruct work_struct watchdog_task;\n+\tstruct delayed_work watchdog_task;\n \tbool netdev_registered;\n \tbool link_up;\n \tenum virtchnl_link_speed link_speed;\n@@ -359,6 +358,7 @@ struct iavf_device {\n /* needed by iavf_ethtool.c */\n extern char iavf_driver_name[];\n extern const char iavf_driver_version[];\n+extern struct workqueue_struct *iavf_wq;\n \n int iavf_up(struct iavf_adapter *adapter);\n void iavf_down(struct iavf_adapter *adapter);\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\nindex 5bdcd78f216d..dad3eec8ccd8 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\n@@ -510,7 +510,7 @@ static int iavf_set_priv_flags(struct net_device *netdev, u32 flags)\n \tif (changed_flags & IAVF_FLAG_LEGACY_RX) {\n \t\tif (netif_running(netdev)) {\n \t\t\tadapter->flags |= IAVF_FLAG_RESET_NEEDED;\n-\t\t\tschedule_work(&adapter->reset_task);\n+\t\t\tqueue_work(iavf_wq, &adapter->reset_task);\n \t\t}\n \t}\n \n@@ -622,7 +622,7 @@ static int iavf_set_ringparam(struct net_device *netdev,\n \n \tif (netif_running(netdev)) {\n \t\tadapter->flags |= IAVF_FLAG_RESET_NEEDED;\n-\t\tschedule_work(&adapter->reset_task);\n+\t\tqueue_work(iavf_wq, &adapter->reset_task);\n \t}\n \n \treturn 0;\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c\nindex f1b51d87ee71..7d994802d82e 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_main.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c\n@@ -57,7 +57,7 @@ MODULE_DESCRIPTION(\"Intel(R) Ethernet Adaptive Virtual Function Network Driver\")\n MODULE_LICENSE(\"GPL v2\");\n MODULE_VERSION(DRV_VERSION);\n \n-static struct workqueue_struct *iavf_wq;\n+struct workqueue_struct *iavf_wq;\n \n /**\n * iavf_allocate_dma_mem_d - OS specific memory alloc for shared code\n@@ -170,7 +170,7 @@ void iavf_schedule_reset(struct iavf_adapter *adapter)\n \tif (!(adapter->flags &\n \t (IAVF_FLAG_RESET_PENDING | IAVF_FLAG_RESET_NEEDED))) {\n \t\tadapter->flags |= IAVF_FLAG_RESET_NEEDED;\n-\t\tschedule_work(&adapter->reset_task);\n+\t\tqueue_work(iavf_wq, &adapter->reset_task);\n \t}\n }\n \n@@ -289,7 +289,7 @@ static irqreturn_t iavf_msix_aq(int irq, void *data)\n \trd32(hw, IAVF_VFINT_ICR0_ENA1);\n \n \t/* schedule work on the private workqueue */\n-\tschedule_work(&adapter->adminq_task);\n+\tqueue_work(iavf_wq, &adapter->adminq_task);\n \n \treturn IRQ_HANDLED;\n }\n@@ -980,7 +980,7 @@ static void iavf_up_complete(struct iavf_adapter *adapter)\n \tadapter->aq_required |= IAVF_FLAG_AQ_ENABLE_QUEUES;\n \tif (CLIENT_ENABLED(adapter))\n \t\tadapter->flags |= IAVF_FLAG_CLIENT_NEEDS_OPEN;\n-\tmod_timer_pending(&adapter->watchdog_timer, jiffies + 1);\n+\tmod_delayed_work(iavf_wq, &adapter->watchdog_task, 0);\n }\n \n /**\n@@ -1044,7 +1044,7 @@ void iavf_down(struct iavf_adapter *adapter)\n \t\tadapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES;\n \t}\n \n-\tmod_timer_pending(&adapter->watchdog_timer, jiffies + 1);\n+\tmod_delayed_work(iavf_wq, &adapter->watchdog_task, 0);\n }\n \n /**\n@@ -1532,19 +1532,6 @@ static int iavf_reinit_interrupt_scheme(struct iavf_adapter *adapter)\n \treturn err;\n }\n \n-/**\n- * iavf_watchdog_timer - Periodic call-back timer\n- * @data: pointer to adapter disguised as unsigned long\n- **/\n-static void iavf_watchdog_timer(struct timer_list *t)\n-{\n-\tstruct iavf_adapter *adapter = from_timer(adapter, t,\n-\t\t\t\t\t\t watchdog_timer);\n-\n-\tschedule_work(&adapter->watchdog_task);\n-\t/* timer will be rescheduled in watchdog task */\n-}\n-\n /**\n * iavf_process_aq_command - process aq_required flags\n * and sends aq command\n@@ -1680,7 +1667,7 @@ static void iavf_watchdog_task(struct work_struct *work)\n {\n \tstruct iavf_adapter *adapter = container_of(work,\n \t\t\t\t\t\t struct iavf_adapter,\n-\t\t\t\t\t\t watchdog_task);\n+\t\t\t\t\t\t watchdog_task.work);\n \tstruct iavf_hw *hw = &adapter->hw;\n \tu32 reg_val;\n \n@@ -1696,7 +1683,7 @@ static void iavf_watchdog_task(struct work_struct *work)\n \t\t\tdev_err(&adapter->pdev->dev, \"Hardware came out of reset. Attemptingreinit.\\n\");\n \t\t\tadapter->state = __IAVF_STARTUP;\n \t\t\tadapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;\n-\t\t\tschedule_delayed_work(&adapter->init_task, 10);\n+\t\t\tqueue_delayed_work(iavf_wq, &adapter->init_task, 10);\n \t\t\tclear_bit(__IAVF_IN_CRITICAL_TASK,\n \t\t\t\t &adapter->crit_section);\n \t\t\t/* Don't reschedule the watchdog, since we've restarted\n@@ -1721,7 +1708,7 @@ static void iavf_watchdog_task(struct work_struct *work)\n \t\tadapter->state = __IAVF_RESETTING;\n \t\tadapter->flags |= IAVF_FLAG_RESET_PENDING;\n \t\tdev_err(&adapter->pdev->dev, \"Hardware reset detected\\n\");\n-\t\tschedule_work(&adapter->reset_task);\n+\t\tqueue_work(iavf_wq, &adapter->reset_task);\n \t\tadapter->aq_required = 0;\n \t\tadapter->current_op = VIRTCHNL_OP_UNKNOWN;\n \t\tgoto watchdog_done;\n@@ -1753,11 +1740,11 @@ static void iavf_watchdog_task(struct work_struct *work)\n \tif (adapter->state == __IAVF_REMOVE)\n \t\treturn;\n \tif (adapter->aq_required)\n-\t\tmod_timer(&adapter->watchdog_timer,\n-\t\t\t jiffies + msecs_to_jiffies(20));\n+\t\tqueue_delayed_work(iavf_wq, &adapter->watchdog_task,\n+\t\t\t\t msecs_to_jiffies(20));\n \telse\n-\t\tmod_timer(&adapter->watchdog_timer, jiffies + (HZ * 2));\n-\tschedule_work(&adapter->adminq_task);\n+\t\tqueue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2);\n+\tqueue_work(iavf_wq, &adapter->adminq_task);\n }\n \n static void iavf_disable_vf(struct iavf_adapter *adapter)\n@@ -1981,7 +1968,7 @@ static void iavf_reset_task(struct work_struct *work)\n \tadapter->aq_required |= IAVF_FLAG_AQ_ADD_CLOUD_FILTER;\n \tiavf_misc_irq_enable(adapter);\n \n-\tmod_timer(&adapter->watchdog_timer, jiffies + 2);\n+\tmod_delayed_work(iavf_wq, &adapter->watchdog_task, 2);\n \n \t/* We were running when the reset started, so we need to restore some\n \t * state here.\n@@ -2922,7 +2909,7 @@ static int iavf_setup_tc(struct net_device *netdev, enum tc_setup_type type,\n * The open entry point is called when a network interface is made\n * active by the system (IFF_UP). At this point all resources needed\n * for transmit and receive operations are allocated, the interrupt\n- * handler is registered with the OS, the watchdog timer is started,\n+ * handler is registered with the OS, the watchdog is started,\n * and the stack is notified that the interface is ready.\n **/\n static int iavf_open(struct net_device *netdev)\n@@ -3057,7 +3044,7 @@ static int iavf_change_mtu(struct net_device *netdev, int new_mtu)\n \t\tadapter->flags |= IAVF_FLAG_SERVICE_CLIENT_REQUESTED;\n \t}\n \tadapter->flags |= IAVF_FLAG_RESET_NEEDED;\n-\tschedule_work(&adapter->reset_task);\n+\tqueue_work(iavf_wq, &adapter->reset_task);\n \n \treturn 0;\n }\n@@ -3492,8 +3479,7 @@ static void iavf_init_task(struct work_struct *work)\n \t\tether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);\n \t}\n \n-\ttimer_setup(&adapter->watchdog_timer, iavf_watchdog_timer, 0);\n-\tmod_timer(&adapter->watchdog_timer, jiffies + 1);\n+\tqueue_delayed_work(iavf_wq, &adapter->watchdog_task, 1);\n \n \tadapter->tx_desc_count = IAVF_DEFAULT_TXD;\n \tadapter->rx_desc_count = IAVF_DEFAULT_RXD;\n@@ -3544,13 +3530,14 @@ static void iavf_init_task(struct work_struct *work)\n \n \tif (RSS_AQ(adapter)) {\n \t\tadapter->aq_required |= IAVF_FLAG_AQ_CONFIGURE_RSS;\n-\t\tmod_timer_pending(&adapter->watchdog_timer, jiffies + 1);\n+\t\tmod_delayed_work(iavf_wq, &adapter->watchdog_task, 1);\n \t} else {\n \t\tiavf_init_rss(adapter);\n \t}\n \treturn;\n restart:\n-\tschedule_delayed_work(&adapter->init_task, msecs_to_jiffies(30));\n+\tqueue_delayed_work(iavf_wq, &adapter->init_task,\n+\t\t\t msecs_to_jiffies(30));\n \treturn;\n err_mem:\n \tiavf_free_rss(adapter);\n@@ -3568,10 +3555,10 @@ static void iavf_init_task(struct work_struct *work)\n \t\tadapter->flags |= IAVF_FLAG_PF_COMMS_FAILED;\n \t\tiavf_shutdown_adminq(hw);\n \t\tadapter->state = __IAVF_STARTUP;\n-\t\tschedule_delayed_work(&adapter->init_task, HZ * 5);\n+\t\tqueue_delayed_work(iavf_wq, &adapter->init_task, HZ * 5);\n \t\treturn;\n \t}\n-\tschedule_delayed_work(&adapter->init_task, HZ);\n+\tqueue_delayed_work(iavf_wq, &adapter->init_task, HZ);\n }\n \n /**\n@@ -3696,11 +3683,11 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \n \tINIT_WORK(&adapter->reset_task, iavf_reset_task);\n \tINIT_WORK(&adapter->adminq_task, iavf_adminq_task);\n-\tINIT_WORK(&adapter->watchdog_task, iavf_watchdog_task);\n+\tINIT_DELAYED_WORK(&adapter->watchdog_task, iavf_watchdog_task);\n \tINIT_DELAYED_WORK(&adapter->client_task, iavf_client_task);\n \tINIT_DELAYED_WORK(&adapter->init_task, iavf_init_task);\n-\tschedule_delayed_work(&adapter->init_task,\n-\t\t\t msecs_to_jiffies(5 * (pdev->devfn & 0x07)));\n+\tqueue_delayed_work(iavf_wq, &adapter->init_task,\n+\t\t\t msecs_to_jiffies(5 * (pdev->devfn & 0x07)));\n \n \t/* Setup the wait queue for indicating transition to down status */\n \tinit_waitqueue_head(&adapter->down_waitqueue);\n@@ -3796,7 +3783,7 @@ static int iavf_resume(struct pci_dev *pdev)\n \t\treturn err;\n \t}\n \n-\tschedule_work(&adapter->reset_task);\n+\tqueue_work(iavf_wq, &adapter->reset_task);\n \n \tnetif_device_attach(netdev);\n \n@@ -3856,8 +3843,7 @@ static void iavf_remove(struct pci_dev *pdev)\n \tiavf_reset_interrupt_capability(adapter);\n \tiavf_free_q_vectors(adapter);\n \n-\tif (adapter->watchdog_timer.function)\n-\t\tdel_timer_sync(&adapter->watchdog_timer);\n+\tcancel_delayed_work_sync(&adapter->watchdog_task);\n \n \tcancel_work_sync(&adapter->adminq_task);\n \ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\nindex dd97509e2da1..cb7c56c5afe6 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\n@@ -1238,7 +1238,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,\n \t\t\tif (!(adapter->flags & IAVF_FLAG_RESET_PENDING)) {\n \t\t\t\tadapter->flags |= IAVF_FLAG_RESET_PENDING;\n \t\t\t\tdev_info(&adapter->pdev->dev, \"Scheduling reset task\\n\");\n-\t\t\t\tschedule_work(&adapter->reset_task);\n+\t\t\t\tqueue_work(iavf_wq, &adapter->reset_task);\n \t\t\t}\n \t\t\tbreak;\n \t\tdefault:\n", "prefixes": [ "next", "S5", "iavf", "07/11" ] }