get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50571,
    "url": "http://patches.dpdk.org/api/patches/50571/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190228055650.25237-13-qi.z.zhang@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": "<20190228055650.25237-13-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190228055650.25237-13-qi.z.zhang@intel.com",
    "date": "2019-02-28T05:56:25",
    "name": "[12/37] net/ice/base: add APIs to alloc/free VLAN resource counter",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "ad2c3c259f05c98d072fada9fd76798d51c1be3e",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190228055650.25237-13-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 3567,
            "url": "http://patches.dpdk.org/api/series/3567/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3567",
            "date": "2019-02-28T05:56:13",
            "name": "share code update.",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3567/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50571/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50571/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 31D0E56A1;\n\tThu, 28 Feb 2019 06:55:29 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 90A1D4C88\n\tfor <dev@dpdk.org>; Thu, 28 Feb 2019 06:55:21 +0100 (CET)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Feb 2019 21:55:21 -0800",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby fmsmga006.fm.intel.com with ESMTP; 27 Feb 2019 21:55:20 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,422,1544515200\"; d=\"scan'208\";a=\"322784294\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "wenzhuo.lu@intel.com,\n\tqiming.yang@intel.com",
        "Cc": "paul.m.stillwell.jr@intel.com, dev@dpdk.org, ferruh.yigit@intel.com,\n\tQi Zhang <qi.z.zhang@intel.com>",
        "Date": "Thu, 28 Feb 2019 13:56:25 +0800",
        "Message-Id": "<20190228055650.25237-13-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20190228055650.25237-1-qi.z.zhang@intel.com>",
        "References": "<20190228055650.25237-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 12/37] net/ice/base: add APIs to alloc/free VLAN\n\tresource counter",
        "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": "1. ice_alloc_res_cntr - allocate resource counter\n2. ice_free_res_cntr - free resource counter\n3. ice_alloc_vlan_res_counter - allocate vlan resource counter\n4. ice_free_vlan_res_counter - free vlan resource counter\n\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_switch.c | 97 +++++++++++++++++++++++++++++++++++++++\n drivers/net/ice/base/ice_switch.h |  6 +++\n 2 files changed, 103 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex c985c1e31..26fc0b46b 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -3238,9 +3238,106 @@ void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle)\n \tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_PROMISC_VLAN);\n }\n \n+/**\n+ * ice_alloc_res_cntr - allocating resource counter\n+ * @hw: pointer to the hardware structure\n+ * @type: type of resource\n+ * @alloc_shared: if set it is shared else dedicated\n+ * @num_items: number of entries requested for FD resource type\n+ * @counter_id: counter index returned by AQ call\n+ */\n+enum ice_status\n+ice_alloc_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,\n+\t\t   u16 *counter_id)\n+{\n+\tstruct ice_aqc_alloc_free_res_elem *buf;\n+\tenum ice_status status;\n+\tu16 buf_len;\n+\n+\t/* Allocate resource */\n+\tbuf_len = sizeof(*buf);\n+\tbuf = (struct ice_aqc_alloc_free_res_elem *)\n+\t\tice_malloc(hw, buf_len);\n+\tif (!buf)\n+\t\treturn ICE_ERR_NO_MEMORY;\n+\n+\tbuf->num_elems = CPU_TO_LE16(num_items);\n+\tbuf->res_type = CPU_TO_LE16(((type << ICE_AQC_RES_TYPE_S) &\n+\t\t\t\t      ICE_AQC_RES_TYPE_M) | alloc_shared);\n+\n+\tstatus = ice_aq_alloc_free_res(hw, 1, buf, buf_len,\n+\t\t\t\t       ice_aqc_opc_alloc_res, NULL);\n+\tif (status)\n+\t\tgoto exit;\n+\n+\t*counter_id = LE16_TO_CPU(buf->elem[0].e.sw_resp);\n+\n+exit:\n+\tice_free(hw, buf);\n+\treturn status;\n+}\n+\n+/**\n+ * ice_free_res_cntr - free resource counter\n+ * @hw: pointer to the hardware structure\n+ * @type: type of resource\n+ * @alloc_shared: if set it is shared else dedicated\n+ * @num_items: number of entries to be freed for FD resource type\n+ * @counter_id: counter ID resource which needs to be freed\n+ */\n+enum ice_status\n+ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,\n+\t\t  u16 counter_id)\n+{\n+\tstruct ice_aqc_alloc_free_res_elem *buf;\n+\tenum ice_status status;\n+\tu16 buf_len;\n \n+\t/* Free resource */\n+\tbuf_len = sizeof(*buf);\n+\tbuf = (struct ice_aqc_alloc_free_res_elem *)\n+\t\tice_malloc(hw, buf_len);\n+\tif (!buf)\n+\t\treturn ICE_ERR_NO_MEMORY;\n \n+\tbuf->num_elems = CPU_TO_LE16(num_items);\n+\tbuf->res_type = CPU_TO_LE16(((type << ICE_AQC_RES_TYPE_S) &\n+\t\t\t\t      ICE_AQC_RES_TYPE_M) | alloc_shared);\n+\tbuf->elem[0].e.sw_resp = CPU_TO_LE16(counter_id);\n \n+\tstatus = ice_aq_alloc_free_res(hw, 1, buf, buf_len,\n+\t\t\t\t       ice_aqc_opc_free_res, NULL);\n+\tif (status)\n+\t\tice_debug(hw, ICE_DBG_SW,\n+\t\t\t  \"counter resource could not be freed\\n\");\n+\n+\tice_free(hw, buf);\n+\treturn status;\n+}\n+\n+/**\n+ * ice_alloc_vlan_res_counter - obtain counter resource for VLAN type\n+ * @hw: pointer to the hardware structure\n+ * @counter_id: returns counter index\n+ */\n+enum ice_status ice_alloc_vlan_res_counter(struct ice_hw *hw, u16 *counter_id)\n+{\n+\treturn ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_VLAN_COUNTER,\n+\t\t\t\t  ICE_AQC_RES_TYPE_FLAG_DEDICATED, 1,\n+\t\t\t\t  counter_id);\n+}\n+\n+/**\n+ * ice_free_vlan_res_counter - Free counter resource for VLAN type\n+ * @hw: pointer to the hardware structure\n+ * @counter_id: counter index to be freed\n+ */\n+enum ice_status ice_free_vlan_res_counter(struct ice_hw *hw, u16 counter_id)\n+{\n+\treturn ice_free_res_cntr(hw, ICE_AQC_RES_TYPE_VLAN_COUNTER,\n+\t\t\t\t ICE_AQC_RES_TYPE_FLAG_DEDICATED, 1,\n+\t\t\t\t counter_id);\n+}\n \n /**\n  * ice_replay_vsi_fltr - Replay filters for requested VSI\ndiff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h\nindex 4b77d920f..364083eb4 100644\n--- a/drivers/net/ice/base/ice_switch.h\n+++ b/drivers/net/ice/base/ice_switch.h\n@@ -338,6 +338,12 @@ enum ice_status\n ice_alloc_vlan_res_counter(struct ice_hw *hw, u16 *counter_id);\n enum ice_status\n ice_free_vlan_res_counter(struct ice_hw *hw, u16 counter_id);\n+enum ice_status\n+ice_alloc_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,\n+\t\t   u16 *counter_id);\n+enum ice_status\n+ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,\n+\t\t  u16 counter_id);\n \n /* Switch/bridge related commands */\n enum ice_status ice_update_sw_rule_bridge_mode(struct ice_hw *hw);\n",
    "prefixes": [
        "12/37"
    ]
}