get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41904,
    "url": "http://patchwork.dpdk.org/api/patches/41904/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180629015508.26599-5-dg@adax.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": "<20180629015508.26599-5-dg@adax.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180629015508.26599-5-dg@adax.com",
    "date": "2018-06-29T01:55:02",
    "name": "[v2,04/10] kni: add rte_kni_free to KNI library",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "92692ed296001005e1fc08cc8d22ce680b5f4f5e",
    "submitter": {
        "id": 1040,
        "url": "http://patchwork.dpdk.org/api/people/1040/?format=api",
        "name": "Dan Gora",
        "email": "dg@adax.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180629015508.26599-5-dg@adax.com/mbox/",
    "series": [
        {
            "id": 305,
            "url": "http://patchwork.dpdk.org/api/series/305/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=305",
            "date": "2018-06-29T01:54:59",
            "name": "[v2,01/10] kni: remove unused variables from struct kni_dev",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/305/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/41904/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/41904/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 C698D1B554;\n\tFri, 29 Jun 2018 03:56:00 +0200 (CEST)",
            "from mail-oi0-f65.google.com (mail-oi0-f65.google.com\n\t[209.85.218.65]) by dpdk.org (Postfix) with ESMTP id D90F71B547\n\tfor <dev@dpdk.org>; Fri, 29 Jun 2018 03:55:53 +0200 (CEST)",
            "by mail-oi0-f65.google.com with SMTP id y207-v6so7023675oie.13\n\tfor <dev@dpdk.org>; Thu, 28 Jun 2018 18:55:53 -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\tn3-v6sm3941288otk.38.2018.06.28.18.55.51\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 28 Jun 2018 18:55:52 -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:in-reply-to:references;\n\tbh=djh6S5mwETgXxisTt962bYrDK6hsNfq1oEedVn8n42k=;\n\tb=Ka7fMH//SLn057O89CkrHjB2NegL3j09B/tMHS0Pe7+uxHnOXCqr95BgG3OshdCHVM\n\tw2Sle/QCU9MHDU+QDrtO3tU0HeNGthko6whc2LuFbeM6PMdBcu4S2QoMOkiTaSKngh6/\n\tt60U8UL68vdz944CMC5RhRCUZkJiWA33D4ICwkaCtlrvzZdLB5Nilqkks2J7ORveFc3f\n\t/gHiKXZ3l9AtoWDxNiOTUYd5lauKM6LHhZ0IpSG5wVhzL1xuTXcLNNrwFWdWlnEEUXT8\n\tx8kKGm7s798M3mbqegBKZykZawHrAb3c8gqgVlvUzbUXaKhelQwovTyZjT0WAg9lnZJl\n\taEig==",
        "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\t:in-reply-to:references;\n\tbh=djh6S5mwETgXxisTt962bYrDK6hsNfq1oEedVn8n42k=;\n\tb=QBcUIlsCWcSVy2ICzWAMQ6NnemrFOU0AWh6eT8wOAVEBmrRQVO23F6okpA/m+suPCJ\n\tP9W/CJzjms6x96FO7QANxbVleSq0ups6W+240gKjXlT4NlopqCX16TnzanoHdcq4Qg14\n\tKyqxV+ipDaaHI3qDkmqF5bfuOTiLSVEn0hxDToE4vY1BVl2zdqGHup9n1qVllPn5yvIw\n\tUOzGF76N3K1m+LwMaXvfuQkB63iX2RxfwCdSn9Z3spVH/RX8p0o0b9yiNpzorTJDgQvO\n\tufnpgQRiR91dbREyYzbuTa/DiYL5ZeHMHSAPADAyWq8M0/PFcec21PoiyxP+VeuG8xnc\n\tHyGg==",
        "X-Gm-Message-State": "APt69E0wIQVhrpnmyyoygCjnGrsVybqMtkGHEw3GoAu905kzepirf4gT\n\thI7v4C/PicojIVwA5Tgh2/uuYQ==",
        "X-Google-Smtp-Source": "AAOMgpeQx+Sg82B5guPaI7alE2OtxZh3S6TaE9d4EjN4fjUvfmXAXg2X7WOAcYih0bbzqNPY6by9Ow==",
        "X-Received": "by 2002:aca:bdc1:: with SMTP id\n\tn184-v6mr6727047oif.305.1530237353076; \n\tThu, 28 Jun 2018 18:55:53 -0700 (PDT)",
        "From": "Dan Gora <dg@adax.com>",
        "To": "ferruh.yigit@intel.com",
        "Cc": "dev@dpdk.org,\n\tDan Gora <dg@adax.com>",
        "Date": "Thu, 28 Jun 2018 18:55:02 -0700",
        "Message-Id": "<20180629015508.26599-5-dg@adax.com>",
        "X-Mailer": "git-send-email 2.18.0.rc1.1.g6f333ff2f",
        "In-Reply-To": "<20180629015508.26599-1-dg@adax.com>",
        "References": "<20180628224513.18391-1-dg@adax.com>\n\t<20180629015508.26599-1-dg@adax.com>",
        "Subject": "[dpdk-dev] [PATCH v2 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": [
        "v2",
        "04/10"
    ]
}