get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42977,
    "url": "http://patches.dpdk.org/api/patches/42977/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180712140144.18146-5-qi.z.zhang@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": "<20180712140144.18146-5-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180712140144.18146-5-qi.z.zhang@intel.com",
    "date": "2018-07-12T14:01:44",
    "name": "[4/4] vfio: remove uneccessary IPC for group fd clear",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fdda4104a1f877488bba8b7003aef105541067df",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180712140144.18146-5-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 549,
            "url": "http://patches.dpdk.org/api/series/549/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=549",
            "date": "2018-07-12T14:01:40",
            "name": "couple hotplug fix",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/549/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42977/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/42977/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 8CDC61B470;\n\tThu, 12 Jul 2018 16:01:18 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id F12521B448;\n\tThu, 12 Jul 2018 16:01:11 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Jul 2018 07:01:11 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby orsmga008.jf.intel.com with ESMTP; 12 Jul 2018 07:01:10 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,343,1526367600\"; d=\"scan'208\";a=\"56361110\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "thomas@monjalon.net, anatoly.burakov@intel.com, gaetan.rivet@6wind.com",
        "Cc": "dev@dpdk.org,\n\tQi Zhang <qi.z.zhang@intel.com>,\n\tstable@dpdk.org",
        "Date": "Thu, 12 Jul 2018 22:01:44 +0800",
        "Message-Id": "<20180712140144.18146-5-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180712140144.18146-1-qi.z.zhang@intel.com>",
        "References": "<20180712140144.18146-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 4/4] vfio: remove uneccessary IPC for group fd\n\tclear",
        "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": "Clear vfio_group_fd is not necessary to involve any IPC.\nAlso, current IPC implementation for SOCKET_CLR_GROUP is not\ncorrect. rte_vfio_clear_group on secondary will always fail,\nthat prevent device be detached correctly on a secondary process.\nThe patch simply removes all IPC related stuff in\nrte_vfio_clear_group.\n\nFixes: 83a73c5fef66 (\"vfio: use generic multi-process channel\")\nCc: stable@dpdk.org\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nAcked-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal_vfio.c         | 45 +++++---------------------\n lib/librte_eal/linuxapp/eal/eal_vfio.h         |  1 -\n lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c |  8 -----\n 3 files changed, 8 insertions(+), 46 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c\nindex a2bbdfbf4..c0eccddc3 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c\n@@ -575,10 +575,6 @@ int\n rte_vfio_clear_group(int vfio_group_fd)\n {\n \tint i;\n-\tstruct rte_mp_msg mp_req, *mp_rep;\n-\tstruct rte_mp_reply mp_reply;\n-\tstruct timespec ts = {.tv_sec = 5, .tv_nsec = 0};\n-\tstruct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;\n \tstruct vfio_config *vfio_cfg;\n \n \tvfio_cfg = get_vfio_cfg_by_group_fd(vfio_group_fd);\n@@ -587,40 +583,15 @@ rte_vfio_clear_group(int vfio_group_fd)\n \t\treturn -1;\n \t}\n \n-\tif (internal_config.process_type == RTE_PROC_PRIMARY) {\n-\n-\t\ti = get_vfio_group_idx(vfio_group_fd);\n-\t\tif (i < 0)\n-\t\t\treturn -1;\n-\t\tvfio_cfg->vfio_groups[i].group_num = -1;\n-\t\tvfio_cfg->vfio_groups[i].fd = -1;\n-\t\tvfio_cfg->vfio_groups[i].devices = 0;\n-\t\tvfio_cfg->vfio_active_groups--;\n-\t\treturn 0;\n-\t}\n-\n-\tp->req = SOCKET_CLR_GROUP;\n-\tp->group_num = vfio_group_fd;\n-\tstrcpy(mp_req.name, EAL_VFIO_MP);\n-\tmp_req.len_param = sizeof(*p);\n-\tmp_req.num_fds = 0;\n-\n-\tif (rte_mp_request_sync(&mp_req, &mp_reply, &ts) == 0 &&\n-\t    mp_reply.nb_received == 1) {\n-\t\tmp_rep = &mp_reply.msgs[0];\n-\t\tp = (struct vfio_mp_param *)mp_rep->param;\n-\t\tif (p->result == SOCKET_OK) {\n-\t\t\tfree(mp_reply.msgs);\n-\t\t\treturn 0;\n-\t\t} else if (p->result == SOCKET_NO_FD)\n-\t\t\tRTE_LOG(ERR, EAL, \"  BAD VFIO group fd!\\n\");\n-\t\telse\n-\t\t\tRTE_LOG(ERR, EAL, \"  no such VFIO group fd!\\n\");\n-\n-\t\tfree(mp_reply.msgs);\n-\t}\n+\ti = get_vfio_group_idx(vfio_group_fd);\n+\tif (i < 0)\n+\t\treturn -1;\n+\tvfio_cfg->vfio_groups[i].group_num = -1;\n+\tvfio_cfg->vfio_groups[i].fd = -1;\n+\tvfio_cfg->vfio_groups[i].devices = 0;\n+\tvfio_cfg->vfio_active_groups--;\n \n-\treturn -1;\n+\treturn 0;\n }\n \n int\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h\nindex e65b10374..68d4750a5 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_vfio.h\n+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h\n@@ -129,7 +129,6 @@ int vfio_mp_sync_setup(void);\n \n #define SOCKET_REQ_CONTAINER 0x100\n #define SOCKET_REQ_GROUP 0x200\n-#define SOCKET_CLR_GROUP 0x300\n #define SOCKET_OK 0x0\n #define SOCKET_NO_FD 0x1\n #define SOCKET_ERR 0xFF\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c\nindex 9c202bb08..680a24aae 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c\n@@ -55,14 +55,6 @@ vfio_mp_primary(const struct rte_mp_msg *msg, const void *peer)\n \t\t\treply.fds[0] = fd;\n \t\t}\n \t\tbreak;\n-\tcase SOCKET_CLR_GROUP:\n-\t\tr->req = SOCKET_CLR_GROUP;\n-\t\tr->group_num = m->group_num;\n-\t\tif (rte_vfio_clear_group(m->group_num) < 0)\n-\t\t\tr->result = SOCKET_NO_FD;\n-\t\telse\n-\t\t\tr->result = SOCKET_OK;\n-\t\tbreak;\n \tcase SOCKET_REQ_CONTAINER:\n \t\tr->req = SOCKET_REQ_CONTAINER;\n \t\tfd = rte_vfio_get_container_fd();\n",
    "prefixes": [
        "4/4"
    ]
}