get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81247,
    "url": "http://patches.dpdk.org/api/patches/81247/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201018103430.30997-2-ting.xu@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": "<20201018103430.30997-2-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201018103430.30997-2-ting.xu@intel.com",
    "date": "2020-10-18T10:34:25",
    "name": "[v7,1/6] net/iavf: handle virtchnl event message without interrupt",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7d44a5e0955e1297bab964d9dc17ca7481a7e4f8",
    "submitter": {
        "id": 1363,
        "url": "http://patches.dpdk.org/api/people/1363/?format=api",
        "name": "Xu, Ting",
        "email": "ting.xu@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/20201018103430.30997-2-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 13079,
            "url": "http://patches.dpdk.org/api/series/13079/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13079",
            "date": "2020-10-18T10:34:24",
            "name": "enable large VF configuration",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/13079/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81247/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81247/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 C9D22A04B0;\n\tSun, 18 Oct 2020 12:45:16 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B5DBCCFC7;\n\tSun, 18 Oct 2020 12:44:56 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 3B53ECF9B\n for <dev@dpdk.org>; Sun, 18 Oct 2020 12:44:52 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Oct 2020 03:44:48 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.154])\n by fmsmga004.fm.intel.com with ESMTP; 18 Oct 2020 03:44:44 -0700"
        ],
        "IronPort-SDR": [
            "\n b5KDOgnN3DMYK+TkxIap/BthAGgySFGrJCR/AqsrA2pF42hCzzC54kmkqD6i+PEmH6kBmtz5zp\n EiaoGMAsaiQg==",
            "\n GQC6vcGaw65sKiLpyTSPW060rKvQUrnl0tUKVPpjBBxrtQpknci5Cuw/CTCF6DppGARtJV6SOu\n JSAgw/p7NupA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9777\"; a=\"153826026\"",
            "E=Sophos;i=\"5.77,390,1596524400\"; d=\"scan'208\";a=\"153826026\"",
            "E=Sophos;i=\"5.77,390,1596524400\"; d=\"scan'208\";a=\"347087252\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Ting Xu <ting.xu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qi.z.zhang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com,\n Ting Xu <ting.xu@intel.com>",
        "Date": "Sun, 18 Oct 2020 18:34:25 +0800",
        "Message-Id": "<20201018103430.30997-2-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201018103430.30997-1-ting.xu@intel.com>",
        "References": "<20200909072028.16726-1-ting.xu@intel.com>\n <20201018103430.30997-1-ting.xu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 1/6] net/iavf: handle virtchnl event message\n\twithout interrupt",
        "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": "Currently, VF only handle virtchnl event message when interrupt is\ncalled. In some cases, event message is supposed to be handled with\ninterrupt disabled, for example request queues. To solve this issue,\nvirtchnl event message handling are added in reading message from PF\nin this patch.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n drivers/net/iavf/iavf.h       |   8 ++\n drivers/net/iavf/iavf_vchnl.c | 138 ++++++++++++++++++++++------------\n 2 files changed, 97 insertions(+), 49 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex 3198d85b3..9c16324c1 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -107,6 +107,14 @@ struct iavf_fdir_info {\n /* TODO: is that correct to assume the max number to be 16 ?*/\n #define IAVF_MAX_MSIX_VECTORS   16\n \n+/* Message type read in admin queue from PF */\n+enum iavf_aq_result {\n+\tIAVF_MSG_ERR = -1, /* Meet error when accessing admin queue */\n+\tIAVF_MSG_NON,      /* Read nothing from admin queue */\n+\tIAVF_MSG_SYS,      /* Read system msg from admin queue */\n+\tIAVF_MSG_CMD,      /* Read async command result */\n+};\n+\n /* Structure to store private data specific for VF instance. */\n struct iavf_info {\n \tuint16_t num_queue_pairs;\ndiff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c\nindex db0b76876..d53aeba5a 100644\n--- a/drivers/net/iavf/iavf_vchnl.c\n+++ b/drivers/net/iavf/iavf_vchnl.c\n@@ -25,14 +25,54 @@\n #define MAX_TRY_TIMES 200\n #define ASQ_DELAY_MS  10\n \n+static uint32_t\n+iavf_convert_link_speed(enum virtchnl_link_speed virt_link_speed)\n+{\n+\tuint32_t speed;\n+\n+\tswitch (virt_link_speed) {\n+\tcase VIRTCHNL_LINK_SPEED_100MB:\n+\t\tspeed = 100;\n+\t\tbreak;\n+\tcase VIRTCHNL_LINK_SPEED_1GB:\n+\t\tspeed = 1000;\n+\t\tbreak;\n+\tcase VIRTCHNL_LINK_SPEED_10GB:\n+\t\tspeed = 10000;\n+\t\tbreak;\n+\tcase VIRTCHNL_LINK_SPEED_40GB:\n+\t\tspeed = 40000;\n+\t\tbreak;\n+\tcase VIRTCHNL_LINK_SPEED_20GB:\n+\t\tspeed = 20000;\n+\t\tbreak;\n+\tcase VIRTCHNL_LINK_SPEED_25GB:\n+\t\tspeed = 25000;\n+\t\tbreak;\n+\tcase VIRTCHNL_LINK_SPEED_2_5GB:\n+\t\tspeed = 2500;\n+\t\tbreak;\n+\tcase VIRTCHNL_LINK_SPEED_5GB:\n+\t\tspeed = 5000;\n+\t\tbreak;\n+\tdefault:\n+\t\tspeed = 0;\n+\t\tbreak;\n+\t}\n+\n+\treturn speed;\n+}\n+\n /* Read data in admin queue to get msg from pf driver */\n-static enum iavf_status\n+static enum iavf_aq_result\n iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len,\n \t\t     uint8_t *buf)\n {\n \tstruct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter);\n \tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct rte_eth_dev *dev = adapter->eth_dev;\n \tstruct iavf_arq_event_info event;\n+\tenum iavf_aq_result result = IAVF_MSG_NON;\n \tenum virtchnl_ops opcode;\n \tint ret;\n \n@@ -42,7 +82,9 @@ iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len,\n \t/* Can't read any msg from adminQ */\n \tif (ret) {\n \t\tPMD_DRV_LOG(DEBUG, \"Can't read msg from AQ\");\n-\t\treturn ret;\n+\t\tif (ret != IAVF_ERR_ADMIN_QUEUE_NO_WORK)\n+\t\t\tresult = IAVF_MSG_ERR;\n+\t\treturn result;\n \t}\n \n \topcode = (enum virtchnl_ops)rte_le_to_cpu_32(event.desc.cookie_high);\n@@ -52,16 +94,51 @@ iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len,\n \tPMD_DRV_LOG(DEBUG, \"AQ from pf carries opcode %u, retval %d\",\n \t\t    opcode, vf->cmd_retval);\n \n-\tif (opcode != vf->pend_cmd) {\n-\t\tif (opcode != VIRTCHNL_OP_EVENT) {\n-\t\t\tPMD_DRV_LOG(WARNING,\n-\t\t\t\t    \"command mismatch, expect %u, get %u\",\n-\t\t\t\t    vf->pend_cmd, opcode);\n+\tif (opcode == VIRTCHNL_OP_EVENT) {\n+\t\tstruct virtchnl_pf_event *vpe =\n+\t\t\t(struct virtchnl_pf_event *)event.msg_buf;\n+\n+\t\tresult = IAVF_MSG_SYS;\n+\t\tswitch (vpe->event) {\n+\t\tcase VIRTCHNL_EVENT_LINK_CHANGE:\n+\t\t\tvf->link_up =\n+\t\t\t\tvpe->event_data.link_event.link_status;\n+\t\t\tif (vf->vf_res->vf_cap_flags &\n+\t\t\t\tVIRTCHNL_VF_CAP_ADV_LINK_SPEED) {\n+\t\t\t\tvf->link_speed =\n+\t\t\t\t    vpe->event_data.link_event_adv.link_speed;\n+\t\t\t} else {\n+\t\t\t\tenum virtchnl_link_speed speed;\n+\t\t\t\tspeed = vpe->event_data.link_event.link_speed;\n+\t\t\t\tvf->link_speed = iavf_convert_link_speed(speed);\n+\t\t\t}\n+\t\t\tiavf_dev_link_update(dev, 0);\n+\t\t\tPMD_DRV_LOG(INFO, \"Link status update:%s\",\n+\t\t\t\t\tvf->link_up ? \"up\" : \"down\");\n+\t\t\tbreak;\n+\t\tcase VIRTCHNL_EVENT_RESET_IMPENDING:\n+\t\t\tvf->vf_reset = true;\n+\t\t\tPMD_DRV_LOG(INFO, \"VF is resetting\");\n+\t\t\tbreak;\n+\t\tcase VIRTCHNL_EVENT_PF_DRIVER_CLOSE:\n+\t\t\tvf->dev_closed = true;\n+\t\t\tPMD_DRV_LOG(INFO, \"PF driver closed\");\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tPMD_DRV_LOG(ERR, \"%s: Unknown event %d from pf\",\n+\t\t\t\t\t__func__, vpe->event);\n+\t\t}\n+\t}  else {\n+\t\t/* async reply msg on command issued by vf previously */\n+\t\tresult = IAVF_MSG_CMD;\n+\t\tif (opcode != vf->pend_cmd) {\n+\t\t\tPMD_DRV_LOG(WARNING, \"command mismatch, expect %u, get %u\",\n+\t\t\t\t\tvf->pend_cmd, opcode);\n+\t\t\tresult = IAVF_MSG_ERR;\n \t\t}\n-\t\treturn IAVF_ERR_OPCODE_MISMATCH;\n \t}\n \n-\treturn IAVF_SUCCESS;\n+\treturn result;\n }\n \n static int\n@@ -69,6 +146,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)\n {\n \tstruct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter);\n \tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tenum iavf_aq_result result;\n \tenum iavf_status ret;\n \tint err = 0;\n \tint i = 0;\n@@ -97,9 +175,9 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)\n \tcase VIRTCHNL_OP_GET_SUPPORTED_RXDIDS:\n \t\t/* for init virtchnl ops, need to poll the response */\n \t\tdo {\n-\t\t\tret = iavf_read_msg_from_pf(adapter, args->out_size,\n+\t\t\tresult = iavf_read_msg_from_pf(adapter, args->out_size,\n \t\t\t\t\t\t   args->out_buffer);\n-\t\t\tif (ret == IAVF_SUCCESS)\n+\t\t\tif (result == IAVF_MSG_CMD)\n \t\t\t\tbreak;\n \t\t\trte_delay_ms(ASQ_DELAY_MS);\n \t\t} while (i++ < MAX_TRY_TIMES);\n@@ -136,44 +214,6 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)\n \treturn err;\n }\n \n-static uint32_t\n-iavf_convert_link_speed(enum virtchnl_link_speed virt_link_speed)\n-{\n-\tuint32_t speed;\n-\n-\tswitch (virt_link_speed) {\n-\tcase VIRTCHNL_LINK_SPEED_100MB:\n-\t\tspeed = 100;\n-\t\tbreak;\n-\tcase VIRTCHNL_LINK_SPEED_1GB:\n-\t\tspeed = 1000;\n-\t\tbreak;\n-\tcase VIRTCHNL_LINK_SPEED_10GB:\n-\t\tspeed = 10000;\n-\t\tbreak;\n-\tcase VIRTCHNL_LINK_SPEED_40GB:\n-\t\tspeed = 40000;\n-\t\tbreak;\n-\tcase VIRTCHNL_LINK_SPEED_20GB:\n-\t\tspeed = 20000;\n-\t\tbreak;\n-\tcase VIRTCHNL_LINK_SPEED_25GB:\n-\t\tspeed = 25000;\n-\t\tbreak;\n-\tcase VIRTCHNL_LINK_SPEED_2_5GB:\n-\t\tspeed = 2500;\n-\t\tbreak;\n-\tcase VIRTCHNL_LINK_SPEED_5GB:\n-\t\tspeed = 5000;\n-\t\tbreak;\n-\tdefault:\n-\t\tspeed = 0;\n-\t\tbreak;\n-\t}\n-\n-\treturn speed;\n-}\n-\n static void\n iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,\n \t\t\tuint16_t msglen)\n",
    "prefixes": [
        "v7",
        "1/6"
    ]
}