get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45399,
    "url": "http://patches.dpdk.org/api/patches/45399/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180926130854.122474-6-jasvinder.singh@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": "<20180926130854.122474-6-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180926130854.122474-6-jasvinder.singh@intel.com",
    "date": "2018-09-26T13:08:49",
    "name": "[v5,05/10] net/softnic: destroy meter object",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ea359643952f84b1f302cd06256d2b714b22e434",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "http://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180926130854.122474-6-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 1517,
            "url": "http://patches.dpdk.org/api/series/1517/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1517",
            "date": "2018-09-26T13:08:44",
            "name": "net/softnic: implement metering and policing API",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/1517/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/45399/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/45399/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 255541B13E;\n\tWed, 26 Sep 2018 15:09:15 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 9EC285A6A\n\tfor <dev@dpdk.org>; Wed, 26 Sep 2018 15:09:01 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Sep 2018 06:09:01 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.222.149])\n\tby orsmga001.jf.intel.com with ESMTP; 26 Sep 2018 06:08:59 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,306,1534834800\"; d=\"scan'208\";a=\"93875432\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com",
        "Date": "Wed, 26 Sep 2018 14:08:49 +0100",
        "Message-Id": "<20180926130854.122474-6-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20180926130854.122474-1-jasvinder.singh@intel.com>",
        "References": "<20180918165835.107593-2-jasvinder.singh@intel.com>\n\t<20180926130854.122474-1-jasvinder.singh@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 05/10] net/softnic: destroy meter object",
        "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": "Implement meter object destroy function.\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\n---\n drivers/net/softnic/rte_eth_softnic_meter.c | 49 ++++++++++++++++++++-\n 1 file changed, 48 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c\nindex 12dd79cfc..5103bdadc 100644\n--- a/drivers/net/softnic/rte_eth_softnic_meter.c\n+++ b/drivers/net/softnic/rte_eth_softnic_meter.c\n@@ -285,6 +285,53 @@ pmd_mtr_create(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+/* MTR object destroy */\n+static int\n+pmd_mtr_destroy(struct rte_eth_dev *dev,\n+\tuint32_t mtr_id,\n+\tstruct rte_mtr_error *error)\n+{\n+\tstruct pmd_internals *p = dev->data->dev_private;\n+\tstruct softnic_mtr_list *ml = &p->mtr.mtrs;\n+\tstruct softnic_mtr_meter_profile *mp;\n+\tstruct softnic_mtr *m;\n+\n+\t/* MTR object must exist */\n+\tm = softnic_mtr_find(p, mtr_id);\n+\tif (m == NULL)\n+\t\treturn -rte_mtr_error_set(error,\n+\t\t\tEEXIST,\n+\t\t\tRTE_MTR_ERROR_TYPE_MTR_ID,\n+\t\t\tNULL,\n+\t\t\t\"MTR object id not valid\");\n+\n+\t/* MTR object must not have any owner */\n+\tif (m->flow != NULL)\n+\t\treturn -rte_mtr_error_set(error,\n+\t\t\tEINVAL,\n+\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n+\t\t\tNULL,\n+\t\t\t\"MTR object is being used\");\n+\n+\t/* Get meter profile */\n+\tmp = softnic_mtr_meter_profile_find(p, m->params.meter_profile_id);\n+\tif (mp == NULL)\n+\t\treturn -rte_mtr_error_set(error,\n+\t\t\tEINVAL,\n+\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n+\t\t\tNULL,\n+\t\t\t\"MTR object meter profile invalid\");\n+\n+\t/* Update dependencies */\n+\tmp->n_users--;\n+\n+\t/* Remove from list */\n+\tTAILQ_REMOVE(ml, m, node);\n+\tfree(m);\n+\n+\treturn 0;\n+}\n+\n const struct rte_mtr_ops pmd_mtr_ops = {\n \t.capabilities_get = NULL,\n \n@@ -292,7 +339,7 @@ const struct rte_mtr_ops pmd_mtr_ops = {\n \t.meter_profile_delete = pmd_mtr_meter_profile_delete,\n \n \t.create = pmd_mtr_create,\n-\t.destroy = NULL,\n+\t.destroy = pmd_mtr_destroy,\n \t.meter_enable = NULL,\n \t.meter_disable = NULL,\n \n",
    "prefixes": [
        "v5",
        "05/10"
    ]
}