get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49106,
    "url": "https://patches.dpdk.org/api/patches/49106/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181219074107.10084-1-qi.z.zhang@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": "<20181219074107.10084-1-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181219074107.10084-1-qi.z.zhang@intel.com",
    "date": "2018-12-19T07:41:07",
    "name": "eal: close MP socket during cleanup",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b64500e2d0856ce343abb256c1553587e65b6bee",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@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/20181219074107.10084-1-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 2862,
            "url": "https://patches.dpdk.org/api/series/2862/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2862",
            "date": "2018-12-19T07:41:07",
            "name": "eal: close MP socket during cleanup",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/2862/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/49106/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/49106/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 65ED61BBDA;\n\tWed, 19 Dec 2018 08:39:53 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 65CB51B752;\n\tWed, 19 Dec 2018 08:39:50 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t18 Dec 2018 23:39:45 -0800",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby fmsmga001.fm.intel.com with ESMTP; 18 Dec 2018 23:39:44 -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,371,1539673200\"; d=\"scan'208\";a=\"131186843\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "anatoly.burakov@intel.com",
        "Cc": "thomas@monjalon.net, dev@dpdk.org, ferruh.yigit@intel.com,\n\tQi Zhang <qi.z.zhang@intel.com>, stable@dpdk.org",
        "Date": "Wed, 19 Dec 2018 15:41:07 +0800",
        "Message-Id": "<20181219074107.10084-1-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "Subject": "[dpdk-dev] [PATCH] eal: close MP socket during cleanup",
        "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": "When secondary process quit, the mp_socket* file still exist, that\ncause rte_mp_request_sync fail when try to send message on a floating\nsocket.\n\nThe patch fix the issue by introduce a function rte_mp_channel_fini.\nThis function will be called by rte_eal_cleanup and it will close the\nmp socket and delete the mp_socket* file.\n\nFixes: bacaa2754017 (\"eal: add channel for multi-process communication\")\nCc: stable@dpdk.org\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n lib/librte_eal/common/eal_common_proc.c | 22 +++++++++++++++++++++-\n lib/librte_eal/common/eal_private.h     |  6 ++++++\n lib/librte_eal/linuxapp/eal/eal.c       |  1 +\n 3 files changed, 28 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c\nindex 6b876590a..ff19bea15 100644\n--- a/lib/librte_eal/common/eal_common_proc.c\n+++ b/lib/librte_eal/common/eal_common_proc.c\n@@ -37,6 +37,7 @@ static int mp_fd = -1;\n static char mp_filter[PATH_MAX];   /* Filter for secondary process sockets */\n static char mp_dir_path[PATH_MAX]; /* The directory path for all mp sockets */\n static pthread_mutex_t mp_mutex_action = PTHREAD_MUTEX_INITIALIZER;\n+static char peer_name[PATH_MAX];\n \n struct action_entry {\n \tTAILQ_ENTRY(action_entry) next;\n@@ -511,9 +512,9 @@ async_reply_handle(void *arg)\n static int\n open_socket_fd(void)\n {\n-\tchar peer_name[PATH_MAX] = {0};\n \tstruct sockaddr_un un;\n \n+\tpeer_name[0] = '\\0';\n \tif (rte_eal_process_type() == RTE_PROC_SECONDARY)\n \t\tsnprintf(peer_name, sizeof(peer_name),\n \t\t\t\t\"%d_%\"PRIx64, getpid(), rte_rdtsc());\n@@ -542,6 +543,19 @@ open_socket_fd(void)\n \treturn mp_fd;\n }\n \n+static void\n+close_socket_fd(void)\n+{\n+\tchar path[PATH_MAX];\n+\n+\tif (mp_fd < 0)\n+\t\treturn;\n+\n+\tclose(mp_fd);\n+\tcreate_socket_path(peer_name, path, sizeof(path));\n+\tunlink(path);\n+}\n+\n int\n rte_mp_channel_init(void)\n {\n@@ -602,6 +616,12 @@ rte_mp_channel_init(void)\n \treturn 0;\n }\n \n+void\n+rte_mp_channel_fini(void)\n+{\n+\tclose_socket_fd();\n+}\n+\n /**\n  * Return -1, as fail to send message and it's caused by the local side.\n  * Return 0, as fail to send message and it's caused by the remote side.\ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex 442c6dc48..10b6857f6 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -259,6 +259,12 @@ struct rte_bus *rte_bus_find_by_device_name(const char *str);\n int rte_mp_channel_init(void);\n \n /**\n+ * Primary/secondary communication cleanup.\n+ */\n+\n+void rte_mp_channel_fini(void);\n+\n+/**\n  * @internal\n  * Parse a device string and store its information in an\n  * rte_devargs structure.\ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex d252c8591..52df05e8d 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -1229,6 +1229,7 @@ rte_eal_cleanup(void)\n \tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n \t\trte_memseg_walk(mark_freeable, NULL);\n \trte_service_finalize();\n+\trte_mp_channel_fini();\n \treturn 0;\n }\n \n",
    "prefixes": []
}