get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 48229,
    "url": "https://patches.dpdk.org/api/patches/48229/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181121184132.34039-1-dariusz.stojaczyk@intel.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": "<20181121184132.34039-1-dariusz.stojaczyk@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181121184132.34039-1-dariusz.stojaczyk@intel.com",
    "date": "2018-11-21T18:41:32",
    "name": "vfio: don't needlessly setup devices in secondary process",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "dc70084c86eb3256d155b2a272eb5d3bcb02d39e",
    "submitter": {
        "id": 1123,
        "url": "https://patches.dpdk.org/api/people/1123/?format=api",
        "name": "Stojaczyk, Dariusz",
        "email": "dariusz.stojaczyk@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20181121184132.34039-1-dariusz.stojaczyk@intel.com/mbox/",
    "series": [
        {
            "id": 2522,
            "url": "https://patches.dpdk.org/api/series/2522/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2522",
            "date": "2018-11-21T18:41:32",
            "name": "vfio: don't needlessly setup devices in secondary process",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/2522/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/48229/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/48229/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 E606B1B120;\n\tWed, 21 Nov 2018 19:51:04 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 66C961B117\n\tfor <dev@dpdk.org>; Wed, 21 Nov 2018 19:51:03 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Nov 2018 10:51:02 -0800",
            "from violet.igk.intel.com ([10.102.54.137])\n\tby fmsmga001.fm.intel.com with ESMTP; 21 Nov 2018 10:51:01 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,262,1539673200\"; d=\"scan'208\";a=\"110083640\"",
        "From": "Darek Stojaczyk <dariusz.stojaczyk@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Darek Stojaczyk <dariusz.stojaczyk@intel.com>, anatoly.burakov@intel.com",
        "Date": "Wed, 21 Nov 2018 19:41:32 +0100",
        "Message-Id": "<20181121184132.34039-1-dariusz.stojaczyk@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[dpdk-dev] [PATCH] vfio: don't needlessly setup devices in\n\tsecondary process",
        "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": "Setting up a device that wasn't setup in the primary\nprocess will possibly break the primary process. That's\nbecause the IPC message to retrieve the group fd in the\nprimary will also *open* that group if it wasn't opened\nbefore. Even though the secondary process closes that fd\nsoon after as a part of its error handling path, the\nprimary process leaks it.\n\nWhat's worse, opening that fd on the primary will\nincrement the process-local counter of opened groups.\nIf it was 0 before, then the group will never be added\nto the vfio container, nor dpdk memory will be ever\nmapped.\n\nThis patch moves the proper error checks earlier in the\ncode to fuly prevent setting up devices in secondary\nprocesses that weren't setup in the primary process.\n\nFixes: 2f4adfad0a69 (\"vfio: add multiprocess support\")\nCc: anatoly.burakov@intel.com\n\nSigned-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>\n---\n drivers/bus/pci/linux/pci_vfio.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c\nindex ffd26f195..54a4c959e 100644\n--- a/drivers/bus/pci/linux/pci_vfio.c\n+++ b/drivers/bus/pci/linux/pci_vfio.c\n@@ -794,11 +794,6 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)\n \tsnprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,\n \t\t\tloc->domain, loc->bus, loc->devid, loc->function);\n \n-\tret = rte_vfio_setup_device(rte_pci_get_sysfs_path(), pci_addr,\n-\t\t\t\t\t&vfio_dev_fd, &device_info);\n-\tif (ret)\n-\t\treturn ret;\n-\n \t/* if we're in a secondary process, just find our tailq entry */\n \tTAILQ_FOREACH(vfio_res, vfio_res_list, next) {\n \t\tif (rte_pci_addr_cmp(&vfio_res->pci_addr,\n@@ -810,9 +805,14 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)\n \tif (vfio_res == NULL) {\n \t\tRTE_LOG(ERR, EAL, \"  %s cannot find TAILQ entry for PCI device!\\n\",\n \t\t\t\tpci_addr);\n-\t\tgoto err_vfio_dev_fd;\n+\t\treturn -1;\n \t}\n \n+\tret = rte_vfio_setup_device(rte_pci_get_sysfs_path(), pci_addr,\n+\t\t\t\t\t&vfio_dev_fd, &device_info);\n+\tif (ret)\n+\t\treturn ret;\n+\n \t/* map BARs */\n \tmaps = vfio_res->maps;\n \n",
    "prefixes": []
}