get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 4365,
    "url": "https://patches.dpdk.org/api/patches/4365/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1429518150-28098-10-git-send-email-helin.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": "<1429518150-28098-10-git-send-email-helin.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1429518150-28098-10-git-send-email-helin.zhang@intel.com",
    "date": "2015-04-20T08:22:21",
    "name": "[dpdk-dev,09/18] i40e: adminq enhancements",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5d0381a5c5131e2ed2fab3a76b100220bc3000aa",
    "submitter": {
        "id": 14,
        "url": "https://patches.dpdk.org/api/people/14/?format=api",
        "name": "Zhang, Helin",
        "email": "helin.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1429518150-28098-10-git-send-email-helin.zhang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/4365/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/4365/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 2671BC3DC;\n\tMon, 20 Apr 2015 10:23:01 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 979ADC3C4\n\tfor <dev@dpdk.org>; Mon, 20 Apr 2015 10:22:58 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 20 Apr 2015 01:22:57 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 20 Apr 2015 01:22:57 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t3K8MsPb013126;\n\tMon, 20 Apr 2015 16:22:54 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t3K8MpX3028196; Mon, 20 Apr 2015 16:22:53 +0800",
            "(from hzhan75@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t3K8Mptl028192; \n\tMon, 20 Apr 2015 16:22:51 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.11,608,1422950400\"; d=\"scan'208\";a=\"697841035\"",
        "From": "Helin Zhang <helin.zhang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 20 Apr 2015 16:22:21 +0800",
        "Message-Id": "<1429518150-28098-10-git-send-email-helin.zhang@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1429518150-28098-1-git-send-email-helin.zhang@intel.com>",
        "References": "<1429518150-28098-1-git-send-email-helin.zhang@intel.com>",
        "Cc": "monica.kenguva@intel.com, steven.j.murray@intel.com,\n\tchiu-pi.shih@intel.com",
        "Subject": "[dpdk-dev] [PATCH 09/18] i40e: adminq enhancements",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "To be more extendable, 'i40e_is_vf()' was introduced to check if\nthe MAC type is VF. Also other minor enhancements were added for\n'i40e_init_adminq()'.\n\nSigned-off-by: Helin Zhang <helin.zhang@intel.com>\n---\n lib/librte_pmd_i40e/i40e/i40e_adminq.c | 31 ++++++++++---------------------\n lib/librte_pmd_i40e/i40e/i40e_type.h   |  7 ++++++-\n 2 files changed, 16 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_i40e/i40e/i40e_adminq.c b/lib/librte_pmd_i40e/i40e/i40e_adminq.c\nindex e8e762f..42df290 100644\n--- a/lib/librte_pmd_i40e/i40e/i40e_adminq.c\n+++ b/lib/librte_pmd_i40e/i40e/i40e_adminq.c\n@@ -58,7 +58,7 @@ STATIC INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc)\n STATIC void i40e_adminq_init_regs(struct i40e_hw *hw)\n {\n \t/* set head and tail registers in our local struct */\n-\tif (hw->mac.type == I40E_MAC_VF) {\n+\tif (i40e_is_vf(hw)) {\n \t\thw->aq.asq.tail = I40E_VF_ATQT1;\n \t\thw->aq.asq.head = I40E_VF_ATQH1;\n \t\thw->aq.asq.len  = I40E_VF_ATQLEN1;\n@@ -563,7 +563,6 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)\n \tu16 eetrack_lo, eetrack_hi;\n \tint retry = 0;\n #endif\n-\n \t/* verify input for valid configuration */\n \tif ((hw->aq.num_arq_entries == 0) ||\n \t    (hw->aq.num_asq_entries == 0) ||\n@@ -594,6 +593,11 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)\n \t\tgoto init_adminq_free_asq;\n \n #ifndef VF_DRIVER\n+#ifdef INTEGRATED_VF\n+\t/* VF has no need of firmware */\n+\tif (i40e_is_vf(hw))\n+\t\tgoto init_adminq_exit;\n+#endif\n \t/* There are some cases where the firmware may not be quite ready\n \t * for AdminQ operations, so we retry the AdminQ setup a few times\n \t * if we see timeouts in this first AQ call.\n@@ -615,7 +619,8 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)\n \t\tgoto init_adminq_free_arq;\n \n \t/* get the NVM version info */\n-\ti40e_read_nvm_word(hw, I40E_SR_NVM_IMAGE_VERSION, &hw->nvm.version);\n+\ti40e_read_nvm_word(hw, I40E_SR_NVM_DEV_STARTER_VERSION,\n+\t\t\t   &hw->nvm.version);\n \ti40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo);\n \ti40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi);\n \thw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo;\n@@ -627,7 +632,8 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)\n \n \t/* pre-emptive resource lock release */\n \ti40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);\n-\thw->aq.nvm_busy = false;\n+\thw->aq.nvm_release_on_done = false;\n+\thw->nvmupd_state = I40E_NVMUPD_STATE_INIT;\n \n \tret_code = i40e_aq_set_hmc_resource_profile(hw,\n \t\t\t\t\t\t    I40E_HMC_PROFILE_DEFAULT,\n@@ -772,14 +778,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,\n \t\tgoto asq_send_command_exit;\n \t}\n \n-#ifndef VF_DRIVER\n-\tif (i40e_is_nvm_update_op(desc) && hw->aq.nvm_busy) {\n-\t\ti40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, \"AQTX: NVM busy.\\n\");\n-\t\tstatus = I40E_ERR_NVM;\n-\t\tgoto asq_send_command_exit;\n-\t}\n-\n-#endif\n \tdetails = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use);\n \tif (cmd_details) {\n \t\ti40e_memcpy(details,\n@@ -931,11 +929,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,\n \t\tstatus = I40E_ERR_ADMIN_QUEUE_TIMEOUT;\n \t}\n \n-#ifndef VF_DRIVER\n-\tif (!status && i40e_is_nvm_update_op(desc))\n-\t\thw->aq.nvm_busy = true;\n-\n-#endif /* VF_DRIVER */\n asq_send_command_error:\n \ti40e_release_spinlock(&hw->aq.asq_spinlock);\n asq_send_command_exit:\n@@ -989,9 +982,6 @@ enum i40e_status_code i40e_clean_arq_element(struct i40e_hw *hw,\n \tntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);\n \tif (ntu == ntc) {\n \t\t/* nothing to do - shouldn't need to update ring's values */\n-\t\ti40e_debug(hw,\n-\t\t\t   I40E_DEBUG_AQ_MESSAGE,\n-\t\t\t   \"AQRX: Queue is empty.\\n\");\n \t\tret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK;\n \t\tgoto clean_arq_element_out;\n \t}\n@@ -1055,7 +1045,6 @@ clean_arq_element_out:\n \n #ifndef VF_DRIVER\n \tif (i40e_is_nvm_update_op(&e->desc)) {\n-\t\thw->aq.nvm_busy = false;\n \t\tif (hw->aq.nvm_release_on_done) {\n \t\t\ti40e_release_nvm(hw);\n \t\t\thw->aq.nvm_release_on_done = false;\ndiff --git a/lib/librte_pmd_i40e/i40e/i40e_type.h b/lib/librte_pmd_i40e/i40e/i40e_type.h\nindex 1565095..1eb243c 100644\n--- a/lib/librte_pmd_i40e/i40e/i40e_type.h\n+++ b/lib/librte_pmd_i40e/i40e/i40e_type.h\n@@ -576,6 +576,11 @@ struct i40e_hw {\n \tu32 debug_mask;\n };\n \n+static inline bool i40e_is_vf(struct i40e_hw *hw)\n+{\n+\treturn (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_FPK_VF);\n+}\n+\n struct i40e_driver_version {\n \tu8 major_version;\n \tu8 minor_version;\n@@ -1287,7 +1292,7 @@ struct i40e_hw_port_stats {\n #define I40E_SR_EMP_MODULE_PTR\t\t\t0x0F\n #define I40E_SR_PBA_BLOCK_PTR\t\t\t0x16\n #define I40E_SR_BOOT_CONFIG_PTR\t\t\t0x17\n-#define I40E_SR_NVM_IMAGE_VERSION\t\t0x18\n+#define I40E_SR_NVM_DEV_STARTER_VERSION\t\t0x18\n #define I40E_SR_NVM_WAKE_ON_LAN\t\t\t0x19\n #define I40E_SR_ALTERNATE_SAN_MAC_ADDRESS_PTR\t0x27\n #define I40E_SR_PERMANENT_SAN_MAC_ADDRESS_PTR\t0x28\n",
    "prefixes": [
        "dpdk-dev",
        "09/18"
    ]
}