get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 62880,
    "url": "http://patches.dpdk.org/api/patches/62880/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191112035011.67537-2-shougangx.wang@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": "<20191112035011.67537-2-shougangx.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191112035011.67537-2-shougangx.wang@intel.com",
    "date": "2019-11-12T03:50:08",
    "name": "[v4,1/4] net/ice: fix memzone reserve and release in FDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "660a5b90be6a77530aee32a6a5d3b6c180a6b4a1",
    "submitter": {
        "id": 1418,
        "url": "http://patches.dpdk.org/api/people/1418/?format=api",
        "name": "Shougang Wang",
        "email": "shougangx.wang@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191112035011.67537-2-shougangx.wang@intel.com/mbox/",
    "series": [
        {
            "id": 7409,
            "url": "http://patches.dpdk.org/api/series/7409/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7409",
            "date": "2019-11-12T03:50:07",
            "name": "net/ice: fix memory release in FDIR",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/7409/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/62880/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/62880/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 14F14A04AB;\n\tTue, 12 Nov 2019 11:09:22 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 23E732BAE;\n\tTue, 12 Nov 2019 11:09:19 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id C22E12BA2\n for <dev@dpdk.org>; Tue, 12 Nov 2019 11:09:16 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 12 Nov 2019 02:09:16 -0800",
            "from intel.sh.intel.com ([10.239.255.146])\n by fmsmga001.fm.intel.com with ESMTP; 12 Nov 2019 02:09:14 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.68,295,1569308400\"; d=\"scan'208\";a=\"214048328\"",
        "From": "Wang ShougangX <shougangx.wang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, qi.z.zhang@intel.com,\n Wang ShougangX <shougangx.wang@intel.com>",
        "Date": "Tue, 12 Nov 2019 03:50:08 +0000",
        "Message-Id": "<20191112035011.67537-2-shougangx.wang@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191112035011.67537-1-shougangx.wang@intel.com>",
        "References": "<20191105033806.2878-1-shougangx.wang@intel.com>\n <20191112035011.67537-1-shougangx.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 1/4] net/ice: fix memzone reserve and release\n\tin FDIR",
        "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": "To avoid memzone reserve failure and memory leak, following\nresources management should be added.\n- Check if the FDIR Memzone already exists before reserving.\n- Free FDIR memzone when teardown and other failure scenarios.\n\nFixes: 84dc7a95a2d3 (\"net/ice: enable flow director engine\")\n\nSigned-off-by: Wang ShougangX <shougangx.wang@intel.com>\nAcked-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/ice_ethdev.h      |  1 +\n drivers/net/ice/ice_fdir_filter.c | 19 ++++++++++++++++++-\n 2 files changed, 19 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex c55713cc1..d4ab18436 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -334,6 +334,7 @@ struct ice_fdir_info {\n \tstruct ice_rx_queue *rxq;\n \tvoid *prg_pkt;                 /* memory for fdir program packet */\n \tuint64_t dma_addr;             /* physic address of packet memory*/\n+\tconst struct rte_memzone *mz;\n \tstruct ice_fdir_filter_conf conf;\n \n \tstruct ice_fdir_filter_conf **hash_map;\ndiff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex afab5af7f..a89c506c0 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -127,6 +127,12 @@ static struct ice_flow_parser ice_fdir_parser_comms;\n static const struct rte_memzone *\n ice_memzone_reserve(const char *name, uint32_t len, int socket_id)\n {\n+\tconst struct rte_memzone *mz;\n+\n+\tmz = rte_memzone_lookup(name);\n+\tif (mz)\n+\t\treturn mz;\n+\n \treturn rte_memzone_reserve_aligned(name, len, socket_id,\n \t\t\t\t\t   RTE_MEMZONE_IOVA_CONTIG,\n \t\t\t\t\t   ICE_RING_BASE_ALIGN);\n@@ -481,19 +487,23 @@ ice_fdir_setup(struct ice_pf *pf)\n \t}\n \tpf->fdir.prg_pkt = mz->addr;\n \tpf->fdir.dma_addr = mz->iova;\n+\tpf->fdir.mz = mz;\n \n \terr = ice_fdir_prof_alloc(hw);\n \tif (err) {\n \t\tPMD_DRV_LOG(ERR, \"Cannot allocate memory for \"\n \t\t\t    \"flow director profile.\");\n \t\terr = -ENOMEM;\n-\t\tgoto fail_mem;\n+\t\tgoto fail_prof;\n \t}\n \n \tPMD_DRV_LOG(INFO, \"FDIR setup successfully, with programming queue %u.\",\n \t\t    vsi->base_queue);\n \treturn ICE_SUCCESS;\n \n+fail_prof:\n+\trte_memzone_free(pf->fdir.mz);\n+\tpf->fdir.mz = NULL;\n fail_mem:\n \tice_rx_queue_release(pf->fdir.rxq);\n \tpf->fdir.rxq = NULL;\n@@ -607,6 +617,13 @@ ice_fdir_teardown(struct ice_pf *pf)\n \tice_fdir_prof_free(hw);\n \tice_release_vsi(vsi);\n \tpf->fdir.fdir_vsi = NULL;\n+\n+\tif (pf->fdir.mz) {\n+\t\terr = rte_memzone_free(pf->fdir.mz);\n+\t\tpf->fdir.mz = NULL;\n+\t\tif (err)\n+\t\t\tPMD_DRV_LOG(ERR, \"Failed to free FDIR memezone.\");\n+\t}\n }\n \n static int\n",
    "prefixes": [
        "v4",
        "1/4"
    ]
}