Show a patch.

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

{
    "id": 324,
    "url": "https://patches.dpdk.org/api/patches/324/",
    "web_url": "https://patches.dpdk.org/patch/324/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1410247299-4365-13-git-send-email-helin.zhang@intel.com>",
    "date": "2014-09-09T07:21:36",
    "name": "[dpdk-dev,12/15] i40e: workaround of get_firmware_version, and enhancements",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0e9d4d94faab0bbf3e5318af83fae99b5033b398",
    "submitter": {
        "id": 14,
        "url": "https://patches.dpdk.org/api/people/14/",
        "name": "Helin Zhang",
        "email": "helin.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/324/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/324/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/324/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,491,1406617200\"; d=\"scan'208\";a=\"588396297\"",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<1410247299-4365-1-git-send-email-helin.zhang@intel.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 12/15] i40e: workaround of get_firmware_version, \n\tand enhancements",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 6645DB3C5;\n\tTue,  9 Sep 2014 09:17:20 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 3BCE4B3BC\n\tfor <dev@dpdk.org>; Tue,  9 Sep 2014 09:17:17 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 09 Sep 2014 00:22:19 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 09 Sep 2014 00:22:17 -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 s897MFWJ008889;\n\tTue, 9 Sep 2014 15:22:15 +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 s897MDgU004510; Tue, 9 Sep 2014 15:22:15 +0800",
            "(from hzhan75@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s897MD2f004505; \n\tTue, 9 Sep 2014 15:22:13 +0800"
        ],
        "To": "dev@dpdk.org",
        "X-Mailer": "git-send-email 1.7.4.1",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Tue,  9 Sep 2014 15:21:36 +0800",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "From": "Helin Zhang <helin.zhang@intel.com>",
        "In-Reply-To": "<1410247299-4365-1-git-send-email-helin.zhang@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<1410247299-4365-13-git-send-email-helin.zhang@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "The workaround helps fix the API if the FW is 4.2 or later.\nIn addition, an unreachable 'break' statement has been removed.\n\nSigned-off-by: Helin Zhang <helin.zhang@intel.com>\nReviewed-by: Chen Jing <jing.d.chen@intel.com>\n---\n lib/librte_pmd_i40e/i40e/i40e_adminq.c |  5 ++---\n lib/librte_pmd_i40e/i40e/i40e_common.c | 12 ++++++++++--\n 2 files changed, 12 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_i40e/i40e/i40e_adminq.c b/lib/librte_pmd_i40e/i40e/i40e_adminq.c\nindex 9b5a294..80da710 100644\n--- a/lib/librte_pmd_i40e/i40e/i40e_adminq.c\n+++ b/lib/librte_pmd_i40e/i40e/i40e_adminq.c\n@@ -879,7 +879,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,\n \t */\n \tif (!details->async && !details->postpone) {\n \t\tu32 total_delay = 0;\n-\t\tu32 delay_len = 1;\n \n \t\tdo {\n \t\t\t/* AQ designers suggest use of head for better\n@@ -888,8 +887,8 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,\n \t\t\tif (i40e_asq_done(hw))\n \t\t\t\tbreak;\n \t\t\t/* ugh! delay while spin_lock */\n-\t\t\ti40e_msec_delay(delay_len);\n-\t\t\ttotal_delay += delay_len;\n+\t\t\ti40e_msec_delay(1);\n+\t\t\ttotal_delay++;\n \t\t} while (total_delay < hw->aq.asq_cmd_timeout);\n \t}\n \ndiff --git a/lib/librte_pmd_i40e/i40e/i40e_common.c b/lib/librte_pmd_i40e/i40e/i40e_common.c\nindex d901c8d..60ca943 100644\n--- a/lib/librte_pmd_i40e/i40e/i40e_common.c\n+++ b/lib/librte_pmd_i40e/i40e/i40e_common.c\n@@ -571,7 +571,6 @@ enum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw)\n \t\tbreak;\n \tdefault:\n \t\treturn I40E_ERR_DEVICE_NOT_SUPPORTED;\n-\t\tbreak;\n \t}\n \n \thw->phy.get_link_info = true;\n@@ -872,6 +871,7 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw)\n \n \ti40e_clear_pxe_mode(hw);\n \n+\n \treturn I40E_SUCCESS;\n }\n \n@@ -1946,6 +1946,14 @@ enum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,\n \t\t\t*api_major_version = LE16_TO_CPU(resp->api_major);\n \t\tif (api_minor_version != NULL)\n \t\t\t*api_minor_version = LE16_TO_CPU(resp->api_minor);\n+\n+\t\t/* A workaround to fix the API version in SW */\n+\t\tif (api_major_version && api_minor_version &&\n+\t\t    fw_major_version && fw_minor_version &&\n+\t\t    ((*api_major_version == 1) && (*api_minor_version == 1)) &&\n+\t\t    (((*fw_major_version == 4) && (*fw_minor_version >= 2)) ||\n+\t\t     (*fw_major_version > 4)))\n+\t\t\t*api_minor_version = 2;\n \t}\n \n \treturn status;\n@@ -4713,6 +4721,7 @@ enum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n {\n \tstruct i40e_aq_desc desc;\n+\tstruct i40e_asq_cmd_details details;\n \tenum i40e_status_code status;\n \n \ti40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_send_msg_to_pf);\n@@ -4727,7 +4736,6 @@ enum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw,\n \t\tdesc.datalen = CPU_TO_LE16(msglen);\n \t}\n \tif (!cmd_details) {\n-\t\tstruct i40e_asq_cmd_details details;\n \t\ti40e_memset(&details, 0, sizeof(details), I40E_NONDMA_MEM);\n \t\tdetails.async = true;\n \t\tcmd_details = &details;\n",
    "prefixes": [
        "dpdk-dev",
        "12/15"
    ]
}