get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 71241,
    "url": "http://patchwork.dpdk.org/api/patches/71241/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200611084330.18301-3-qi.z.zhang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200611084330.18301-3-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200611084330.18301-3-qi.z.zhang@intel.com",
    "date": "2020-06-11T08:43:22",
    "name": "[02/10] net/ice/base: refactor to avoid need to retry",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f6aecaa9c82eaebd4dd25d94f7f116d037ae40ba",
    "submitter": {
        "id": 504,
        "url": "http://patchwork.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patchwork.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200611084330.18301-3-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 10404,
            "url": "http://patchwork.dpdk.org/api/series/10404/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10404",
            "date": "2020-06-11T08:43:20",
            "name": "net/ice: base code update for 20.08 batch 2",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/10404/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/71241/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/71241/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 60269A00C5;\n\tThu, 11 Jun 2020 10:39:54 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BA21B1B951;\n\tThu, 11 Jun 2020 10:39:40 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id 46E745B3C\n for <dev@dpdk.org>; Thu, 11 Jun 2020 10:39:37 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Jun 2020 01:39:37 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.82])\n by orsmga004.jf.intel.com with ESMTP; 11 Jun 2020 01:39:35 -0700"
        ],
        "IronPort-SDR": [
            "\n aYf3/YmCHxopTc8yss89B2Lfquhsb8vGQS5RwGamZlLmCQVRMG3nmHQh4CBBw6gH2gbZGcJ6Ys\n UQ3Hd8Axcx9w==",
            "\n /ee0tWQS3xabViIlfRZATsJNFSxux9lXr0cCdIJJ8DOVnWPuyjYPyJ+c5ueEDeqhcADWTIpDPh\n 8POiXNzlVyhw=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,499,1583222400\"; d=\"scan'208\";a=\"419039136\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang <qi.z.zhang@intel.com>,\n Jacob Keller <jacob.e.keller@intel.com>,\n Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Thu, 11 Jun 2020 16:43:22 +0800",
        "Message-Id": "<20200611084330.18301-3-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20200611084330.18301-1-qi.z.zhang@intel.com>",
        "References": "<20200611084330.18301-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 02/10] net/ice/base: refactor to avoid need to\n\tretry",
        "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": "The ice_discover_caps function is used to read the device and function\ncapabilities, updating the hardware capabilities structures with\nrelevant data.\n\nThe exact number of capabilities returned by the hardware is unknown\nahead of time. The AdminQ command will report the total number of\ncapabilities in the return buffer.\n\nThe current implementation involves requesting capabilities once,\nreading this returned size, and then re-requested with that size.\n\nThis isn't really necessary. The firmware interface has a maximum size\nof ICE_AQ_MAX_BUF_LEN. Firmware can never return more than\nICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem) capabilities.\n\nAvoid the retry loop by simply allocating a buffer of size\nICE_AQ_MAX_BUF_LEN. This is significantly simpler than retrying. The\nextra allocation isn't a big deal, as it will be released after we\nfinish parsing the capabilities.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_common.c | 43 +++++++++++----------------------------\n 1 file changed, 12 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex 2c822d7d4..85b6e1a37 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -2054,40 +2054,21 @@ ice_discover_caps(struct ice_hw *hw, enum ice_adminq_opc opc)\n {\n \tenum ice_status status;\n \tu32 cap_count;\n-\tu16 cbuf_len;\n-\tu8 retries;\n-\n-\t/* The driver doesn't know how many capabilities the device will return\n-\t * so the buffer size required isn't known ahead of time. The driver\n-\t * starts with cbuf_len and if this turns out to be insufficient, the\n-\t * device returns ICE_AQ_RC_ENOMEM and also the cap_count it needs.\n-\t * The driver then allocates the buffer based on the count and retries\n-\t * the operation. So it follows that the retry count is 2.\n-\t */\n-#define ICE_GET_CAP_BUF_COUNT\t40\n-#define ICE_GET_CAP_RETRY_COUNT\t2\n-\n-\tcap_count = ICE_GET_CAP_BUF_COUNT;\n-\tretries = ICE_GET_CAP_RETRY_COUNT;\n-\n-\tdo {\n-\t\tvoid *cbuf;\n-\n-\t\tcbuf_len = (u16)(cap_count *\n-\t\t\t\t sizeof(struct ice_aqc_list_caps_elem));\n-\t\tcbuf = ice_malloc(hw, cbuf_len);\n-\t\tif (!cbuf)\n-\t\t\treturn ICE_ERR_NO_MEMORY;\n+\tvoid *cbuf;\n \n-\t\tstatus = ice_aq_discover_caps(hw, cbuf, cbuf_len, &cap_count,\n-\t\t\t\t\t      opc, NULL);\n-\t\tice_free(hw, cbuf);\n+\tcbuf = ice_malloc(hw, ICE_AQ_MAX_BUF_LEN);\n+\tif (!cbuf)\n+\t\treturn ICE_ERR_NO_MEMORY;\n \n-\t\tif (!status || hw->adminq.sq_last_status != ICE_AQ_RC_ENOMEM)\n-\t\t\tbreak;\n+\t/* Although the driver doesn't know the number of capabilities the\n+\t * device will return, we can simply send a 4KB buffer, the maximum\n+\t * possible size that firmware can return.\n+\t */\n+\tcap_count = ICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem);\n \n-\t\t/* If ENOMEM is returned, try again with bigger buffer */\n-\t} while (--retries);\n+\tstatus = ice_aq_discover_caps(hw, cbuf, ICE_AQ_MAX_BUF_LEN, &cap_count,\n+\t\t\t\t      opc, NULL);\n+\tice_free(hw, cbuf);\n \n \treturn status;\n }\n",
    "prefixes": [
        "02/10"
    ]
}