Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/714710/?format=api
{ "id": 714710, "url": "http://patchwork.ozlabs.org/api/patches/714710/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170112235942.5767-3-jacob.e.keller@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": "<20170112235942.5767-3-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2017-01-12T23:59:40", "name": "[3/5] fm10k: allow service task to reschedule itself", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a73855d10730b1311cf937dd34d37bc198d8346b", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@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/20170112235942.5767-3-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/714710/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/714710/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3v02n41hYVz9srY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 13 Jan 2017 10:59:52 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C011484725;\n\tThu, 12 Jan 2017 23:59:50 +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 YL5BrSbIX2MJ; Thu, 12 Jan 2017 23:59:49 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8BA3B847A1;\n\tThu, 12 Jan 2017 23:59:49 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0645F1BFF71\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 23:59:47 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id F32F22E174\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 23:59:46 +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 qLOgSw6NXQMF for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 23:59:45 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 79D712E122\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 23:59:45 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga101.fm.intel.com with ESMTP; 12 Jan 2017 15:59:45 -0800", "from jekeller-desk.amr.corp.intel.com ([10.166.35.174])\n\tby fmsmga001.fm.intel.com with ESMTP; 12 Jan 2017 15:59:44 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.33,220,1477983600\"; d=\"scan'208\";\n\ta=\"1093430204\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Thu, 12 Jan 2017 15:59:40 -0800", "Message-Id": "<20170112235942.5767-3-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.11.0.403.g196674b8396b", "In-Reply-To": "<20170112235942.5767-1-jacob.e.keller@intel.com>", "References": "<20170112235942.5767-1-jacob.e.keller@intel.com>", "Subject": "[Intel-wired-lan] [PATCH 3/5] fm10k: allow service task to\n\treschedule itself", "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": "If some code path executes fm10k_service_event_schedule(), it is\nguaranteed that we only queue the service task once, since we use\n__FM10K_SERVICE_SCHED flag. Unfortunately this has a side effect that if\na service request occurs while we are currently running the watchdog, it\nis possible that we will fail to notice the request and ignore it until\nthe next time the request occurs.\n\nThis can cause problems with pf/vf mailbox communication and other\nservice event tasks. To avoid this, introduce a FM10K_SERVICE_REQUEST\nbit. When we successfully schedule (and set the _SCHED bit) the service\ntask, we will clear this bit. However, if we are unable to currently\nschedule the service event, we just set the new SERVICE_REQUEST bit.\n\nFinally, after the service event completes, we will re-schedule if the\nrequest bit has been set.\n\nThis should ensure that we do not miss any service event schedules,\nsince we will re-schedule it once the currently running task finishes.\nThis means that for each request, we will always schedule the service\ntask to run at least once in full after the request came in.\n\nThis will avoid timing issues that can occur with the service event\nscheduling. We do pay a cost in re-running many tasks, but all the\nservice event tasks use either flags to avoid duplicate work, or are\ntolerant of being run multiple times.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k.h | 1 +\n drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 13 ++++++++++++-\n 2 files changed, 13 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h\nindex b496300d0268..689c413b7782 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k.h\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h\n@@ -272,6 +272,7 @@ enum fm10k_state_t {\n \t__FM10K_RESETTING,\n \t__FM10K_DOWN,\n \t__FM10K_SERVICE_SCHED,\n+\t__FM10K_SERVICE_REQUEST,\n \t__FM10K_SERVICE_DISABLE,\n \t__FM10K_MBX_LOCK,\n \t__FM10K_LINK_DOWN,\ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\nindex 68a265ac09f4..57ed2a98c6ab 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\n@@ -93,8 +93,12 @@ static int fm10k_hw_ready(struct fm10k_intfc *interface)\n void fm10k_service_event_schedule(struct fm10k_intfc *interface)\n {\n \tif (!test_bit(__FM10K_SERVICE_DISABLE, interface->state) &&\n-\t !test_and_set_bit(__FM10K_SERVICE_SCHED, interface->state))\n+\t !test_and_set_bit(__FM10K_SERVICE_SCHED, interface->state)) {\n+\t\tclear_bit(__FM10K_SERVICE_REQUEST, interface->state);\n \t\tqueue_work(fm10k_workqueue, &interface->service_task);\n+\t} else {\n+\t\tset_bit(__FM10K_SERVICE_REQUEST, interface->state);\n+\t}\n }\n \n static void fm10k_service_event_complete(struct fm10k_intfc *interface)\n@@ -104,6 +108,13 @@ static void fm10k_service_event_complete(struct fm10k_intfc *interface)\n \t/* flush memory to make sure state is correct before next watchog */\n \tsmp_mb__before_atomic();\n \tclear_bit(__FM10K_SERVICE_SCHED, interface->state);\n+\n+\t/* If a service event was requested since we started, immediately\n+\t * re-schedule now. This ensures we don't drop a request until the\n+\t * next timer event.\n+\t */\n+\tif (test_bit(__FM10K_SERVICE_REQUEST, interface->state))\n+\t\tfm10k_service_event_schedule(interface);\n }\n \n /**\n", "prefixes": [ "3/5" ] }