get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131663,
    "url": "https://patches.dpdk.org/api/patches/131663/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230920062236.375308-7-simei.su@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20230920062236.375308-7-simei.su@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230920062236.375308-7-simei.su@intel.com",
    "date": "2023-09-20T06:22:31",
    "name": "[v5,06/11] common/idpf/base: refine structure and necessary check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ffe098529b1e682e51732a95ae8ac8ac470a3ecf",
    "submitter": {
        "id": 1298,
        "url": "https://patches.dpdk.org/api/people/1298/?format=api",
        "name": "Simei Su",
        "email": "simei.su@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230920062236.375308-7-simei.su@intel.com/mbox/",
    "series": [
        {
            "id": 29562,
            "url": "https://patches.dpdk.org/api/series/29562/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29562",
            "date": "2023-09-20T06:22:25",
            "name": "update idpf base code",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/29562/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/131663/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/131663/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 470C1425E9;\n\tWed, 20 Sep 2023 08:22:56 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6440840DCD;\n\tWed, 20 Sep 2023 08:22:32 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 4606440DCE\n for <dev@dpdk.org>; Wed, 20 Sep 2023 08:22:30 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Sep 2023 23:22:29 -0700",
            "from dpdk-simei-icelake.sh.intel.com ([10.67.110.167])\n by orsmga005.jf.intel.com with ESMTP; 19 Sep 2023 23:22:26 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1695190950; x=1726726950;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=YIXtmR3F6j533+wnP/110K8+BIFrwlK36OSItmBKQj4=;\n b=Pab25MP/YQxaBjfc1aOETaYOeQRs51BH8wokSicH6g8qGCZaiu402qVc\n sbdZeF7nsFIhrNHaU+kCqdFFmiU0phwVt/TzkX4FN5mP2PZ0OYZFeieRL\n 8BnxRUJpbtOvOHG2TT9XPtkE4vq11p4fBaCGz4S0hGX/6/fCMZFTeSGDd\n SiDMcfimomHqxmuLJ4LR8hKbIq4G+tW1ocF3OGWMV98xOE/iUiyLFxpXu\n jmugkCx+smQNzp6vm16yn1s1iPZpo1wkV3F1n7cKTmrO/Bom6dhZrfzgG\n 1vUw7k/MAP3rmoa0KZ5f5idHStotInA+O18rezobJCFXdkNeMqxDR/fiM w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10838\"; a=\"466453258\"",
            "E=Sophos;i=\"6.02,161,1688454000\"; d=\"scan'208\";a=\"466453258\"",
            "E=McAfee;i=\"6600,9927,10838\"; a=\"920154654\"",
            "E=Sophos;i=\"6.02,161,1688454000\"; d=\"scan'208\";a=\"920154654\""
        ],
        "X-ExtLoop1": "1",
        "From": "Simei Su <simei.su@intel.com>",
        "To": "jingjing.wu@intel.com,\n\tbeilei.xing@intel.com,\n\tqi.z.zhang@intel.com",
        "Cc": "dev@dpdk.org, wenjun1.wu@intel.com, mingxia.liu@intel.com,\n wenjing.qiao@intel.com, Simei Su <simei.su@intel.com>,\n Shailendra Bhatnagar <shailendra.bhatnagar@intel.com>,\n Julianx Grajkowski <julianx.grajkowski@intel.com>",
        "Subject": "[PATCH v5 06/11] common/idpf/base: refine structure and necessary\n check",
        "Date": "Wed, 20 Sep 2023 14:22:31 +0800",
        "Message-Id": "<20230920062236.375308-7-simei.su@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230920062236.375308-1-simei.su@intel.com>",
        "References": "<20230918021130.192982-1-simei.su@intel.com>\n <20230920062236.375308-1-simei.su@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "a) Refine queue chunk and vector chunk structures.\nb) Add non_flex prefix to distinguish the flex array definitions.\nc) Add some specific fields.\nd) Refine condition check.\n\nSigned-off-by: Shailendra Bhatnagar <shailendra.bhatnagar@intel.com>\nSigned-off-by: Julianx Grajkowski <julianx.grajkowski@intel.com>\nSigned-off-by: Simei Su <simei.su@intel.com>\nAcked-by: Beilei Xing <beilei.xing@intel.com>\n---\n .mailmap                               |  2 +\n drivers/common/idpf/base/idpf_common.c |  6 ++-\n drivers/common/idpf/base/virtchnl2.h   | 72 +++++++++++++++++---------\n 3 files changed, 54 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/.mailmap b/.mailmap\nindex d8782cd67e..23aed53102 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1643,3 +1643,5 @@ Jayaprakash Shanmugam <jayaprakash.shanmugam@intel.com>\n Zhenning Xiao <zhenning.xiao@intel.com>\n Josh Hay <joshua.a.hay@intel.com>\n Madhu Chittim <madhu.chittim@intel.com>\n+Shailendra Bhatnagar <shailendra.bhatnagar@intel.com>\n+Julianx Grajkowski <julianx.grajkowski@intel.com>\ndiff --git a/drivers/common/idpf/base/idpf_common.c b/drivers/common/idpf/base/idpf_common.c\nindex fbf71416fd..9610916aa9 100644\n--- a/drivers/common/idpf/base/idpf_common.c\n+++ b/drivers/common/idpf/base/idpf_common.c\n@@ -239,8 +239,10 @@ int idpf_clean_arq_element(struct idpf_hw *hw,\n \te->desc.ret_val = msg.status;\n \te->desc.datalen = msg.data_len;\n \tif (msg.data_len > 0) {\n-\t\tif (!msg.ctx.indirect.payload)\n-\t\t\treturn -EINVAL;\n+\t\tif (!msg.ctx.indirect.payload || !msg.ctx.indirect.payload->va ||\n+\t\t    !e->msg_buf) {\n+\t\t\treturn -EFAULT;\n+\t\t}\n \t\te->buf_len = msg.data_len;\n \t\tmsg_data_len = msg.data_len;\n \t\tidpf_memcpy(e->msg_buf, msg.ctx.indirect.payload->va, msg_data_len,\ndiff --git a/drivers/common/idpf/base/virtchnl2.h b/drivers/common/idpf/base/virtchnl2.h\nindex 320430df6f..3900b784d0 100644\n--- a/drivers/common/idpf/base/virtchnl2.h\n+++ b/drivers/common/idpf/base/virtchnl2.h\n@@ -89,8 +89,8 @@\n \t * VIRTCHNL2_OP_GET_PTYPE_INFO_RAW\n \t */\n \t/* opcodes 529, 530, and 531 are reserved */\n-#define\t\tVIRTCHNL2_OP_CREATE_ADI\t\t\t532\n-#define\t\tVIRTCHNL2_OP_DESTROY_ADI\t\t533\n+#define\t\tVIRTCHNL2_OP_NON_FLEX_CREATE_ADI\t532\n+#define\t\tVIRTCHNL2_OP_NON_FLEX_DESTROY_ADI\t533\n #define\t\tVIRTCHNL2_OP_LOOPBACK\t\t\t534\n #define\t\tVIRTCHNL2_OP_ADD_MAC_ADDR\t\t535\n #define\t\tVIRTCHNL2_OP_DEL_MAC_ADDR\t\t536\n@@ -294,6 +294,7 @@\n /* These messages are only sent to PF from CP */\n #define VIRTCHNL2_EVENT_START_RESET_ADI\t\t2\n #define VIRTCHNL2_EVENT_FINISH_RESET_ADI\t3\n+#define VIRTCHNL2_EVENT_ADI_ACTIVE\t\t4\n \n /* VIRTCHNL2_QUEUE_TYPE\n  * Transmit and Receive queue types are valid in legacy as well as split queue\n@@ -547,7 +548,8 @@ struct virtchnl2_get_capabilities {\n \tu8 max_sg_bufs_per_tx_pkt;\n \n \tu8 reserved1;\n-\t__le16 pad1;\n+\t/* upper bound of number of ADIs supported */\n+\t__le16 max_adis;\n \n \t/* version of Control Plane that is running */\n \t__le16 oem_cp_ver_major;\n@@ -1059,14 +1061,34 @@ struct virtchnl2_sriov_vfs_info {\n \n VIRTCHNL2_CHECK_STRUCT_LEN(4, virtchnl2_sriov_vfs_info);\n \n-/* VIRTCHNL2_OP_CREATE_ADI\n+/* structure to specify single chunk of queue */\n+/* 'chunks' is fixed size(not flexible) and will be deprecated at some point */\n+struct virtchnl2_non_flex_queue_reg_chunks {\n+\t__le16 num_chunks;\n+\tu8 reserved[6];\n+\tstruct virtchnl2_queue_reg_chunk chunks[1];\n+};\n+\n+VIRTCHNL2_CHECK_STRUCT_LEN(40, virtchnl2_non_flex_queue_reg_chunks);\n+\n+/* structure to specify single chunk of interrupt vector */\n+/* 'vchunks' is fixed size(not flexible) and will be deprecated at some point */\n+struct virtchnl2_non_flex_vector_chunks {\n+\t__le16 num_vchunks;\n+\tu8 reserved[14];\n+\tstruct virtchnl2_vector_chunk vchunks[1];\n+};\n+\n+VIRTCHNL2_CHECK_STRUCT_LEN(48, virtchnl2_non_flex_vector_chunks);\n+\n+/* VIRTCHNL2_OP_NON_FLEX_CREATE_ADI\n  * PF sends this message to CP to create ADI by filling in required\n- * fields of virtchnl2_create_adi structure.\n- * CP responds with the updated virtchnl2_create_adi structure containing the\n- * necessary fields followed by chunks which in turn will have an array of\n+ * fields of virtchnl2_non_flex_create_adi structure.\n+ * CP responds with the updated virtchnl2_non_flex_create_adi structure containing\n+ * the necessary fields followed by chunks which in turn will have an array of\n  * num_chunks entries of virtchnl2_queue_chunk structures.\n  */\n-struct virtchnl2_create_adi {\n+struct virtchnl2_non_flex_create_adi {\n \t/* PF sends PASID to CP */\n \t__le32 pasid;\n \t/*\n@@ -1076,29 +1098,31 @@ struct virtchnl2_create_adi {\n \t__le16 mbx_id;\n \t/* PF sends mailbox vector id to CP */\n \t__le16 mbx_vec_id;\n+\t/* PF populates this ADI index */\n+\t__le16 adi_index;\n \t/* CP populates ADI id */\n \t__le16 adi_id;\n \tu8 reserved[64];\n-\tu8 pad[6];\n+\tu8 pad[4];\n \t/* CP populates queue chunks */\n-\tstruct virtchnl2_queue_reg_chunks chunks;\n+\tstruct virtchnl2_non_flex_queue_reg_chunks chunks;\n \t/* PF sends vector chunks to CP */\n-\tstruct virtchnl2_vector_chunks vchunks;\n+\tstruct virtchnl2_non_flex_vector_chunks vchunks;\n };\n \n-VIRTCHNL2_CHECK_STRUCT_LEN(168, virtchnl2_create_adi);\n+VIRTCHNL2_CHECK_STRUCT_LEN(168, virtchnl2_non_flex_create_adi);\n \n /* VIRTCHNL2_OP_DESTROY_ADI\n  * PF sends this message to CP to destroy ADI by filling\n  * in the adi_id in virtchnl2_destropy_adi structure.\n  * CP responds with the status of the requested operation.\n  */\n-struct virtchnl2_destroy_adi {\n+struct virtchnl2_non_flex_destroy_adi {\n \t__le16 adi_id;\n \tu8 reserved[2];\n };\n \n-VIRTCHNL2_CHECK_STRUCT_LEN(4, virtchnl2_destroy_adi);\n+VIRTCHNL2_CHECK_STRUCT_LEN(4, virtchnl2_non_flex_destroy_adi);\n \n /* Based on the descriptor type the PF supports, CP fills ptype_id_10 or\n  * ptype_id_8 for flex and base descriptor respectively. If ptype_id_10 value\n@@ -1562,10 +1586,10 @@ static inline const char *virtchnl2_op_str(__le32 v_opcode)\n \t\treturn \"VIRTCHNL2_OP_EVENT\";\n \tcase VIRTCHNL2_OP_RESET_VF:\n \t\treturn \"VIRTCHNL2_OP_RESET_VF\";\n-\tcase VIRTCHNL2_OP_CREATE_ADI:\n-\t\treturn \"VIRTCHNL2_OP_CREATE_ADI\";\n-\tcase VIRTCHNL2_OP_DESTROY_ADI:\n-\t\treturn \"VIRTCHNL2_OP_DESTROY_ADI\";\n+\tcase VIRTCHNL2_OP_NON_FLEX_CREATE_ADI:\n+\t\treturn \"VIRTCHNL2_OP_NON_FLEX_CREATE_ADI\";\n+\tcase VIRTCHNL2_OP_NON_FLEX_DESTROY_ADI:\n+\t\treturn \"VIRTCHNL2_OP_NON_FLEX_DESTROY_ADI\";\n \tcase VIRTCHNL2_OP_ADD_QUEUE_GROUPS:\n \t\treturn \"VIRTCHNL2_OP_ADD_QUEUE_GROUPS\";\n \tcase VIRTCHNL2_OP_DEL_QUEUE_GROUPS:\n@@ -1620,11 +1644,11 @@ virtchnl2_vc_validate_vf_msg(__rte_unused struct virtchnl2_version_info *ver, u3\n \t\t\t\t      sizeof(struct virtchnl2_queue_reg_chunk);\n \t\t}\n \t\tbreak;\n-\tcase VIRTCHNL2_OP_CREATE_ADI:\n-\t\tvalid_len = sizeof(struct virtchnl2_create_adi);\n+\tcase VIRTCHNL2_OP_NON_FLEX_CREATE_ADI:\n+\t\tvalid_len = sizeof(struct virtchnl2_non_flex_create_adi);\n \t\tif (msglen >= valid_len) {\n-\t\t\tstruct virtchnl2_create_adi *cadi =\n-\t\t\t\t(struct virtchnl2_create_adi *)msg;\n+\t\t\tstruct virtchnl2_non_flex_create_adi *cadi =\n+\t\t\t\t(struct virtchnl2_non_flex_create_adi *)msg;\n \n \t\t\tif (cadi->chunks.num_chunks == 0) {\n \t\t\t\t/* zero chunks is allowed as input */\n@@ -1641,8 +1665,8 @@ virtchnl2_vc_validate_vf_msg(__rte_unused struct virtchnl2_version_info *ver, u3\n \t\t\t\t      sizeof(struct virtchnl2_vector_chunk);\n \t\t}\n \t\tbreak;\n-\tcase VIRTCHNL2_OP_DESTROY_ADI:\n-\t\tvalid_len = sizeof(struct virtchnl2_destroy_adi);\n+\tcase VIRTCHNL2_OP_NON_FLEX_DESTROY_ADI:\n+\t\tvalid_len = sizeof(struct virtchnl2_non_flex_destroy_adi);\n \t\tbreak;\n \tcase VIRTCHNL2_OP_DESTROY_VPORT:\n \tcase VIRTCHNL2_OP_ENABLE_VPORT:\n",
    "prefixes": [
        "v5",
        "06/11"
    ]
}