get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41903,
    "url": "http://patchwork.dpdk.org/api/patches/41903/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180629015508.26599-4-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-4-dg@adax.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180629015508.26599-4-dg@adax.com",
    "date": "2018-06-29T01:55:01",
    "name": "[v2,03/10] kni: don't touch struct kni_dev after freeing",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "95d3767a8c6d1bf19607b2ba339938b776380a5a",
    "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-4-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/41903/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/41903/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 167261B54D;\n\tFri, 29 Jun 2018 03:55:56 +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 7402A1B532\n\tfor <dev@dpdk.org>; Fri, 29 Jun 2018 03:55:52 +0200 (CEST)",
            "by mail-oi0-f65.google.com with SMTP id k81-v6so7044861oib.4\n\tfor <dev@dpdk.org>; Thu, 28 Jun 2018 18:55:52 -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.50\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 28 Jun 2018 18:55:50 -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=fGC1/toUFvY8asYAO6HL+f7p7INZeOaqNCTBQH8reiw=;\n\tb=WBLo+UUeLp65fwHeCzu+NwE3buAJJzDkHhVFJLqE57AMDX3OXutBmsxJa9drUsHLNv\n\t530csrwr81LfDeodVP2ryXaHHb/X+vrGhOXfT5gqU2RUEZuMU5JUSOFasIF8aAvRI+Ef\n\tXa28BXT1J1GO6nr1HcaHbSejHDmFOKCTHzEz++Y1DVY5ys6TPwFNR3R3ZcqyR5iYb5t+\n\tIlrsyiit5dH/01sXgNb8nHBPcJ2/Oxr+5aDC0oFK0NNbpnJ6O59vkFzqU1Usm2nWlrXH\n\tlWujXR09zm9olBqgNlQMwYwA3EIWP3euB8KwYsjlYH/vz10X0y20Yn9Ov91/kJjG8xX0\n\t8Z8A==",
        "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=fGC1/toUFvY8asYAO6HL+f7p7INZeOaqNCTBQH8reiw=;\n\tb=VlfCtBlXtscNvOmDKFvWuvL9tw5w2CPUJIzVw8K1mjfEdL2v3gW7R/cghVNCfYEynv\n\tB4giW1sBAx8xwov9uMh/iqwhr35z/yWe6h/5n0M0y/LMQottyTHGbqJnTuhibckZyNj/\n\tM3YiDVRv0r3uMVzq2rrFQ3vVxsEMZ6/kEMuRJDBgDAMu5aJ+QBMAeswa8evlAGgoaXw6\n\tyEQ/97ZSUc4mLZXMWfxUKc6CLyKyb82jYNISqTXec0dm5b8qQSKlM0c4wZafGl9gSxAy\n\tr5+4qfASiJcU56c4MCsE6IML+KEaMvizDG24RbmHEWei7xJkhLjfvdiU9A9hJJSyUU3A\n\tdrXA==",
        "X-Gm-Message-State": "APt69E0dDgujYwcNflouwrgX7x3ZH5jFI0qh16C+F3dL9QOoYy8GG/BI\n\tX01f140mJI+H8X3XMnJbOZw=",
        "X-Google-Smtp-Source": "AAOMgpdXfWCpxXMq7VvmXL+m8/X+4ORonQE9NTT+FGe2afbwu/dSrz6LDDlLX6dIM2UAxe6Y0Zug8Q==",
        "X-Received": "by 2002:aca:a93:: with SMTP id\n\tk19-v6mr7492877oiy.83.1530237351653; \n\tThu, 28 Jun 2018 18:55:51 -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:01 -0700",
        "Message-Id": "<20180629015508.26599-4-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 03/10] kni: don't touch struct kni_dev after\n\tfreeing",
        "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": "Since the struct kni_dev is allocated as part of the netdev with\nalloc_netdev, when free_netdev is called, this also frees the struct\nkni_dev embedded in it.\n\nThis means that we cannot touch struct kni_dev after calling\nfree_netdev since that memory was already deallocated.\n\nSeparate unregistering the net_dev with unregister_netdev from freeing\nthe net_device and kni_dev structures into separate functions and\nensure that we do not touch anything in the kni_dev structure after\nfreeing it (ie don't call list_del(), etc...).\n\nSigned-off-by: Dan Gora <dg@adax.com>\n---\n kernel/linux/kni/kni_dev.h  |  1 +\n kernel/linux/kni/kni_misc.c | 28 +++++++++++++++++++++++++---\n 2 files changed, 26 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h\nindex ed42989cc..f9aa90ff9 100644\n--- a/kernel/linux/kni/kni_dev.h\n+++ b/kernel/linux/kni/kni_dev.h\n@@ -37,6 +37,7 @@ struct kni_dev {\n \tstruct list_head list;\n \n \tstruct net_device_stats stats;\n+\tuint16_t registered;         /* 0 if already released, 1 otherwise */\n \tuint16_t group_id;           /* Group ID of a group of KNI devices */\n \tuint32_t core_id;            /* Core ID to bind */\n \tchar name[RTE_KNI_NAMESIZE]; /* Network device name */\ndiff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c\nindex d889ffc4b..1c38cfa1a 100644\n--- a/kernel/linux/kni/kni_misc.c\n+++ b/kernel/linux/kni/kni_misc.c\n@@ -184,17 +184,34 @@ kni_dev_remove(struct kni_dev *dev)\n \t\t\tixgbe_kni_remove(dev->pci_dev);\n \t\telse if (pci_match_id(igb_pci_tbl, dev->pci_dev))\n \t\t\tigb_kni_remove(dev->pci_dev);\n+\t\tdev->pci_dev = NULL;\n \t}\n #endif\n \n-\tif (dev->net_dev) {\n+\tif (dev->registered) {\n \t\tunregister_netdev(dev->net_dev);\n-\t\tfree_netdev(dev->net_dev);\n+\t\tdev->registered = 0;\n \t}\n \n \treturn 0;\n }\n \n+static void\n+kni_dev_free(struct kni_dev *dev)\n+{\n+\tstruct net_device *net_dev;\n+\t/*\n+\t * Remember that struct kni_dev is part of the netdev\n+\t * structure, so we free *both* with free_netdev.\n+\t */\n+\tif (dev == NULL)\n+\t\treturn;\n+\tnet_dev = dev->net_dev;\n+\tdev->net_dev = NULL;\n+\tif (net_dev)\n+\t\tfree_netdev(net_dev);\n+}\n+\n static int\n kni_release(struct inode *inode, struct file *file)\n {\n@@ -224,6 +241,7 @@ kni_release(struct inode *inode, struct file *file)\n \t\tkni_dev_remove(dev);\n \t\tkni_net_release_fifo_phy(dev);\n \t\tlist_del(&dev->list);\n+\t\tkni_dev_free(dev);\n \t}\n \tup_write(&knet->kni_list_lock);\n \n@@ -457,15 +475,18 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,\n \tif (ret) {\n \t\tpr_err(\"error %i registering device \\\"%s\\\"\\n\",\n \t\t\t\t\tret, dev_info.name);\n+\t\tkni_dev_remove(kni);\n \t\tkni_net_release_fifo_phy(kni);\n-\t\tfree_netdev(net_dev);\n+\t\tkni_dev_free(kni);\n \t\treturn -ENODEV;\n \t}\n+\tkni->registered = 1;\n \n \tret = kni_run_thread(knet, kni, dev_info.force_bind);\n \tif (ret != 0) {\n \t\tkni_dev_remove(kni);\n \t\tkni_net_release_fifo_phy(kni);\n+\t\tkni_dev_free(kni);\n \t\treturn ret;\n \t}\n \n@@ -550,6 +571,7 @@ kni_ioctl_free(struct net *net, uint32_t ioctl_num,\n \n \t\tkni_net_release_fifo_phy(dev);\n \t\tlist_del(&dev->list);\n+\t\tkni_dev_free(dev);\n \t\tup_write(&knet->kni_list_lock);\n \t\tpr_info(\"Successfully freed kni interface: %s\\n\",\n \t\t\tdev_info.name);\n",
    "prefixes": [
        "v2",
        "03/10"
    ]
}