get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82076,
    "url": "https://patches.dpdk.org/api/patches/82076/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201025002953.1680999-10-qi.z.zhang@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": "<20201025002953.1680999-10-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201025002953.1680999-10-qi.z.zhang@intel.com",
    "date": "2020-10-25T00:29:41",
    "name": "[v2,09/21] net/ice/base: update to use package info from ice segment",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2dd97fdf09a56edbd582ffd977bc2edc7e0b1b31",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@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/20201025002953.1680999-10-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 13297,
            "url": "https://patches.dpdk.org/api/series/13297/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13297",
            "date": "2020-10-25T00:29:32",
            "name": "ice: update base code",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/13297/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/82076/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/82076/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 46D71A04B5;\n\tSun, 25 Oct 2020 02:29:03 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C55802BAF;\n\tSun, 25 Oct 2020 02:26:22 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by dpdk.org (Postfix) with ESMTP id 03B9811C5\n for <dev@dpdk.org>; Sun, 25 Oct 2020 02:26:10 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Oct 2020 17:26:10 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.142])\n by FMSMGA003.fm.intel.com with ESMTP; 24 Oct 2020 17:26:09 -0700"
        ],
        "IronPort-SDR": [
            "\n sL0hO8ojnHicRjMpwWpp5MaYibZjUEet45OA3D4H5uoX4lJSqn/jRJ2yoLKzraHCr4p+o3uMah\n TUmOtCsLD/cA==",
            "\n 3hzk6XHQzJRyih5af4r6hUUtAoc0J5b3Wc6pmguA7gJc7LWjOAzlVjNlqYh2kdgHPfTc3vW8ar\n lFsB0h8o4Oqg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9784\"; a=\"167927037\"",
            "E=Sophos;i=\"5.77,414,1596524400\"; d=\"scan'208\";a=\"167927037\"",
            "E=Sophos;i=\"5.77,414,1596524400\"; d=\"scan'208\";a=\"359984054\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Dan Nowlin <dan.nowlin@intel.com>",
        "Date": "Sun, 25 Oct 2020 08:29:41 +0800",
        "Message-Id": "<20201025002953.1680999-10-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.25.4",
        "In-Reply-To": "<20201025002953.1680999-1-qi.z.zhang@intel.com>",
        "References": "<20201025002953.1680999-1-qi.z.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 09/21] net/ice/base: update to use package\n\tinfo from ice segment",
        "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": "There are two package versions in the package binary. Today, these two\nversion numbers are the same. However, in the future that may change.\n\nUpdate code to use the package info from the ice segment metadata\nsection, which is the package information that is actually downloaded to\nthe firmware during the download package process.\n\nSigned-off-by: Dan Nowlin <dan.nowlin@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_adminq_cmd.h |  1 +\n drivers/net/ice/base/ice_flex_pipe.c  | 44 +++++++++++++++------------\n drivers/net/ice/base/ice_flex_type.h  |  8 +++++\n drivers/net/ice/base/ice_type.h       |  8 ++---\n 4 files changed, 38 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h\nindex fd34be2524..cadd6df384 100644\n--- a/drivers/net/ice/base/ice_adminq_cmd.h\n+++ b/drivers/net/ice/base/ice_adminq_cmd.h\n@@ -2558,6 +2558,7 @@ struct ice_pkg_ver {\n };\n \n #define ICE_PKG_NAME_SIZE\t32\n+#define ICE_SEG_ID_SIZE\t28\n #define ICE_SEG_NAME_SIZE\t28\n \n struct ice_aqc_get_pkg_info {\ndiff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c\nindex 8d918eff7d..4a27061b3d 100644\n--- a/drivers/net/ice/base/ice_flex_pipe.c\n+++ b/drivers/net/ice/base/ice_flex_pipe.c\n@@ -1075,34 +1075,40 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg)\n static enum ice_status\n ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr)\n {\n-\tstruct ice_global_metadata_seg *meta_seg;\n \tstruct ice_generic_seg_hdr *seg_hdr;\n \n \tice_debug(hw, ICE_DBG_TRACE, \"%s\\n\", __func__);\n \tif (!pkg_hdr)\n \t\treturn ICE_ERR_PARAM;\n \n-\tmeta_seg = (struct ice_global_metadata_seg *)\n-\t\t   ice_find_seg_in_pkg(hw, SEGMENT_TYPE_METADATA, pkg_hdr);\n-\tif (meta_seg) {\n-\t\thw->pkg_ver = meta_seg->pkg_ver;\n-\t\tice_memcpy(hw->pkg_name, meta_seg->pkg_name,\n-\t\t\t   sizeof(hw->pkg_name), ICE_NONDMA_TO_NONDMA);\n+\tseg_hdr = (struct ice_generic_seg_hdr *)\n+\t\tice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr);\n+\tif (seg_hdr) {\n+\t\tstruct ice_meta_sect *meta;\n+\t\tstruct ice_pkg_enum state;\n+\n+\t\tice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM);\n+\n+\t\t/* Get package information from the Metadata Section */\n+\t\tmeta = (struct ice_meta_sect *)\n+\t\t\tice_pkg_enum_section((struct ice_seg *)seg_hdr, &state,\n+\t\t\t\t\t     ICE_SID_METADATA);\n+\t\tif (!meta) {\n+\t\t\tice_debug(hw, ICE_DBG_INIT, \"Did not find ice metadata section in package\\n\");\n+\t\t\treturn ICE_ERR_CFG;\n+\t\t}\n+\n+\t\thw->pkg_ver = meta->ver;\n+\t\tice_memcpy(hw->pkg_name, meta->name, sizeof(meta->name),\n+\t\t\t   ICE_NONDMA_TO_NONDMA);\n \n \t\tice_debug(hw, ICE_DBG_PKG, \"Pkg: %d.%d.%d.%d, %s\\n\",\n-\t\t\t  meta_seg->pkg_ver.major, meta_seg->pkg_ver.minor,\n-\t\t\t  meta_seg->pkg_ver.update, meta_seg->pkg_ver.draft,\n-\t\t\t  meta_seg->pkg_name);\n-\t} else {\n-\t\tice_debug(hw, ICE_DBG_INIT, \"Did not find metadata segment in driver package\\n\");\n-\t\treturn ICE_ERR_CFG;\n-\t}\n+\t\t\t  meta->ver.major, meta->ver.minor, meta->ver.update,\n+\t\t\t  meta->ver.draft, meta->name);\n \n-\tseg_hdr = ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr);\n-\tif (seg_hdr) {\n-\t\thw->ice_pkg_ver = seg_hdr->seg_format_ver;\n-\t\tice_memcpy(hw->ice_pkg_name, seg_hdr->seg_id,\n-\t\t\t   sizeof(hw->ice_pkg_name), ICE_NONDMA_TO_NONDMA);\n+\t\thw->ice_seg_fmt_ver = seg_hdr->seg_format_ver;\n+\t\tice_memcpy(hw->ice_seg_id, seg_hdr->seg_id,\n+\t\t\t   sizeof(hw->ice_seg_id), ICE_NONDMA_TO_NONDMA);\n \n \t\tice_debug(hw, ICE_DBG_PKG, \"Ice Seg: %d.%d.%d.%d, %s\\n\",\n \t\t\t  seg_hdr->seg_format_ver.major,\ndiff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h\nindex 8f33efdd62..1dd57baccd 100644\n--- a/drivers/net/ice/base/ice_flex_type.h\n+++ b/drivers/net/ice/base/ice_flex_type.h\n@@ -114,6 +114,7 @@ struct ice_buf_hdr {\n \t(ent_sz))\n \n /* ice package section IDs */\n+#define ICE_SID_METADATA\t\t1\n #define ICE_SID_XLT0_SW\t\t\t10\n #define ICE_SID_XLT_KEY_BUILDER_SW\t11\n #define ICE_SID_XLT1_SW\t\t\t12\n@@ -343,6 +344,13 @@ struct ice_ptype_attributes {\n \tenum ice_ptype_attrib_type attrib;\n };\n \n+struct ice_meta_sect {\n+\tstruct ice_pkg_ver ver;\n+#define ICE_META_SECT_NAME_SIZE\t28\n+\tchar name[ICE_META_SECT_NAME_SIZE];\n+\t__le32 track_id;\n+};\n+\n /* Packet Type Groups (PTG) - Inner Most fields (IM) */\n #define ICE_PTG_IM_IPV4_TCP\t\t16\n #define ICE_PTG_IM_IPV4_UDP\t\t17\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex fb350faa60..3d231db61a 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -930,13 +930,13 @@ struct ice_hw {\n \n \tenum ice_aq_err pkg_dwnld_status;\n \n-\t/* Driver's package ver - (from the Metadata seg) */\n+\t/* Driver's package ver - (from the Ice Metadata section) */\n \tstruct ice_pkg_ver pkg_ver;\n \tu8 pkg_name[ICE_PKG_NAME_SIZE];\n \n-\t/* Driver's Ice package version (from the Ice seg) */\n-\tstruct ice_pkg_ver ice_pkg_ver;\n-\tu8 ice_pkg_name[ICE_PKG_NAME_SIZE];\n+\t/* Driver's Ice segment format version and id (from the Ice seg) */\n+\tstruct ice_pkg_ver ice_seg_fmt_ver;\n+\tu8 ice_seg_id[ICE_SEG_ID_SIZE];\n \n \t/* Pointer to the ice segment */\n \tstruct ice_seg *seg;\n",
    "prefixes": [
        "v2",
        "09/21"
    ]
}