Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1086496/?format=api
{ "id": 1086496, "url": "http://patchwork.ozlabs.org/api/patches/1086496/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416173503.29847-3-anirudh.venkataramanan@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": "<20190416173503.29847-3-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-04-16T17:34:51", "name": "[S21,02/14] ice: Add support for virtchnl_vector_map.[rxq|txq]_map", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "947bf395f7fa3d18ccee5f10bdb4bcbf0042832d", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20190416173503.29847-3-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 103110, "url": "http://patchwork.ozlabs.org/api/series/103110/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=103110", "date": "2019-04-16T17:34:49", "name": "Fixes and feature updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/103110/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1086496/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1086496/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=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 44kCFc4mZBz9s55\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Apr 2019 03:35:48 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 396158798B;\n\tTue, 16 Apr 2019 17:35:47 +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 4lPr9Q6stKEv; Tue, 16 Apr 2019 17:35:45 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 94AD9879CF;\n\tTue, 16 Apr 2019 17:35:45 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 054141C1645\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:41 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id BAB46259FF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:41 +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 a3DDp-m1SD6h for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:37 +0000 (UTC)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby silver.osuosl.org (Postfix) with ESMTPS id E657B23358\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:36 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2019 10:35:36 -0700", "from shasta.jf.intel.com ([10.166.244.191])\n\tby fmsmga001.fm.intel.com with ESMTP; 16 Apr 2019 10:35:36 -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.60,358,1549958400\"; d=\"scan'208\";a=\"165278537\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 16 Apr 2019 10:34:51 -0700", "Message-Id": "<20190416173503.29847-3-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190416173503.29847-1-anirudh.venkataramanan@intel.com>", "References": "<20190416173503.29847-1-anirudh.venkataramanan@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S21 02/14] ice: Add support for\n\tvirtchnl_vector_map.[rxq|txq]_map", "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>", "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": "Add support for virtchnl_vector_map.[rxq|txq]_map to use bitmap to\nassociate indicated queues with the specified vector. This support is\nneeded since the Windows AVF driver calls VIRTCHNL_OP_CONFIG_IRQ_MAP for\neach vector and used the bitmap to indicate the associated queues.\n\nUpdated ice_vc_dis_qs_msg to not subtract one from\nvirtchnl_irq_map_info.num_vectors, and changed the VSI vector index to\nthe vector id. This change supports the Windows AVF driver which maps\none vector at a time and sets num_vectors to one. Using vectors_id to\nindex the vector array .\n\nAdd check for vector_id zero, and return VIRTCHNL_STATUS_ERR_PARAM\nif vector_id is zero and there are rings associated with that vector.\nVector_id zero is for the OICR.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> squashed multiple commits]\n---\n drivers/net/ethernet/intel/ice/ice_lib.c | 108 ++++++++++++------\n drivers/net/ethernet/intel/ice/ice_lib.h | 8 ++\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 43 +++++--\n 3 files changed, 115 insertions(+), 44 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 230f733817d0..a21b817642ad 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -321,10 +321,10 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi, u16 vf_id)\n \t\tvsi->alloc_rxq = vf->num_vf_qs;\n \t\t/* pf->num_vf_msix includes (VF miscellaneous vector +\n \t\t * data queue interrupts). Since vsi->num_q_vectors is number\n-\t\t * of queues vectors, subtract 1 from the original vector\n-\t\t * count\n+\t\t * of queues vectors, subtract 1 (ICE_NONQ_VECS_VF) from the\n+\t\t * original vector count\n \t\t */\n-\t\tvsi->num_q_vectors = pf->num_vf_msix - 1;\n+\t\tvsi->num_q_vectors = pf->num_vf_msix - ICE_NONQ_VECS_VF;\n \t\tbreak;\n \tcase ICE_VSI_LB:\n \t\tvsi->alloc_txq = 1;\n@@ -1835,9 +1835,74 @@ ice_cfg_itr(struct ice_hw *hw, struct ice_q_vector *q_vector)\n \t}\n }\n \n+/**\n+ * ice_cfg_txq_interrupt - configure interrupt on Tx queue\n+ * @vsi: the VSI being configured\n+ * @txq: Tx queue being mapped to MSI-X vector\n+ * @msix_idx: MSI-X vector index within the function\n+ * @itr_idx: ITR index of the interrupt cause\n+ *\n+ * Configure interrupt on Tx queue by associating Tx queue to MSI-X vector\n+ * within the function space.\n+ */\n+#ifdef CONFIG_PCI_IOV\n+void\n+ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx)\n+#else\n+static void\n+ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx)\n+#endif /* CONFIG_PCI_IOV */\n+{\n+\tstruct ice_pf *pf = vsi->back;\n+\tstruct ice_hw *hw = &pf->hw;\n+\tu32 val;\n+\n+\titr_idx = (itr_idx << QINT_TQCTL_ITR_INDX_S) & QINT_TQCTL_ITR_INDX_M;\n+\n+\tval = QINT_TQCTL_CAUSE_ENA_M | itr_idx |\n+\t ((msix_idx << QINT_TQCTL_MSIX_INDX_S) & QINT_TQCTL_MSIX_INDX_M);\n+\n+\twr32(hw, QINT_TQCTL(vsi->txq_map[txq]), val);\n+}\n+\n+/**\n+ * ice_cfg_rxq_interrupt - configure interrupt on Rx queue\n+ * @vsi: the VSI being configured\n+ * @rxq: Rx queue being mapped to MSI-X vector\n+ * @msix_idx: MSI-X vector index within the function\n+ * @itr_idx: ITR index of the interrupt cause\n+ *\n+ * Configure interrupt on Rx queue by associating Rx queue to MSI-X vector\n+ * within the function space.\n+ */\n+#ifdef CONFIG_PCI_IOV\n+void\n+ice_cfg_rxq_interrupt(struct ice_vsi *vsi, u16 rxq, u16 msix_idx, u16 itr_idx)\n+#else\n+static void\n+ice_cfg_rxq_interrupt(struct ice_vsi *vsi, u16 rxq, u16 msix_idx, u16 itr_idx)\n+#endif /* CONFIG_PCI_IOV */\n+{\n+\tstruct ice_pf *pf = vsi->back;\n+\tstruct ice_hw *hw = &pf->hw;\n+\tu32 val;\n+\n+\titr_idx = (itr_idx << QINT_RQCTL_ITR_INDX_S) & QINT_RQCTL_ITR_INDX_M;\n+\n+\tval = QINT_RQCTL_CAUSE_ENA_M | itr_idx |\n+\t ((msix_idx << QINT_RQCTL_MSIX_INDX_S) & QINT_RQCTL_MSIX_INDX_M);\n+\n+\twr32(hw, QINT_RQCTL(vsi->rxq_map[rxq]), val);\n+\n+\tice_flush(hw);\n+}\n+\n /**\n * ice_vsi_cfg_msix - MSIX mode Interrupt Config in the HW\n * @vsi: the VSI being configured\n+ *\n+ * This configures MSIX mode interrupts for the PF VSI, and should not be used\n+ * for the VF VSI.\n */\n void ice_vsi_cfg_msix(struct ice_vsi *vsi)\n {\n@@ -1850,8 +1915,7 @@ void ice_vsi_cfg_msix(struct ice_vsi *vsi)\n \t\tstruct ice_q_vector *q_vector = vsi->q_vectors[i];\n \t\tu16 reg_idx = q_vector->reg_idx;\n \n-\t\tif (vsi->type != ICE_VSI_VF)\n-\t\t\tice_cfg_itr(hw, q_vector);\n+\t\tice_cfg_itr(hw, q_vector);\n \n \t\twr32(hw, GLINT_RATE(reg_idx),\n \t\t ice_intrl_usec_to_reg(q_vector->intrl, hw->intrl_gran));\n@@ -1868,43 +1932,17 @@ void ice_vsi_cfg_msix(struct ice_vsi *vsi)\n \t\t * tracked for this PF.\n \t\t */\n \t\tfor (q = 0; q < q_vector->num_ring_tx; q++) {\n-\t\t\tint itr_idx = (q_vector->tx.itr_idx <<\n-\t\t\t\t QINT_TQCTL_ITR_INDX_S) &\n-\t\t\t\tQINT_TQCTL_ITR_INDX_M;\n-\t\t\tu32 val;\n-\n-\t\t\tif (vsi->type == ICE_VSI_VF)\n-\t\t\t\tval = QINT_TQCTL_CAUSE_ENA_M | itr_idx |\n-\t\t\t\t (((i + 1) << QINT_TQCTL_MSIX_INDX_S) &\n-\t\t\t\t QINT_TQCTL_MSIX_INDX_M);\n-\t\t\telse\n-\t\t\t\tval = QINT_TQCTL_CAUSE_ENA_M | itr_idx |\n-\t\t\t\t ((reg_idx << QINT_TQCTL_MSIX_INDX_S) &\n-\t\t\t\t QINT_TQCTL_MSIX_INDX_M);\n-\t\t\twr32(hw, QINT_TQCTL(vsi->txq_map[txq]), val);\n+\t\t\tice_cfg_txq_interrupt(vsi, txq, reg_idx,\n+\t\t\t\t\t q_vector->tx.itr_idx);\n \t\t\ttxq++;\n \t\t}\n \n \t\tfor (q = 0; q < q_vector->num_ring_rx; q++) {\n-\t\t\tint itr_idx = (q_vector->rx.itr_idx <<\n-\t\t\t\t QINT_RQCTL_ITR_INDX_S) &\n-\t\t\t\tQINT_RQCTL_ITR_INDX_M;\n-\t\t\tu32 val;\n-\n-\t\t\tif (vsi->type == ICE_VSI_VF)\n-\t\t\t\tval = QINT_RQCTL_CAUSE_ENA_M | itr_idx |\n-\t\t\t\t\t(((i + 1) << QINT_RQCTL_MSIX_INDX_S) &\n-\t\t\t\t\t QINT_RQCTL_MSIX_INDX_M);\n-\t\t\telse\n-\t\t\t\tval = QINT_RQCTL_CAUSE_ENA_M | itr_idx |\n-\t\t\t\t\t((reg_idx << QINT_RQCTL_MSIX_INDX_S) &\n-\t\t\t\t\t QINT_RQCTL_MSIX_INDX_M);\n-\t\t\twr32(hw, QINT_RQCTL(vsi->rxq_map[rxq]), val);\n+\t\t\tice_cfg_rxq_interrupt(vsi, rxq, reg_idx,\n+\t\t\t\t\t q_vector->rx.itr_idx);\n \t\t\trxq++;\n \t\t}\n \t}\n-\n-\tice_flush(hw);\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h\nindex e223767755cb..2acae3215f5f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.h\n@@ -19,6 +19,14 @@ int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi);\n \n void ice_vsi_cfg_msix(struct ice_vsi *vsi);\n \n+#ifdef CONFIG_PCI_IOV\n+void\n+ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx);\n+\n+void\n+ice_cfg_rxq_interrupt(struct ice_vsi *vsi, u16 rxq, u16 msix_idx, u16 itr_idx);\n+#endif /* CONFIG_PCI_IOV */\n+\n int ice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid);\n \n int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 9c6d9c95f4f6..ecbf447e558a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -1955,24 +1955,33 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)\n \tu16 vsi_id, vsi_q_id, vector_id;\n \tstruct virtchnl_vector_map *map;\n \tstruct ice_pf *pf = vf->pf;\n+\tu16 num_q_vectors_mapped;\n \tstruct ice_vsi *vsi;\n \tunsigned long qmap;\n-\tu16 num_q_vectors;\n \tint i;\n \n \tirqmap_info = (struct virtchnl_irq_map_info *)msg;\n-\tnum_q_vectors = irqmap_info->num_vectors - ICE_NONQ_VECS_VF;\n+\tnum_q_vectors_mapped = irqmap_info->num_vectors;\n+\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n+\tif (!vsi) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n \n+\t/* Check to make sure number of VF vectors mapped is not greater than\n+\t * number of VF vectors originally allocated, and check that\n+\t * there is actually at least a single VF queue vector mapped\n+\t */\n \tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) ||\n-\t !vsi || vsi->num_q_vectors < num_q_vectors ||\n-\t irqmap_info->num_vectors == 0) {\n+\t pf->num_vf_msix < num_q_vectors_mapped ||\n+\t !irqmap_info->num_vectors) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n \t\tgoto error_param;\n \t}\n \n-\tfor (i = 0; i < num_q_vectors; i++) {\n-\t\tstruct ice_q_vector *q_vector = vsi->q_vectors[i];\n+\tfor (i = 0; i < num_q_vectors_mapped; i++) {\n+\t\tstruct ice_q_vector *q_vector;\n \n \t\tmap = &irqmap_info->vecmap[i];\n \n@@ -1980,7 +1989,21 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)\n \t\tvsi_id = map->vsi_id;\n \t\t/* validate msg params */\n \t\tif (!(vector_id < pf->hw.func_caps.common_cap\n-\t\t .num_msix_vectors) || !ice_vc_isvalid_vsi_id(vf, vsi_id)) {\n+\t\t .num_msix_vectors) || !ice_vc_isvalid_vsi_id(vf, vsi_id) ||\n+\t\t (!vector_id && (map->rxq_map || map->txq_map))) {\n+\t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\t\tgoto error_param;\n+\t\t}\n+\n+\t\t/* No need to map VF miscellaneous or rogue vector */\n+\t\tif (!vector_id)\n+\t\t\tcontinue;\n+\n+\t\t/* Subtract non queue vector from vector_id passed by VF\n+\t\t * to get actual number of VSI queue vector array index\n+\t\t */\n+\t\tq_vector = vsi->q_vectors[vector_id - ICE_NONQ_VECS_VF];\n+\t\tif (!q_vector) {\n \t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n \t\t\tgoto error_param;\n \t\t}\n@@ -1996,6 +2019,8 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)\n \t\t\tq_vector->num_ring_rx++;\n \t\t\tq_vector->rx.itr_idx = map->rxitr_idx;\n \t\t\tvsi->rx_rings[vsi_q_id]->q_vector = q_vector;\n+\t\t\tice_cfg_rxq_interrupt(vsi, vsi_q_id, vector_id,\n+\t\t\t\t\t q_vector->rx.itr_idx);\n \t\t}\n \n \t\tqmap = map->txq_map;\n@@ -2008,11 +2033,11 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)\n \t\t\tq_vector->num_ring_tx++;\n \t\t\tq_vector->tx.itr_idx = map->txitr_idx;\n \t\t\tvsi->tx_rings[vsi_q_id]->q_vector = q_vector;\n+\t\t\tice_cfg_txq_interrupt(vsi, vsi_q_id, vector_id,\n+\t\t\t\t\t q_vector->tx.itr_idx);\n \t\t}\n \t}\n \n-\tif (vsi)\n-\t\tice_vsi_cfg_msix(vsi);\n error_param:\n \t/* send the response to the VF */\n \treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_IRQ_MAP, v_ret,\n", "prefixes": [ "S21", "02/14" ] }