Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1040456/?format=api
{ "id": 1040456, "url": "http://patchwork.ozlabs.org/api/patches/1040456/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190212085205.7848-3-bjorn.topel@gmail.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": "<20190212085205.7848-3-bjorn.topel@gmail.com>", "list_archive_url": null, "date": "2019-02-12T08:52:05", "name": "[2/2] i40e: add tracking of AF_XDP ZC state for each queue pair", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "6af7c76df279d68b41ed626b1f2289a968f2d4cc", "submitter": { "id": 70569, "url": "http://patchwork.ozlabs.org/api/people/70569/?format=api", "name": "Björn Töpel", "email": "bjorn.topel@gmail.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/20190212085205.7848-3-bjorn.topel@gmail.com/mbox/", "series": [ { "id": 91409, "url": "http://patchwork.ozlabs.org/api/series/91409/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=91409", "date": "2019-02-12T08:52:03", "name": "i40e: fix regression that enables AF_XDP ZC unconditionally", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/91409/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1040456/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1040456/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=gmail.com", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"kEG77YXe\"; dkim-atps=neutral" ], "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 43zGfb0Zycz9sMx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Feb 2019 19:53:59 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3812684B08;\n\tTue, 12 Feb 2019 08:53:57 +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 YdcsVizYAqTC; Tue, 12 Feb 2019 08:53:47 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C4F6C85A84;\n\tTue, 12 Feb 2019 08:53:37 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id AFA941BF2A0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Feb 2019 08:52:38 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id AC47722794\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Feb 2019 08:52:38 +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 En8k8WgHZ2aX for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Feb 2019 08:52:38 +0000 (UTC)", "from mail-pl1-f193.google.com (mail-pl1-f193.google.com\n\t[209.85.214.193])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 01CCB2263E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Feb 2019 08:52:37 +0000 (UTC)", "by mail-pl1-f193.google.com with SMTP id f90so971409plb.10\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Feb 2019 00:52:37 -0800 (PST)", "from btopel-mobl.ger.intel.com ([134.134.139.83])\n\tby smtp.gmail.com with ESMTPSA id\n\tu73sm24461606pfa.169.2019.02.12.00.52.33\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 12 Feb 2019 00:52:36 -0800 (PST)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=x3H3dvcVPzIeaeu47sYZtsBs/Rjy1TgqKkKpqTtk0XQ=;\n\tb=kEG77YXen8pPuOjwre5suhtxR87f5E1p7BUg6Nz+U1YAfMaJPMTmzKL74/0RzuLHGp\n\tFathksUCtEGlS126A3y8QpqIwigtgUAVH9ElMF0zhGu2Gw7UiYKWWGcA6osKYgz8Lfm5\n\tpvrTTSVp4daz45YE70uMZyK8hFEtDWzT8+zw1YsciX9WHQGgDw5tSLe5BTT1kv4WEhZe\n\tc1KoG75BAHbcNo9Og5ikuACmX0/pnMAcCZBvANYslfEtdbCzhJvxuT01K4Dztpxi+6IF\n\tM2a1XZf4A2kW1T7YCFQGmZsQbagBNugz8TKVP3udSQq8/OLLX2owQtCdCZ6lkQinMwZF\n\tkhLg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=x3H3dvcVPzIeaeu47sYZtsBs/Rjy1TgqKkKpqTtk0XQ=;\n\tb=YmDOmKdJfVIBht9HDJyBNTUYGdIyaMfbcxgxcq5UOs2xT5YfRm/nznYD+/O+2q41//\n\tizw11lhC3K7M9vCQQl8NdALHrDjOrj0iMcoIKb7XKbPgMiqEK4ON+CeqmlGyHYk6z0il\n\tGbjwImttDpnKxmQf7YTGrwMOzj8QsG3/HkiW6YVICegBT+kIJsQodyLFCtg5EB5NjEkL\n\tXU6Q1QNThd+X9+lPQqeSCogUQ6wjzVy1IxY+8aJrgIsS1qczF4ythsgBQEpf6HYXMKjK\n\t6xmzzwsR/itXpzc2YP6OpiCPEuFEJffS5QzjWT0VAPYWuGnyc04U/IMSAcKvUoFLuoNJ\n\tbVcg==", "X-Gm-Message-State": "AHQUAuZ4NlVudNwey5iXolDr5TPR7zhtP+6zdyhQgvmDwhy5HThd5XG+\n\tE+ZpOOJMMktdtj4rJ3Z1gtol5D50bxXdAQ==", "X-Google-Smtp-Source": "AHgI3IZofi1S9Qoc/NlNtPsXJjxc+fGxbXJ9eZV5vyQS1lw5DsP4IhQ/GGZA2MwHP/mvse3mut8oTg==", "X-Received": "by 2002:a17:902:ba8b:: with SMTP id\n\tk11mr2883424pls.177.1549961557334; \n\tTue, 12 Feb 2019 00:52:37 -0800 (PST)", "From": "=?utf-8?b?QmrDtnJuIFTDtnBlbA==?= <bjorn.topel@gmail.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 12 Feb 2019 09:52:05 +0100", "Message-Id": "<20190212085205.7848-3-bjorn.topel@gmail.com>", "X-Mailer": "git-send-email 2.19.1", "In-Reply-To": "<20190212085205.7848-1-bjorn.topel@gmail.com>", "References": "<20190212085205.7848-1-bjorn.topel@gmail.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 2/2] i40e: add tracking of AF_XDP ZC state\n\tfor each queue pair", "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": "netdev@vger.kernel.org, =?utf-8?b?QmrDtnJuIFTDtnBlbA==?=\n\t<bjorn.topel@intel.com>, magnus.karlsson@intel.com", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Björn Töpel <bjorn.topel@intel.com>\n\nIn commit f3fef2b6e1cc (\"i40e: Remove umem from VSI\") a regression was\nintroduced; When the VSI was reset, the setup code would try to enable\nAF_XDP ZC unconditionally (as long as there was a umem placed in the\nnetdev._rx struct). Here, we add a bitmap to the VSI that tracks if a\ncertain queue pair has been \"zero-copy enabled\" via the ndo_bpf. The\nbitmap is used in i40e_xsk_umem, and enables zero-copy if and only if\nXDP is enabled, the corresponding qid in the bitmap is set and the\numem is non-NULL.\n\nFixes: f3fef2b6e1cc (\"i40e: Remove umem from VSI\")\nSigned-off-by: Björn Töpel <bjorn.topel@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 2 ++\n drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++++++++-\n drivers/net/ethernet/intel/i40e/i40e_xsk.c | 3 +++\n 3 files changed, 14 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex cc583ad5236b..d3cc3427caad 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -790,6 +790,8 @@ struct i40e_vsi {\n \n \t/* VSI specific handlers */\n \tirqreturn_t (*irq_handler)(int irq, void *data);\n+\n+\tunsigned long *af_xdp_zc_qps; /* tracks AF_XDP ZC enabled qps */\n } ____cacheline_internodealigned_in_smp;\n \n struct i40e_netdev_priv {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex ba1a84a2c8e5..0dd00d58c524 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -3077,7 +3077,7 @@ static struct xdp_umem *i40e_xsk_umem(struct i40e_ring *ring)\n \tif (ring_is_xdp(ring))\n \t\tqid -= ring->vsi->alloc_queue_pairs;\n \n-\tif (!xdp_on)\n+\tif (!xdp_on || !test_bit(qid, ring->vsi->af_xdp_zc_qps))\n \t\treturn NULL;\n \n \treturn xdp_get_umem_from_qid(ring->vsi->netdev, qid);\n@@ -10076,6 +10076,12 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)\n \thash_init(vsi->mac_filter_hash);\n \tvsi->irqs_ready = false;\n \n+\tif (type == I40E_VSI_MAIN) {\n+\t\tvsi->af_xdp_zc_qps = bitmap_zalloc(pf->num_lan_qps, GFP_KERNEL);\n+\t\tif (!vsi->af_xdp_zc_qps)\n+\t\t\tgoto err_rings;\n+\t}\n+\n \tret = i40e_set_num_rings_in_vsi(vsi);\n \tif (ret)\n \t\tgoto err_rings;\n@@ -10094,6 +10100,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)\n \tgoto unlock_pf;\n \n err_rings:\n+\tbitmap_free(vsi->af_xdp_zc_qps);\n \tpf->next_vsi = i - 1;\n \tkfree(vsi);\n unlock_pf:\n@@ -10174,6 +10181,7 @@ static int i40e_vsi_clear(struct i40e_vsi *vsi)\n \ti40e_put_lump(pf->qp_pile, vsi->base_queue, vsi->idx);\n \ti40e_put_lump(pf->irq_pile, vsi->base_vector, vsi->idx);\n \n+\tbitmap_free(vsi->af_xdp_zc_qps);\n \ti40e_vsi_free_arrays(vsi, true);\n \ti40e_clear_rss_config_user(vsi);\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c\nindex 96d849460d9b..2737fee338c4 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c\n@@ -102,6 +102,8 @@ static int i40e_xsk_umem_enable(struct i40e_vsi *vsi, struct xdp_umem *umem,\n \tif (err)\n \t\treturn err;\n \n+\tset_bit(qid, vsi->af_xdp_zc_qps);\n+\n \tif_running = netif_running(vsi->netdev) && i40e_enabled_xdp_vsi(vsi);\n \n \tif (if_running) {\n@@ -143,6 +145,7 @@ static int i40e_xsk_umem_disable(struct i40e_vsi *vsi, u16 qid)\n \t\t\treturn err;\n \t}\n \n+\tclear_bit(qid, vsi->af_xdp_zc_qps);\n \ti40e_xsk_umem_dma_unmap(vsi, umem);\n \n \tif (if_running) {\n", "prefixes": [ "2/2" ] }