Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/925069/?format=api
{ "id": 925069, "url": "http://patchwork.ozlabs.org/api/patches/925069/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180604120601.18123-9-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": "<20180604120601.18123-9-bjorn.topel@gmail.com>", "list_archive_url": null, "date": "2018-06-04T12:05:58", "name": "[bpf-next,08/11] i40e: added queue pair disable/enable functions", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "a3fd843315831c925e94317fa8b0f83c7115e0ac", "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/20180604120601.18123-9-bjorn.topel@gmail.com/mbox/", "series": [ { "id": 48416, "url": "http://patchwork.ozlabs.org/api/series/48416/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=48416", "date": "2018-06-04T12:05:50", "name": "AF_XDP: introducing zero-copy support", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/48416/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/925069/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/925069/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.133; helo=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=gmail.com" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 40zyry4j1mz9s1w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 5 Jun 2018 01:04:34 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 01FEB89E18;\n\tMon, 4 Jun 2018 15:04:33 +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 fK6siwSWKfei; Mon, 4 Jun 2018 15:04:29 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3E47F89E25;\n\tMon, 4 Jun 2018 15:04:29 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2AFFB1BFFD0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jun 2018 12:06:57 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 277BC87517\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jun 2018 12:06: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 EgcwEz7LR2pB for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jun 2018 12:06:56 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 6ACC9874F1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jun 2018 12:06:56 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Jun 2018 05:06:56 -0700", "from btopel-mobl1.isw.intel.com (HELO\n\tbtopel-mobl1.hil-pdxphhh.sea.wayport.net) ([10.103.211.148])\n\tby fmsmga004.fm.intel.com with ESMTP; 04 Jun 2018 05:06:50 -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", "X-IronPort-AV": "E=Sophos;i=\"5.49,476,1520924400\"; d=\"scan'208\";a=\"60197220\"", "From": "=?utf-8?b?QmrDtnJuIFTDtnBlbA==?= <bjorn.topel@gmail.com>", "To": "bjorn.topel@gmail.com, magnus.karlsson@intel.com,\n\tmagnus.karlsson@gmail.com, alexander.h.duyck@intel.com,\n\talexander.duyck@gmail.com, ast@fb.com, brouer@redhat.com,\n\tdaniel@iogearbox.net, netdev@vger.kernel.org, mykyta.iziumtsev@linaro.org", "Date": "Mon, 4 Jun 2018 14:05:58 +0200", "Message-Id": "<20180604120601.18123-9-bjorn.topel@gmail.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20180604120601.18123-1-bjorn.topel@gmail.com>", "References": "<20180604120601.18123-1-bjorn.topel@gmail.com>", "MIME-Version": "1.0", "X-Mailman-Approved-At": "Mon, 04 Jun 2018 15:04:25 +0000", "Subject": "[Intel-wired-lan] [PATCH bpf-next 08/11] i40e: added queue pair\n\tdisable/enable functions", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "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": "francois.ozog@linaro.org, willemdebruijn.kernel@gmail.com, mst@redhat.com,\n\tilias.apalodimas@linaro.org, michael.lundkvist@ericsson.com,\n\tbrian.brooks@linaro.org, intel-wired-lan@lists.osuosl.org, \n\tqi.z.zhang@intel.com, michael.chan@broadcom.com, =?utf-8?b?QmrDtnJu?=\n\t=?utf-8?q?_T=C3=B6pel?= <bjorn.topel@intel.com>, andy@greyhouse.net", "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\nQueue pair enable/disable plumbing.\n\nSigned-off-by: Björn Töpel <bjorn.topel@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 251 ++++++++++++++++++++++++++++\n 1 file changed, 251 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex b5daa5c9c7de..369a116edaa1 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -11823,6 +11823,257 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi,\n \treturn 0;\n }\n \n+/**\n+ * i40e_enter_busy_conf - Enters busy config state\n+ * @vsi: vsi\n+ *\n+ * Returns 0 on success, <0 for failure.\n+ **/\n+static int i40e_enter_busy_conf(struct i40e_vsi *vsi)\n+{\n+\tstruct i40e_pf *pf = vsi->back;\n+\tint timeout = 50;\n+\n+\twhile (test_and_set_bit(__I40E_CONFIG_BUSY, pf->state)) {\n+\t\ttimeout--;\n+\t\tif (!timeout)\n+\t\t\treturn -EBUSY;\n+\t\tusleep_range(1000, 2000);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * i40e_exit_busy_conf - Exits busy config state\n+ * @vsi: vsi\n+ **/\n+static void i40e_exit_busy_conf(struct i40e_vsi *vsi)\n+{\n+\tstruct i40e_pf *pf = vsi->back;\n+\n+\tclear_bit(__I40E_CONFIG_BUSY, pf->state);\n+}\n+\n+/**\n+ * i40e_queue_pair_reset_stats - Resets all statistics for a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue pair\n+ **/\n+static void i40e_queue_pair_reset_stats(struct i40e_vsi *vsi, int queue_pair)\n+{\n+\tmemset(&vsi->rx_rings[queue_pair]->rx_stats, 0,\n+\t sizeof(vsi->rx_rings[queue_pair]->rx_stats));\n+\tmemset(&vsi->tx_rings[queue_pair]->stats, 0,\n+\t sizeof(vsi->tx_rings[queue_pair]->stats));\n+\tif (i40e_enabled_xdp_vsi(vsi)) {\n+\t\tmemset(&vsi->xdp_rings[queue_pair]->stats, 0,\n+\t\t sizeof(vsi->xdp_rings[queue_pair]->stats));\n+\t}\n+}\n+\n+/**\n+ * i40e_queue_pair_clean_rings - Cleans all the rings of a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue pair\n+ **/\n+static void i40e_queue_pair_clean_rings(struct i40e_vsi *vsi, int queue_pair)\n+{\n+\ti40e_clean_tx_ring(vsi->tx_rings[queue_pair]);\n+\tif (i40e_enabled_xdp_vsi(vsi))\n+\t\ti40e_clean_tx_ring(vsi->xdp_rings[queue_pair]);\n+\ti40e_clean_rx_ring(vsi->rx_rings[queue_pair]);\n+}\n+\n+/**\n+ * i40e_queue_pair_control_napi - Enables/disables NAPI for a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue pair\n+ * @enable: true for enable, false for disable\n+ **/\n+static void i40e_queue_pair_control_napi(struct i40e_vsi *vsi, int queue_pair,\n+\t\t\t\t\t bool enable)\n+{\n+\tstruct i40e_ring *rxr = vsi->rx_rings[queue_pair];\n+\tstruct i40e_q_vector *q_vector = rxr->q_vector;\n+\n+\tif (!vsi->netdev)\n+\t\treturn;\n+\n+\t/* All rings in a qp belong to the same qvector. */\n+\tif (q_vector->rx.ring || q_vector->tx.ring) {\n+\t\tif (enable)\n+\t\t\tnapi_enable(&q_vector->napi);\n+\t\telse\n+\t\t\tnapi_disable(&q_vector->napi);\n+\t}\n+}\n+\n+/**\n+ * i40e_queue_pair_control_rings - Enables/disables all rings for a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue pair\n+ * @enable: true for enable, false for disable\n+ *\n+ * Returns 0 on success, <0 on failure.\n+ **/\n+static int i40e_queue_pair_control_rings(struct i40e_vsi *vsi, int queue_pair,\n+\t\t\t\t\t bool enable)\n+{\n+\tstruct i40e_pf *pf = vsi->back;\n+\tint pf_q, ret = 0;\n+\n+\tpf_q = vsi->base_queue + queue_pair;\n+\tret = i40e_control_wait_tx_q(vsi->seid, pf, pf_q,\n+\t\t\t\t false /*is xdp*/, enable);\n+\tif (ret) {\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"VSI seid %d Tx ring %d %sable timeout\\n\",\n+\t\t\t vsi->seid, pf_q, (enable ? \"en\" : \"dis\"));\n+\t\treturn ret;\n+\t}\n+\n+\ti40e_control_rx_q(pf, pf_q, enable);\n+\tret = i40e_pf_rxq_wait(pf, pf_q, enable);\n+\tif (ret) {\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"VSI seid %d Rx ring %d %sable timeout\\n\",\n+\t\t\t vsi->seid, pf_q, (enable ? \"en\" : \"dis\"));\n+\t\treturn ret;\n+\t}\n+\n+\t/* Due to HW errata, on Rx disable only, the register can\n+\t * indicate done before it really is. Needs 50ms to be sure\n+\t */\n+\tif (!enable)\n+\t\tmdelay(50);\n+\n+\tif (!i40e_enabled_xdp_vsi(vsi))\n+\t\treturn ret;\n+\n+\tret = i40e_control_wait_tx_q(vsi->seid, pf,\n+\t\t\t\t pf_q + vsi->alloc_queue_pairs,\n+\t\t\t\t true /*is xdp*/, enable);\n+\tif (ret) {\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"VSI seid %d XDP Tx ring %d %sable timeout\\n\",\n+\t\t\t vsi->seid, pf_q, (enable ? \"en\" : \"dis\"));\n+\t}\n+\n+\treturn ret;\n+}\n+\n+/**\n+ * i40e_queue_pair_enable_irq - Enables interrupts for a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue_pair\n+ **/\n+static void i40e_queue_pair_enable_irq(struct i40e_vsi *vsi, int queue_pair)\n+{\n+\tstruct i40e_ring *rxr = vsi->rx_rings[queue_pair];\n+\tstruct i40e_pf *pf = vsi->back;\n+\tstruct i40e_hw *hw = &pf->hw;\n+\n+\t/* All rings in a qp belong to the same qvector. */\n+\tif (pf->flags & I40E_FLAG_MSIX_ENABLED)\n+\t\ti40e_irq_dynamic_enable(vsi, rxr->q_vector->v_idx);\n+\telse\n+\t\ti40e_irq_dynamic_enable_icr0(pf);\n+\n+\ti40e_flush(hw);\n+}\n+\n+/**\n+ * i40e_queue_pair_disable_irq - Disables interrupts for a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue_pair\n+ **/\n+static void i40e_queue_pair_disable_irq(struct i40e_vsi *vsi, int queue_pair)\n+{\n+\tstruct i40e_ring *rxr = vsi->rx_rings[queue_pair];\n+\tstruct i40e_pf *pf = vsi->back;\n+\tstruct i40e_hw *hw = &pf->hw;\n+\n+\t/* For simplicity, instead of removing the qp interrupt causes\n+\t * from the interrupt linked list, we simply disable the interrupt, and\n+\t * leave the list intact.\n+\t *\n+\t * All rings in a qp belong to the same qvector.\n+\t */\n+\tif (pf->flags & I40E_FLAG_MSIX_ENABLED) {\n+\t\tu32 intpf = vsi->base_vector + rxr->q_vector->v_idx;\n+\n+\t\twr32(hw, I40E_PFINT_DYN_CTLN(intpf - 1), 0);\n+\t\ti40e_flush(hw);\n+\t\tsynchronize_irq(pf->msix_entries[intpf].vector);\n+\t} else {\n+\t\t/* Legacy and MSI mode - this stops all interrupt handling */\n+\t\twr32(hw, I40E_PFINT_ICR0_ENA, 0);\n+\t\twr32(hw, I40E_PFINT_DYN_CTL0, 0);\n+\t\ti40e_flush(hw);\n+\t\tsynchronize_irq(pf->pdev->irq);\n+\t}\n+}\n+\n+/**\n+ * i40e_queue_pair_disable - Disables a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue pair\n+ *\n+ * Returns 0 on success, <0 on failure.\n+ **/\n+static int i40e_queue_pair_disable(struct i40e_vsi *vsi, int queue_pair)\n+{\n+\tint err;\n+\n+\terr = i40e_enter_busy_conf(vsi);\n+\tif (err)\n+\t\treturn err;\n+\n+\ti40e_queue_pair_disable_irq(vsi, queue_pair);\n+\terr = i40e_queue_pair_control_rings(vsi, queue_pair,\n+\t\t\t\t\t false /* disable */);\n+\ti40e_queue_pair_control_napi(vsi, queue_pair, false /* disable */);\n+\ti40e_queue_pair_clean_rings(vsi, queue_pair);\n+\ti40e_queue_pair_reset_stats(vsi, queue_pair);\n+\n+\treturn err;\n+}\n+\n+/**\n+ * i40e_queue_pair_enable - Enables a queue pair\n+ * @vsi: vsi\n+ * @queue_pair: queue pair\n+ *\n+ * Returns 0 on success, <0 on failure.\n+ **/\n+static int i40e_queue_pair_enable(struct i40e_vsi *vsi, int queue_pair)\n+{\n+\tint err;\n+\n+\terr = i40e_configure_tx_ring(vsi->tx_rings[queue_pair]);\n+\tif (err)\n+\t\treturn err;\n+\n+\tif (i40e_enabled_xdp_vsi(vsi)) {\n+\t\terr = i40e_configure_tx_ring(vsi->xdp_rings[queue_pair]);\n+\t\tif (err)\n+\t\t\treturn err;\n+\t}\n+\n+\terr = i40e_configure_rx_ring(vsi->rx_rings[queue_pair]);\n+\tif (err)\n+\t\treturn err;\n+\n+\terr = i40e_queue_pair_control_rings(vsi, queue_pair, true /* enable */);\n+\ti40e_queue_pair_control_napi(vsi, queue_pair, true /* enable */);\n+\ti40e_queue_pair_enable_irq(vsi, queue_pair);\n+\n+\ti40e_exit_busy_conf(vsi);\n+\n+\treturn err;\n+}\n+\n /**\n * i40e_xdp - implements ndo_bpf for i40e\n * @dev: netdevice\n", "prefixes": [ "bpf-next", "08/11" ] }