get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 100513,
    "url": "https://patches.dpdk.org/api/patches/100513/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211005135909.726091-4-bruce.richardson@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": "<20211005135909.726091-4-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211005135909.726091-4-bruce.richardson@intel.com",
    "date": "2021-10-05T13:59:07",
    "name": "[v6,3/5] telemetry: use unique socket paths for in-memory mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4a7d9d5ad8c44acd3488f9607e8fb484c7474b33",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211005135909.726091-4-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 19390,
            "url": "https://patches.dpdk.org/api/series/19390/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19390",
            "date": "2021-10-05T13:59:04",
            "name": "improve telemetry support with in-memory mode",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/19390/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/100513/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/100513/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 55D7DA0C4C;\n\tTue,  5 Oct 2021 16:18:17 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A689841398;\n\tTue,  5 Oct 2021 16:18:05 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id 0A8DA4137D\n for <dev@dpdk.org>; Tue,  5 Oct 2021 16:18:02 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Oct 2021 06:59:25 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.223.151])\n by orsmga008.jf.intel.com with ESMTP; 05 Oct 2021 06:59:23 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10128\"; a=\"206563956\"",
            "E=Sophos;i=\"5.85,349,1624345200\"; d=\"scan'208\";a=\"206563956\"",
            "E=Sophos;i=\"5.85,349,1624345200\"; d=\"scan'208\";a=\"488044121\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ciara Power <ciara.power@intel.com>,\n David Marchand <david.marchand@redhat.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Kevin Traynor <ktraynor@redhat.com>,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Date": "Tue,  5 Oct 2021 14:59:07 +0100",
        "Message-Id": "<20211005135909.726091-4-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211005135909.726091-1-bruce.richardson@intel.com>",
        "References": "<20210915141030.23514-1-bruce.richardson@intel.com>\n <20211005135909.726091-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 3/5] telemetry: use unique socket paths for\n in-memory mode",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When DPDK is run using \"in-memory\" flag, multiple processes can be run\nusing the same file-prefix and hence the same runtime directory. To\navoid problems with conflicting telemetry unix socket paths, we can\nput the pid of the process into the socket name. As with the existing\ntelemetry socket files, these sockets are removed on normal program\nexit.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n doc/guides/howto/telemetry.rst     | 17 ++++++++++++++++-\n lib/eal/freebsd/eal.c              |  1 +\n lib/eal/linux/eal.c                |  1 +\n lib/telemetry/telemetry.c          | 15 ++++++++++++---\n lib/telemetry/telemetry_internal.h |  3 ++-\n 5 files changed, 32 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/doc/guides/howto/telemetry.rst b/doc/guides/howto/telemetry.rst\nindex 8f4fa1a510..8a61302459 100644\n--- a/doc/guides/howto/telemetry.rst\n+++ b/doc/guides/howto/telemetry.rst\n@@ -13,12 +13,27 @@ ethdev port list, and eal parameters.\n Telemetry Interface\n -------------------\n \n-The :doc:`../prog_guide/telemetry_lib` opens a socket with path\n+For applications run normally, i.e. without the `--in-memory` EAL flag,\n+the :doc:`../prog_guide/telemetry_lib` opens a socket with path\n *<runtime_directory>/dpdk_telemetry.<version>*. The version represents the\n telemetry version, the latest is v2. For example, a client would connect to a\n socket with path  */var/run/dpdk/\\*/dpdk_telemetry.v2* (when the primary process\n is run by a root user).\n \n+For applications run with the `--in-memory` EAL flag,\n+the socket file is created with an additional suffix of the process PID.\n+This is because multiple independent DPDK processes can be run simultaneously\n+using the same runtime directory when *in-memory* mode is used.\n+For example, when a user with UID 1000 runs processes with in-memory mode,\n+we would find sockets available such as::\n+\n+  /run/user/1000/dpdk/rte/dpdk_telemetry.v2.1982\n+  /run/user/1000/dpdk/rte/dpdk_telemetry.v2.1935\n+\n+Where `/run/user/<uid>` is the runtime directory for the user given by the\n+`$XDG_RUNTIME_DIR` environment variable,\n+and `rte` is the default DPDK file prefix used for a runtime directory.\n+\n \n Telemetry Initialization\n ------------------------\ndiff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c\nindex b06a2c1662..ed39d10b4e 100644\n--- a/lib/eal/freebsd/eal.c\n+++ b/lib/eal/freebsd/eal.c\n@@ -952,6 +952,7 @@ rte_eal_init(int argc, char **argv)\n \t\tif (tlog < 0)\n \t\t\ttlog = RTE_LOGTYPE_EAL;\n \t\tif (rte_telemetry_init(rte_eal_get_runtime_dir(),\n+\t\t\t\tinternal_conf->in_memory | internal_conf->no_shconf,\n \t\t\t\trte_version(),\n \t\t\t\t&internal_conf->ctrl_cpuset, rte_log, tlog) != 0)\n \t\t\treturn -1;\ndiff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c\nindex 0d0fc66668..9db4eb7913 100644\n--- a/lib/eal/linux/eal.c\n+++ b/lib/eal/linux/eal.c\n@@ -1326,6 +1326,7 @@ rte_eal_init(int argc, char **argv)\n \t\tif (tlog < 0)\n \t\t\ttlog = RTE_LOGTYPE_EAL;\n \t\tif (rte_telemetry_init(rte_eal_get_runtime_dir(),\n+\t\t\t\tinternal_conf->in_memory | internal_conf->no_shconf,\n \t\t\t\trte_version(),\n \t\t\t\t&internal_conf->ctrl_cpuset, rte_log, tlog) != 0)\n \t\t\treturn -1;\ndiff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c\nindex bd804a25a9..24441d100b 100644\n--- a/lib/telemetry/telemetry.c\n+++ b/lib/telemetry/telemetry.c\n@@ -51,6 +51,7 @@ static struct socket v1_socket; /* socket for v1 telemetry */\n \n static const char *telemetry_version; /* save rte_version */\n static const char *socket_dir;        /* runtime directory */\n+static bool socket_uses_pid;          /* for in-memory mode, we need different socket paths */\n static rte_cpuset_t *thread_cpuset;\n static rte_log_fn rte_log_ptr;\n static uint32_t logtype;\n@@ -432,8 +433,14 @@ static inline char *\n get_socket_path(const char *runtime_dir, const int version)\n {\n \tstatic char path[PATH_MAX];\n-\tsnprintf(path, sizeof(path), \"%s/dpdk_telemetry.v%d\",\n-\t\t\tstrlen(runtime_dir) ? runtime_dir : \"/tmp\", version);\n+\tif (!socket_uses_pid)\n+\t\tsnprintf(path, sizeof(path), \"%s/dpdk_telemetry.v%d\",\n+\t\t\t\tstrlen(runtime_dir) ? runtime_dir : \"/tmp\", version);\n+\telse\n+\t\tsnprintf(path, sizeof(path), \"%s/dpdk_telemetry.v%d.%u\",\n+\t\t\t\tstrlen(runtime_dir) ? runtime_dir : \"/tmp\",\n+\t\t\t\tversion,\n+\t\t\t\t(unsigned int)getpid());\n \treturn path;\n }\n \n@@ -591,11 +598,13 @@ telemetry_v2_init(void)\n #endif /* !RTE_EXEC_ENV_WINDOWS */\n \n int32_t\n-rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset,\n+rte_telemetry_init(const char *runtime_dir, bool in_memory,\n+\t\tconst char *rte_version, rte_cpuset_t *cpuset,\n \t\trte_log_fn log_fn, uint32_t registered_logtype)\n {\n \ttelemetry_version = rte_version;\n \tsocket_dir = runtime_dir;\n+\tsocket_uses_pid = in_memory; /* for in-memory mode use pid in sock path for uniqueness */\n \tthread_cpuset = cpuset;\n \trte_log_ptr = log_fn;\n \tlogtype = registered_logtype;\ndiff --git a/lib/telemetry/telemetry_internal.h b/lib/telemetry/telemetry_internal.h\nindex d085c492dc..d8fb37a633 100644\n--- a/lib/telemetry/telemetry_internal.h\n+++ b/lib/telemetry/telemetry_internal.h\n@@ -109,7 +109,8 @@ typedef int (*rte_log_fn)(uint32_t level, uint32_t logtype, const char *format,\n  */\n __rte_internal\n int\n-rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset,\n+rte_telemetry_init(const char *runtime_dir, bool in_memory,\n+\t\tconst char *rte_version, rte_cpuset_t *cpuset,\n \t\trte_log_fn log_fn, uint32_t registered_logtype);\n \n #endif\n",
    "prefixes": [
        "v6",
        "3/5"
    ]
}