Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1192126/?format=api
{ "id": 1192126, "url": "http://patchwork.ozlabs.org/api/patches/1192126/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1573243090-2721-1-git-send-email-magnus.karlsson@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": "<1573243090-2721-1-git-send-email-magnus.karlsson@intel.com>", "list_archive_url": null, "date": "2019-11-08T19:58:09", "name": "[net,1/2] i40e: need_wakeup flag might not be set for Tx", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d69c0d6a634d3cc23fe22662d266280a3ef00157", "submitter": { "id": 72726, "url": "http://patchwork.ozlabs.org/api/people/72726/?format=api", "name": "Magnus Karlsson", "email": "magnus.karlsson@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/1573243090-2721-1-git-send-email-magnus.karlsson@intel.com/mbox/", "series": [ { "id": 141759, "url": "http://patchwork.ozlabs.org/api/series/141759/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=141759", "date": "2019-11-08T19:58:09", "name": "[net,1/2] i40e: need_wakeup flag might not be set for Tx", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/141759/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1192126/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1192126/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.133;\n\thelo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 478rg3539Nz9sPF\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 Nov 2019 06:58:23 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3C4C787E55;\n\tFri, 8 Nov 2019 19:58:22 +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 xrS-jfavkKOH; Fri, 8 Nov 2019 19:58:21 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 1A3B787E8E;\n\tFri, 8 Nov 2019 19:58:21 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 161D31BF2FE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Nov 2019 19:58:19 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0D0AE2353A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Nov 2019 19:58:19 +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 4s7A0wnwO5tf for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Nov 2019 19:58:18 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id EC67D22658\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Nov 2019 19:58:17 +0000 (UTC)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Nov 2019 11:58:16 -0800", "from unknown (HELO VM.ch.intel.com) ([10.78.3.78])\n\tby orsmga004.jf.intel.com with ESMTP; 08 Nov 2019 11:58:16 -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-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.68,283,1569308400\"; d=\"scan'208\";a=\"354188892\"", "From": "Magnus Karlsson <magnus.karlsson@intel.com>", "To": "magnus.karlsson@intel.com, bjorn.topel@intel.com,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Fri, 8 Nov 2019 20:58:09 +0100", "Message-Id": "<1573243090-2721-1-git-send-email-magnus.karlsson@intel.com>", "X-Mailer": "git-send-email 2.7.4", "Subject": "[Intel-wired-lan] [PATCH net 1/2] i40e: need_wakeup flag might not\n\tbe set for Tx", "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": "maciejromanfijalkowski@gmail.com, maciej.fijalkowski@intel.com,\n\tnetdev@vger.kernel.org", "MIME-Version": "1.0", "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 need_wakeup flag for Tx might not be set for AF_XDP sockets that\nare only used to send packets. This happens if there is at least one\noutstanding packet that has not been completed by the hardware and we\nget that corresponding completion (which will not generate an\ninterrupt since interrupts are disabled in the napi poll loop) between\nthe time we stopped processing the Tx completions and interrupts are\nenabled again. In this case, the need_wakeup flag will have been\ncleared at the end of the Tx completion processing as we believe we\nwill get an interrupt from the outstanding completion at a later point\nin time. But if this completion interrupt occurs before interrupts\nare enable, we lose it and should at that point really have set the\nneed_wakeup flag since there are no more outstanding completions that\ncan generate an interrupt to continue the processing. When this\nhappens, user space will see a Tx queue need_wakeup of 0 and skip\nissuing a syscall, which means will never get into the Tx processing\nagain and we have a deadlock.\n\nThis patch introduces a quick fix for this issue by just setting the\nneed_wakeup flag for Tx to 1 all the time. I am working on a proper\nfix for this that will toggle the flag appropriately, but it is more\nchallenging than I anticipated and I am afraid that this patch will\nnot be completed before the merge window closes, therefore this easier\nfix for now. This fix has a negative performance impact in the range\nof 0% to 4%. Towards the higher end of the scale if you have driver\nand application on the same core and issue a lot of packets, and\ntowards no negative impact if you use two cores, lower transmission\nspeeds and/or a workload that also receives packets.\n\nSigned-off-by: Magnus Karlsson <magnus.karlsson@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_xsk.c | 10 ++--------\n 1 file changed, 2 insertions(+), 8 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c\nindex a05dfec..d07e1a8 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c\n@@ -689,8 +689,6 @@ static bool i40e_xmit_zc(struct i40e_ring *xdp_ring, unsigned int budget)\n \t\ti40e_xdp_ring_update_tail(xdp_ring);\n \n \t\txsk_umem_consume_tx_done(xdp_ring->xsk_umem);\n-\t\tif (xsk_umem_uses_need_wakeup(xdp_ring->xsk_umem))\n-\t\t\txsk_clear_tx_need_wakeup(xdp_ring->xsk_umem);\n \t}\n \n \treturn !!budget && work_done;\n@@ -769,12 +767,8 @@ bool i40e_clean_xdp_tx_irq(struct i40e_vsi *vsi,\n \ti40e_update_tx_stats(tx_ring, completed_frames, total_bytes);\n \n out_xmit:\n-\tif (xsk_umem_uses_need_wakeup(tx_ring->xsk_umem)) {\n-\t\tif (tx_ring->next_to_clean == tx_ring->next_to_use)\n-\t\t\txsk_set_tx_need_wakeup(tx_ring->xsk_umem);\n-\t\telse\n-\t\t\txsk_clear_tx_need_wakeup(tx_ring->xsk_umem);\n-\t}\n+\tif (xsk_umem_uses_need_wakeup(tx_ring->xsk_umem))\n+\t\txsk_set_tx_need_wakeup(tx_ring->xsk_umem);\n \n \txmit_done = i40e_xmit_zc(tx_ring, budget);\n \n", "prefixes": [ "net", "1/2" ] }