get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41891,
    "url": "https://patches.dpdk.org/api/patches/41891/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180628225154.20556-1-dg@adax.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20180628225154.20556-1-dg@adax.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180628225154.20556-1-dg@adax.com",
    "date": "2018-06-28T22:51:54",
    "name": "[04/10] kni: add rte_kni_free to KNI library",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "92692ed296001005e1fc08cc8d22ce680b5f4f5e",
    "submitter": {
        "id": 1040,
        "url": "https://patches.dpdk.org/api/people/1040/?format=api",
        "name": "Dan Gora",
        "email": "dg@adax.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180628225154.20556-1-dg@adax.com/mbox/",
    "series": [
        {
            "id": 301,
            "url": "https://patches.dpdk.org/api/series/301/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=301",
            "date": "2018-06-28T22:45:13",
            "name": "kni: Interface detach and link status fixes.",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/301/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/41891/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/41891/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 7A1DD1B063;\n\tFri, 29 Jun 2018 00:52:07 +0200 (CEST)",
            "from mail-ot0-f195.google.com (mail-ot0-f195.google.com\n\t[74.125.82.195]) by dpdk.org (Postfix) with ESMTP id 760741B063\n\tfor <dev@dpdk.org>; Fri, 29 Jun 2018 00:52:05 +0200 (CEST)",
            "by mail-ot0-f195.google.com with SMTP id f17-v6so7958198otl.7\n\tfor <dev@dpdk.org>; Thu, 28 Jun 2018 15:52:05 -0700 (PDT)",
            "from linux.adax.com (172-11-198-60.lightspeed.sntcca.sbcglobal.net.\n\t[172.11.198.60]) by smtp.gmail.com with ESMTPSA id\n\t78-v6sm4162457oii.0.2018.06.28.15.52.03\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 28 Jun 2018 15:52:03 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id;\n\tbh=djh6S5mwETgXxisTt962bYrDK6hsNfq1oEedVn8n42k=;\n\tb=Rd50dxHesmnv0zRxm1Tcll0LsP2GhAMpvQVS6TqUZCIpK1FXKc6FLqbKybaLsKwN4l\n\tV5tBOXKY7pWQR2GlmpvkOtoU2+LHp6gmMpClZCbxh9+B/WU6nXnXj7suDV+6nkOnL3Dc\n\tk9gC4pxPGIJmSxwOSGFwTY6NDIfhFXLekIbhjnlkEAWzTFegX+DToXmarNVzjeSVKu35\n\tjmdnsnBtvTlRKUHILr7Xb6Y+/RVtSMq7Yo0c8klPWyEGZjhq82/eJ4gDpp9EmsxRwVgx\n\tSvudnVYfB6rME+8EsOEvLFSR8OZEu7qEO7AtSwHNS2jhk/4pgAvb5FrFINfgKkIv8pF/\n\t7ioA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id;\n\tbh=djh6S5mwETgXxisTt962bYrDK6hsNfq1oEedVn8n42k=;\n\tb=aAN9B9tR6Im6SAjMuszUY5VlxlFq20YBNRzZe3uYIMXXfg7s0pcTxJbgSg34sqGn+d\n\tB4E16qCViLSsjY/usVavbDMncnWtPGd2JcqDgfxckOwmDzJzwiPcfFspCBasArNoO+i/\n\txVfoaeg/xJQhBZXDdBiMJZX1tvbv8kMUnanwo6p4GvxqtYUkJCjD9DKrXjRKmAOj/BJm\n\tHKtbkEvADOrBzInM/2GeIn0QXJwj259pl9Ow2JdYaXwuQs17AXMN+i+8DNbz6PFOrpPi\n\t6nhXo/YzaTCwD5ULQBO5KUNtL9zOyUb881VvbrQQvgZ5kIXUEHR5uV3vPNWlMHnofTrA\n\thaJQ==",
        "X-Gm-Message-State": "APt69E3mRYSyIMkKhtQnXxMySwuYbg2deMKe3xgCL/lk3TUDl7cX/Rqe\n\thzrMJhlavg5bVVZU8DEzFsY=",
        "X-Google-Smtp-Source": "AAOMgpce3cC13VboG7sxgxQvxHx7koRmjsEz8bdvplppLK3n9ctiwPgjtXW1sbrrSkT1lZaD3ul8ug==",
        "X-Received": "by 2002:a9d:3ba1:: with SMTP id\n\tk30-v6mr7649009otc.211.1530226324676; \n\tThu, 28 Jun 2018 15:52:04 -0700 (PDT)",
        "From": "Dan Gora <dg@adax.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org,\n\tDan Gora <dg@adax.com>",
        "Date": "Thu, 28 Jun 2018 15:51:54 -0700",
        "Message-Id": "<20180628225154.20556-1-dg@adax.com>",
        "X-Mailer": "git-send-email 2.18.0.rc1.1.g6f333ff2f",
        "Subject": "[dpdk-dev] [PATCH 04/10] kni: add rte_kni_free to KNI library",
        "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": "Add the new rte_kni_free() API function to the KNI library.\n\nThis function will be called by DPDK applications after\nrte_kni_release() to free the KNI interface resources from the\nkernel driver.\n\nSigned-off-by: Dan Gora <dg@adax.com>\n---\n lib/librte_kni/rte_kni.c | 32 +++++++++++++++++++++++++++++---\n lib/librte_kni/rte_kni.h | 31 +++++++++++++++++++++++++++----\n 2 files changed, 56 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c\nindex 8a8f6c1cc..1d84c0b70 100644\n--- a/lib/librte_kni/rte_kni.c\n+++ b/lib/librte_kni/rte_kni.c\n@@ -463,8 +463,6 @@ int\n rte_kni_release(struct rte_kni *kni)\n {\n \tstruct rte_kni_device_info dev_info;\n-\tuint32_t slot_id;\n-\tuint32_t retry = 5;\n \n \tif (!kni || !kni->in_use)\n \t\treturn -1;\n@@ -475,6 +473,34 @@ rte_kni_release(struct rte_kni *kni)\n \t\treturn -1;\n \t}\n \n+\tkni->in_use = 0;\n+\treturn 0;\n+}\n+\n+int\n+rte_kni_free(struct rte_kni *kni)\n+{\n+\tuint32_t slot_id;\n+\tuint32_t retry = 5;\n+\tstruct rte_kni_device_info dev_info;\n+\n+\tif (!kni)\n+\t\treturn -EINVAL;\n+\n+\t/* Must call rte_kni_release() first */\n+\tif (kni->in_use)\n+\t\treturn -EBUSY;\n+\n+\t/*\n+\t * Free the FIFOs in the kernel and remove it from the list\n+\t * of devices to poll\n+\t */\n+\tsnprintf(dev_info.name, sizeof(dev_info.name), \"%s\", kni->name);\n+\tif (ioctl(kni_fd, RTE_KNI_IOCTL_FREE, &dev_info) < 0) {\n+\t\tRTE_LOG(ERR, KNI, \"Fail to release kni device\\n\");\n+\t\treturn -1;\n+\t}\n+\n \t/* mbufs in all fifo should be released, except request/response */\n \n \t/* wait until all rxq packets processed by kernel */\n@@ -497,7 +523,7 @@ rte_kni_release(struct rte_kni *kni)\n \tif (slot_id > kni_memzone_pool.max_ifaces) {\n \t\tRTE_LOG(ERR, KNI, \"KNI pool: corrupted slot ID: %d, max: %d\\n\",\n \t\t\tslot_id, kni_memzone_pool.max_ifaces);\n-\t\treturn -1;\n+\t\treturn -EINVAL;\n \t}\n \tkni_memzone_pool_release(&kni_memzone_pool.slots[slot_id]);\n \ndiff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h\nindex 99055e2c2..d1a95f898 100644\n--- a/lib/librte_kni/rte_kni.h\n+++ b/lib/librte_kni/rte_kni.h\n@@ -112,11 +112,17 @@ struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool,\n \t\tconst struct rte_kni_conf *conf, struct rte_kni_ops *ops);\n \n /**\n- * Release KNI interface according to the context. It will also release the\n- * paired KNI interface in kernel space. All processing on the specific KNI\n- * context need to be stopped before calling this interface.\n+ * Release specified KNI interface. This will stop data transfer to and from\n+ * this interface and will remove the paired KNI interface in kernel space.\n  *\n- * rte_kni_release is thread safe.\n+ * @note This function will trigger the kernel to remove the interface, which\n+ * may trigger the RTE_KNI_REQ_CFG_NETWORK_IF KNI callback. This function will\n+ * block until this callback is handled or times out. The user should ensure\n+ * that rte_kni_handle_request() is called for this interface in a separate\n+ * thread to handle this callback to avoid this delay.\n+ *\n+ * rte_kni_release() is thread safe, but should not be called from the same\n+ * thread as rte_kni_handle_request().\n  *\n  * @param kni\n  *  The pointer to the context of an existent KNI interface.\n@@ -127,6 +133,23 @@ struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool,\n  */\n int rte_kni_release(struct rte_kni *kni);\n \n+/**\n+ * Free specified KNI interface. It will also free the KNI interface resources\n+ * in kernel space. No KNI functions for this interface should be called after\n+ * or at the same time as calling this function. rte_kni_release() must be\n+ * called before this function to release the kernel interface.\n+ *\n+ * @param kni\n+ *  The pointer to the context of an existent KNI interface.\n+ *\n+ * @return\n+ *  - 0 indicates success.\n+ *  - -EINVAL: Invalid kni structure.\n+ *  - -EBUSY: KNI interface still in use.  Must call rte_kni_release().\n+ */\n+int __rte_experimental\n+rte_kni_free(struct rte_kni *kni);\n+\n /**\n  * It is used to handle the request mbufs sent from kernel space.\n  * Then analyzes it and calls the specific actions for the specific requests.\n",
    "prefixes": [
        "04/10"
    ]
}