get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 83832,
    "url": "http://patches.dpdk.org/api/patches/83832/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201109065136.26807-2-stevex.yang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20201109065136.26807-2-stevex.yang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201109065136.26807-2-stevex.yang@intel.com",
    "date": "2020-11-09T06:51:35",
    "name": "[v2,1/2] net/iavf: fix reset VF doesn't notify PF to reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "fe66d0311830df0cc2361c34ed8164ab77f671b8",
    "submitter": {
        "id": 1883,
        "url": "http://patches.dpdk.org/api/people/1883/?format=api",
        "name": "Steve Yang",
        "email": "stevex.yang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201109065136.26807-2-stevex.yang@intel.com/mbox/",
    "series": [
        {
            "id": 13738,
            "url": "http://patches.dpdk.org/api/series/13738/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13738",
            "date": "2020-11-09T06:51:34",
            "name": "net/iavf: backported bug fixes from i40evf to iavf",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/13738/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/83832/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/83832/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.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 6CBE5A0527;\n\tMon,  9 Nov 2020 07:53:22 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3BEC95A51;\n\tMon,  9 Nov 2020 07:53:07 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by dpdk.org (Postfix) with ESMTP id 103A1593A\n for <dev@dpdk.org>; Mon,  9 Nov 2020 07:53:03 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Nov 2020 22:53:03 -0800",
            "from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136])\n by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Nov 2020 22:53:01 -0800"
        ],
        "IronPort-SDR": [
            "\n K4NFAspGQ9QzXOPOSc9Hf7fiV+wTl7bPPXlmbHse3SFLOziR8XE711VlSzzY5Y4uBR28BcUSNg\n /Xz58WR3MAWQ==",
            "\n A9iFeffloVKYIxiF7H5hqKDYUFjvOLWXe1Tz+OA7ZNcPvurRmtaUEKPCDfz/SLtvr4juH3gpGs\n Zvk0eKw8GUpQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9799\"; a=\"166247815\"",
            "E=Sophos;i=\"5.77,462,1596524400\"; d=\"scan'208\";a=\"166247815\"",
            "E=Sophos;i=\"5.77,462,1596524400\"; d=\"scan'208\";a=\"540717609\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "From": "Steve Yang <stevex.yang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com,\n Steve Yang <stevex.yang@intel.com>",
        "Date": "Mon,  9 Nov 2020 06:51:35 +0000",
        "Message-Id": "<20201109065136.26807-2-stevex.yang@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201109065136.26807-1-stevex.yang@intel.com>",
        "References": "<20201105083216.38300-1-stevex.yang@intel.com>\n <20201109065136.26807-1-stevex.yang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] net/iavf: fix reset VF doesn't notify PF\n\tto reset",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When VF closed, the VF should notify PF to close/reset relative\nresources from PF side.\n\nFixes: 22b123a36d07 (\"net/avf: initialize PMD\")\n\nSigned-off-by: Steve Yang <stevex.yang@intel.com>\n---\n drivers/common/iavf/iavf_prototype.h |  1 +\n drivers/common/iavf/version.map      |  1 +\n drivers/net/iavf/iavf_ethdev.c       | 57 ++++++++++++++++++++++++++--\n 3 files changed, 56 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/common/iavf/iavf_prototype.h b/drivers/common/iavf/iavf_prototype.h\nindex f34e77db0f..3998d26dc0 100644\n--- a/drivers/common/iavf/iavf_prototype.h\n+++ b/drivers/common/iavf/iavf_prototype.h\n@@ -83,6 +83,7 @@ void iavf_destroy_spinlock(struct iavf_spinlock *sp);\n __rte_internal\n void iavf_vf_parse_hw_config(struct iavf_hw *hw,\n \t\t\t     struct virtchnl_vf_resource *msg);\n+__rte_internal\n enum iavf_status iavf_vf_reset(struct iavf_hw *hw);\n __rte_internal\n enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,\ndiff --git a/drivers/common/iavf/version.map b/drivers/common/iavf/version.map\nindex e0f117197c..6c1427cca4 100644\n--- a/drivers/common/iavf/version.map\n+++ b/drivers/common/iavf/version.map\n@@ -7,6 +7,7 @@ INTERNAL {\n \tiavf_set_mac_type;\n \tiavf_shutdown_adminq;\n \tiavf_vf_parse_hw_config;\n+\tiavf_vf_reset;\n \n \tlocal: *;\n };\ndiff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c\nindex 7e3c26a94e..510adc5f6b 100644\n--- a/drivers/net/iavf/iavf_ethdev.c\n+++ b/drivers/net/iavf/iavf_ethdev.c\n@@ -1417,8 +1417,10 @@ iavf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)\n }\n \n static int\n-iavf_check_vf_reset_done(struct iavf_hw *hw)\n+iavf_check_vf_reset_done(struct rte_eth_dev *dev)\n {\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n+\tstruct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tint i, reset;\n \n \tfor (i = 0; i < IAVF_RESET_WAIT_CNT; i++) {\n@@ -1434,6 +1436,7 @@ iavf_check_vf_reset_done(struct iavf_hw *hw)\n \tif (i >= IAVF_RESET_WAIT_CNT)\n \t\treturn -1;\n \n+\tvf->vf_reset = false;\n \treturn 0;\n }\n \n@@ -1780,6 +1783,36 @@ iavf_init_proto_xtr(struct rte_eth_dev *dev)\n \t}\n }\n \n+static int\n+iavf_reset_vf(struct rte_eth_dev *dev)\n+{\n+\tstruct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tint ret;\n+\n+\tif (iavf_vf_reset(hw) != IAVF_SUCCESS) {\n+\t\tPMD_INIT_LOG(ERR, \"Reset VF NIC failed\");\n+\t\treturn -1;\n+\t}\n+\t/**\n+\t * After issuing vf reset command to pf, pf won't necessarily\n+\t * reset vf, it depends on what state it exactly is. If it's not\n+\t * initialized yet, it won't have vf reset since it's in a certain\n+\t * state. If not, it will try to reset. Even vf is reset, pf will\n+\t * set I40E_VFGEN_RSTAT to COMPLETE first, then wait 10ms and set\n+\t * it to ACTIVE. In this duration, vf may not catch the moment that\n+\t * COMPLETE is set. So, for vf, we'll try to wait a long time.\n+\t */\n+\trte_delay_ms(200);\n+\n+\tret = iavf_check_vf_reset_done(dev);\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"VF is still resetting\");\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n iavf_init_vf(struct rte_eth_dev *dev)\n {\n@@ -1801,7 +1834,7 @@ iavf_init_vf(struct rte_eth_dev *dev)\n \t\tgoto err;\n \t}\n \n-\terr = iavf_check_vf_reset_done(hw);\n+\terr = iavf_check_vf_reset_done(dev);\n \tif (err) {\n \t\tPMD_INIT_LOG(ERR, \"VF is still resetting\");\n \t\tgoto err;\n@@ -1814,6 +1847,24 @@ iavf_init_vf(struct rte_eth_dev *dev)\n \t\tgoto err;\n \t}\n \n+\t/* Reset VF and wait until it's complete */\n+\tif (iavf_reset_vf(dev)) {\n+\t\tPMD_INIT_LOG(ERR, \"reset NIC failed\");\n+\t\tgoto err_aq;\n+\t}\n+\n+\t/* VF reset, shutdown admin queue and initialize again */\n+\tif (iavf_shutdown_adminq(hw) != IAVF_SUCCESS) {\n+\t\tPMD_INIT_LOG(ERR, \"iavf_shutdown_adminq failed\");\n+\t\tgoto err;\n+\t}\n+\n+\tiavf_init_adminq_parameter(hw);\n+\tif (iavf_init_adminq(hw) != IAVF_SUCCESS) {\n+\t\tPMD_INIT_LOG(ERR, \"init_adminq failed\");\n+\t\tgoto err;\n+\t}\n+\n \tvf->aq_resp = rte_zmalloc(\"vf_aq_resp\", IAVF_AQ_BUF_SZ, 0);\n \tif (!vf->aq_resp) {\n \t\tPMD_INIT_LOG(ERR, \"unable to allocate vf_aq_resp memory\");\n@@ -2050,7 +2101,7 @@ iavf_dev_close(struct rte_eth_dev *dev)\n \n \tiavf_flow_flush(dev, NULL);\n \tiavf_flow_uninit(adapter);\n-\n+\tiavf_reset_vf(dev);\n \t/*\n \t * disable promiscuous mode before reset vf\n \t * it is a workaround solution when work with kernel driver\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}