get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 51615,
    "url": "http://patches.dpdk.org/api/patches/51615/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190325090102.85918-2-qiming.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": "<20190325090102.85918-2-qiming.yang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190325090102.85918-2-qiming.yang@intel.com",
    "date": "2019-03-25T09:01:00",
    "name": "[v6,1/3] net/ice: load OS default package",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7168227b2d4c4964bb9abb2ec0fdb5905d1ea81e",
    "submitter": {
        "id": 522,
        "url": "http://patches.dpdk.org/api/people/522/?format=api",
        "name": "Qiming Yang",
        "email": "qiming.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/20190325090102.85918-2-qiming.yang@intel.com/mbox/",
    "series": [
        {
            "id": 3890,
            "url": "http://patches.dpdk.org/api/series/3890/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3890",
            "date": "2019-03-25T09:00:59",
            "name": "enable package download in ice driver",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/3890/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/51615/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/51615/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1455237B0;\n\tMon, 25 Mar 2019 10:01:11 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 234892BD3\n\tfor <dev@dpdk.org>; Mon, 25 Mar 2019 10:01:06 +0100 (CET)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Mar 2019 02:01:06 -0700",
            "from dpdk-qiming2.sh.intel.com ([10.67.119.132])\n\tby orsmga004.jf.intel.com with ESMTP; 25 Mar 2019 02:01:06 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.60,256,1549958400\"; d=\"scan'208\";a=\"285623001\"",
        "From": "Qiming Yang <qiming.yang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qi.z.zhang@intel.com,\n\tQiming Yang <qiming.yang@intel.com>",
        "Date": "Mon, 25 Mar 2019 17:01:00 +0800",
        "Message-Id": "<20190325090102.85918-2-qiming.yang@intel.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20190325090102.85918-1-qiming.yang@intel.com>",
        "References": "<20190321150232.13536-2-qiming.yang@intel.com>\n\t<20190325090102.85918-1-qiming.yang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 1/3] net/ice: load OS default package",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch enables package downloading to the device. The package is\nto be in the /lib/firmware/intel/ice/ddp directory and named ice.pkg.\nThe package is shared by the kernel driver and the DPDK PMD.\n\nThere is no per device package be supported so far, all the\ndevices can only download the same package. This limitation will\nbe removed in the future.\n\nSigned-off-by: Qiming Yang <qiming.yang@intel.com>\n---\n doc/guides/nics/ice.rst                |  9 ++++\n doc/guides/rel_notes/release_19_05.rst |  4 ++\n drivers/net/ice/ice_ethdev.c           | 77 ++++++++++++++++++++++++++++++++++\n 3 files changed, 90 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst\nindex 3998d5e..6410ec5 100644\n--- a/doc/guides/nics/ice.rst\n+++ b/doc/guides/nics/ice.rst\n@@ -84,6 +84,15 @@ To start ``testpmd``, and add vlan 10 to port 0:\n Limitations or Known issues\n ---------------------------\n \n+The Intel E810 requires a programmable pipeline package be downloaded\n+by the driver to support normal operations. The E810 has a limited\n+functionality built in to allow PXE boot and other use cases, but the\n+driver must download a package file during the driver initialization\n+stage. The file must be in the /lib/firmware/intel/ice/ddp directory\n+and it must be named ice.pkg. A symbolic link to this file is also ok.\n+The same package file is used by both the kernel driver and the DPDK PMD.\n+\n+\n 19.02 limitation\n ~~~~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst\nindex 61a2c73..b73938a 100644\n--- a/doc/guides/rel_notes/release_19_05.rst\n+++ b/doc/guides/rel_notes/release_19_05.rst\n@@ -91,6 +91,10 @@ New Features\n \n   * Added promiscuous mode support.\n \n+* **Updated the ice driver.**\n+\n+  * Added package download support.\n+\n \n Removed Items\n -------------\ndiff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex a23c63a..c2a03c3 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -4,12 +4,19 @@\n \n #include <rte_ethdev_pci.h>\n \n+\n+#include <stdio.h>\n+#include <sys/types.h>\n+#include <sys/stat.h>\n+#include <unistd.h>\n+\n #include \"base/ice_sched.h\"\n #include \"ice_ethdev.h\"\n #include \"ice_rxtx.h\"\n \n #define ICE_MAX_QP_NUM \"max_queue_pair_num\"\n #define ICE_DFLT_OUTER_TAG_TYPE ICE_AQ_VSI_OUTER_TAG_VLAN_9100\n+#define ICE_DFLT_PKG_FILE \"/lib/firmware/intel/ice/ddp/ice.pkg\"\n \n int ice_logtype_init;\n int ice_logtype_driver;\n@@ -1259,6 +1266,69 @@ ice_pf_setup(struct ice_pf *pf)\n \treturn 0;\n }\n \n+static int ice_load_pkg(struct rte_eth_dev *dev)\n+{\n+\tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tconst char *pkg_file = ICE_DFLT_PKG_FILE;\n+\tint err;\n+\tuint8_t *buf;\n+\tint buf_len;\n+\tFILE *file;\n+\tstruct stat fstat;\n+\n+\tfile = fopen(pkg_file, \"rb\");\n+\tif (!file)  {\n+\t\tPMD_INIT_LOG(ERR, \"failed to open file: %s\\n\", pkg_file);\n+\t\treturn -1;\n+\t}\n+\n+\terr = stat(pkg_file, &fstat);\n+\tif (err) {\n+\t\tPMD_INIT_LOG(ERR, \"failed to get file stats\\n\");\n+\t\tfclose(file);\n+\t\treturn err;\n+\t}\n+\n+\tbuf_len = fstat.st_size;\n+\tbuf = rte_malloc(NULL, buf_len, 0);\n+\n+\tif (!buf) {\n+\t\tPMD_INIT_LOG(ERR, \"failed to allocate buf of size %d\"\n+\t\t\t\t  \"for package\\n\", buf_len);\n+\t\tfclose(file);\n+\t\treturn -1;\n+\t}\n+\n+\terr = fread(buf, buf_len, 1, file);\n+\tif (err != 1) {\n+\t\tPMD_INIT_LOG(ERR, \"failed to read package data\\n\");\n+\t\tfclose(file);\n+\t\terr = -1;\n+\t\tgoto fail_exit;\n+\t}\n+\n+\tfclose(file);\n+\n+\terr = ice_copy_and_init_pkg(hw, buf, buf_len);\n+\tif (err) {\n+\t\tPMD_INIT_LOG(ERR, \"ice_copy_and_init_hw failed: %d\\n\", err);\n+\t\tgoto fail_exit;\n+\t}\n+\terr = ice_init_hw_tbls(hw);\n+\tif (err) {\n+\t\tPMD_INIT_LOG(ERR, \"ice_init_hw_tbls failed: %d\\n\", err);\n+\t\tgoto fail_init_tbls;\n+\t}\n+\n+\treturn 0;\n+\n+fail_init_tbls:\n+\trte_free(hw->pkg_copy);\n+fail_exit:\n+\trte_free(buf);\n+\treturn err;\n+}\n+\n static int\n ice_dev_init(struct rte_eth_dev *dev)\n {\n@@ -1298,6 +1368,12 @@ ice_dev_init(struct rte_eth_dev *dev)\n \t\treturn -EINVAL;\n \t}\n \n+\tret = ice_load_pkg(dev);\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to load the DDP package\");\n+\t\tgoto err_load_pkg;\n+\t}\n+\n \tPMD_INIT_LOG(INFO, \"FW %d.%d.%05d API %d.%d\",\n \t\t     hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build,\n \t\t     hw->api_maj_ver, hw->api_min_ver);\n@@ -1343,6 +1419,7 @@ ice_dev_init(struct rte_eth_dev *dev)\n err_msix_pool_init:\n \trte_free(dev->data->mac_addrs);\n err_init_mac:\n+err_load_pkg:\n \tice_sched_cleanup_all(hw);\n \trte_free(hw->port_info);\n \tice_shutdown_all_ctrlq(hw);\n",
    "prefixes": [
        "v6",
        "1/3"
    ]
}