Show a patch.

GET /api/patches/74628/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 74628,
    "url": "https://patches.dpdk.org/api/patches/74628/",
    "web_url": "https://patches.dpdk.org/patch/74628/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<20200723152711.7591-1-maox.jiang@intel.com>",
    "date": "2020-07-23T15:27:10",
    "name": "[v4,1/2] net/i40e: fix binding interrupt without msix vectors",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2bf323d614aa9bec0d57f0721fe95aa3cedf7daf",
    "submitter": {
        "id": 1630,
        "url": "https://patches.dpdk.org/api/people/1630/",
        "name": "Jiang Mao",
        "email": "maox.jiang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74628/mbox/",
    "series": [
        {
            "id": 11243,
            "url": "https://patches.dpdk.org/api/series/11243/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11243",
            "date": "2020-07-23T15:27:10",
            "name": "[v4,1/2] net/i40e: fix binding interrupt without msix vectors",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/11243/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74628/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74628/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9690\"; a=\"147954999\"",
            "E=Sophos;i=\"5.75,385,1589266800\"; d=\"scan'208\";a=\"147954999\"",
            "E=Sophos;i=\"5.75,385,1589266800\"; d=\"scan'208\";a=\"302168856\""
        ],
        "IronPort-SDR": [
            "\n DSPsFLmraWWCnn+wAKss1PyJllxTdIOGra9zxU9iH063nwAKhndC4I6UG8hYpD0kdrDZTadLEB\n UjMwMLyDhYqw==",
            "\n nYYBi2I8Z8T+KT3ezV/SBvRN0YnClJ5QCib0IlsgKXH7KzQ3SYoficMsw3l7DLcof8qV9l6YQ+\n +S96JjCFeoYw=="
        ],
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200722175738.32490-1-maox.jiang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 1/2] net/i40e: fix binding interrupt without\n\tmsix vectors",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 33385A0526;\n\tThu, 23 Jul 2020 05:49:45 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D82141BF7B;\n\tThu, 23 Jul 2020 05:49:43 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by dpdk.org (Postfix) with ESMTP id E709C1BE9A;\n Thu, 23 Jul 2020 05:49:41 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Jul 2020 20:49:40 -0700",
            "from dut85.sh.intel.com (HELO localhost.localdomain)\n ([10.240.183.157])\n by orsmga002.jf.intel.com with ESMTP; 22 Jul 2020 20:49:38 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.17.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Thu, 23 Jul 2020 23:27:10 +0800",
        "To": "qi.z.zhang@intel.com",
        "From": "Jiang Mao <maox.jiang@intel.com>",
        "In-Reply-To": "<20200722175738.32490-1-maox.jiang@intel.com>",
        "Cc": "dev@dpdk.org,\n\tstable@dpdk.org,\n\tJiang Mao <maox.jiang@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200723152711.7591-1-maox.jiang@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "The value of vsi->nb_msix shouldn`t be zero, otherwise, all of\ninterrupts will be bind to vector 0.\n\nFixes: 4861cde461 (i40e: new poll mode driver)\nCc: stable@dpdk.org\n\nSigned-off-by: Jiang Mao <maox.jiang@intel.com>\n---\nV3: Fix format issue.\nV4: Rebase this patch.\n---\n drivers/net/i40e/i40e_ethdev.c | 25 +++++++++++++++++++------\n drivers/net/i40e/i40e_ethdev.h |  2 +-\n 2 files changed, 20 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 05d5f28615..0c32e451c5 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -2117,7 +2117,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect,\n \tI40E_WRITE_FLUSH(hw);\n }\n \n-void\n+int\n i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)\n {\n \tstruct rte_eth_dev *dev = vsi->adapter->eth_dev;\n@@ -2137,10 +2137,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)\n \n \t/* VF bind interrupt */\n \tif (vsi->type == I40E_VSI_SRIOV) {\n+\t\tif (vsi->nb_msix == 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"No msix resource\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t\t__vsi_queues_bind_intr(vsi, msix_vect,\n \t\t\t\t       vsi->base_queue, vsi->nb_qps,\n \t\t\t\t       itr_idx);\n-\t\treturn;\n+\t\treturn 0;\n \t}\n \n \t/* PF & VMDq bind interrupt */\n@@ -2157,7 +2161,10 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)\n \t}\n \n \tfor (i = 0; i < vsi->nb_used_qps; i++) {\n-\t\tif (nb_msix <= 1) {\n+\t\tif (vsi->nb_msix == 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"No msix resource\");\n+\t\t\treturn -EINVAL;\n+\t\t} else if (nb_msix <= 1) {\n \t\t\tif (!rte_intr_allow_others(intr_handle))\n \t\t\t\t/* allow to share MISC_VEC_ID */\n \t\t\t\tmsix_vect = I40E_MISC_VEC_ID;\n@@ -2182,6 +2189,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)\n \t\tmsix_vect++;\n \t\tnb_msix--;\n \t}\n+\n+\treturn 0;\n }\n \n void\n@@ -2422,14 +2431,18 @@ i40e_dev_start(struct rte_eth_dev *dev)\n \t/* Map queues with MSIX interrupt */\n \tmain_vsi->nb_used_qps = dev->data->nb_rx_queues -\n \t\tpf->nb_cfg_vmdq_vsi * RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;\n-\ti40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);\n+\tret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);\n+\tif (ret < 0)\n+\t\treturn ret;\n \ti40e_vsi_enable_queues_intr(main_vsi);\n \n \t/* Map VMDQ VSI queues with MSIX interrupt */\n \tfor (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {\n \t\tpf->vmdq[i].vsi->nb_used_qps = RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;\n-\t\ti40e_vsi_queues_bind_intr(pf->vmdq[i].vsi,\n-\t\t\t\t\t  I40E_ITR_INDEX_DEFAULT);\n+\t\tret = i40e_vsi_queues_bind_intr(pf->vmdq[i].vsi,\n+\t\t\t\t\t\tI40E_ITR_INDEX_DEFAULT);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n \t\ti40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);\n \t}\n \ndiff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h\nindex aef88abed0..19f821829a 100644\n--- a/drivers/net/i40e/i40e_ethdev.h\n+++ b/drivers/net/i40e/i40e_ethdev.h\n@@ -1319,7 +1319,7 @@ void i40e_update_vsi_stats(struct i40e_vsi *vsi);\n void i40e_pf_disable_irq0(struct i40e_hw *hw);\n void i40e_pf_enable_irq0(struct i40e_hw *hw);\n int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);\n-void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx);\n+int i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx);\n void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);\n void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi);\n int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,\n",
    "prefixes": [
        "v4",
        "1/2"
    ]
}