get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 114288,
    "url": "http://patches.dpdk.org/api/patches/114288/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220727223639.598932-10-cristian.dumitrescu@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": "<20220727223639.598932-10-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220727223639.598932-10-cristian.dumitrescu@intel.com",
    "date": "2022-07-27T22:36:32",
    "name": "[V3,10/17] examples/pipeline: add CLI command for shared library build",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9ec3fcedc2620745a92e29ea165d5ba3d5775086",
    "submitter": {
        "id": 19,
        "url": "http://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@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/20220727223639.598932-10-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 24106,
            "url": "http://patches.dpdk.org/api/series/24106/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24106",
            "date": "2022-07-27T22:36:23",
            "name": "[V3,01/17] pipeline: add pipeline name",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/24106/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/114288/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/114288/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 1F813A00C4;\n\tThu, 28 Jul 2022 00:37:41 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 722F242B98;\n\tThu, 28 Jul 2022 00:36:56 +0200 (CEST)",
            "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 38B5B42B7B\n for <dev@dpdk.org>; Thu, 28 Jul 2022 00:36:51 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Jul 2022 15:36:50 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com.) ([10.237.223.157])\n by orsmga008.jf.intel.com with ESMTP; 27 Jul 2022 15:36:49 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1658961411; x=1690497411;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=95Sbs83qYWkK0R74Y+/x4Gwlb1XhzzVaW6NJKTZu2xg=;\n b=cEIXOgQPgpUpn8eAszUTlx+Y9I3YX0OiZrsN1GgXjSFGL7cdhidxzBdb\n VuzWifGwbTx+IHkCUxjgexZZsQ5ScqbPIBqhTXds7bfFoFsLG3sNKbgmO\n NOCGTK2XWndxIUZnG2jN3WMSr82kJhNmEJwFdFJR0AwfrmsCLy6N5kzLM\n VgtIBEskxslDeeV+Z7HSgX84CT7JnrpZbVF52b8EWOz/KBFdi84iCk28U\n U0Is77NsSySLXdWKX/x1MTDEibxuVEM/qPnADyRPb/R0cQPIFzilzqvjj\n 81syhb+wpbs4RQorcqNXdynUXH+ZG2EIaM/gU0WFAlVdmVOxGsDKzanrM A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10421\"; a=\"350068837\"",
            "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"350068837\"",
            "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"628567646\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "\"Kamalakannan R .\" <kamalakannan.r@intel.com>",
        "Subject": "[PATCH V3 10/17] examples/pipeline: add CLI command for shared\n library build",
        "Date": "Wed, 27 Jul 2022 22:36:32 +0000",
        "Message-Id": "<20220727223639.598932-10-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220727223639.598932-1-cristian.dumitrescu@intel.com>",
        "References": "<20220718132603.339314-1-cristian.dumitrescu@intel.com>\n <20220727223639.598932-1-cristian.dumitrescu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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"
    },
    "content": "Add CLI command for the shared object library build operation.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Kamalakannan R. <kamalakannan.r@intel.com>\n---\n examples/pipeline/cli.c | 157 +++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 153 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c\nindex 2b38977be1..28cf8d4178 100644\n--- a/examples/pipeline/cli.c\n+++ b/examples/pipeline/cli.c\n@@ -6,6 +6,7 @@\n #include <stdint.h>\n #include <stdlib.h>\n #include <string.h>\n+#include <unistd.h>\n \n #include <rte_common.h>\n #include <rte_ethdev.h>\n@@ -25,6 +26,10 @@\n #define CMD_MAX_TOKENS     256\n #endif\n \n+#ifndef MAX_LINE_SIZE\n+#define MAX_LINE_SIZE 2048\n+#endif\n+\n #define MSG_OUT_OF_MEMORY   \"Not enough memory.\\n\"\n #define MSG_CMD_UNKNOWN     \"Unknown command \\\"%s\\\".\\n\"\n #define MSG_CMD_UNIMPLEM    \"Command \\\"%s\\\" not implemented.\\n\"\n@@ -1030,6 +1035,140 @@ cmd_pipeline_codegen(char **tokens,\n \t\treturn;\n \t}\n }\n+\n+static const char cmd_pipeline_libbuild_help[] =\n+\"pipeline libbuild <code_file> <lib_file>\\n\";\n+\n+static void\n+cmd_pipeline_libbuild(char **tokens,\n+\tuint32_t n_tokens,\n+\tchar *out,\n+\tsize_t out_size,\n+\tvoid *obj __rte_unused)\n+{\n+\tchar *code_file, *lib_file, *obj_file = NULL, *log_file = NULL;\n+\tchar *install_dir, *cwd = NULL, *buffer = NULL;\n+\tsize_t length;\n+\tint status = 0;\n+\n+\tif (n_tokens != 4) {\n+\t\tsnprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);\n+\t\tgoto free;\n+\t}\n+\n+\tinstall_dir = getenv(\"RTE_INSTALL_DIR\");\n+\tif (!install_dir) {\n+\t\tcwd = malloc(MAX_LINE_SIZE);\n+\t\tif (!cwd) {\n+\t\t\tsnprintf(out, out_size, MSG_OUT_OF_MEMORY);\n+\t\t\tgoto free;\n+\t\t}\n+\n+\t\tinstall_dir = getcwd(cwd, MAX_LINE_SIZE);\n+\t\tif (!install_dir) {\n+\t\t\tsnprintf(out, out_size, \"Error: Path too long.\\n\");\n+\t\t\tgoto free;\n+\t\t}\n+\t}\n+\n+\tsnprintf(out, out_size, \"Using DPDK source code from \\\"%s\\\".\\n\", install_dir);\n+\tout_size -= strlen(out);\n+\tout += strlen(out);\n+\n+\tcode_file = tokens[2];\n+\tlength = strnlen(code_file, MAX_LINE_SIZE);\n+\tif ((length < 3) ||\n+\t    (code_file[length - 2] != '.') ||\n+\t    (code_file[length - 1] != 'c')) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"code_file\");\n+\t\tgoto free;\n+\t}\n+\n+\tlib_file = tokens[3];\n+\tlength = strnlen(lib_file, MAX_LINE_SIZE);\n+\tif ((length < 4) ||\n+\t    (lib_file[length - 3] != '.') ||\n+\t    (lib_file[length - 2] != 's') ||\n+\t    (lib_file[length - 1] != 'o')) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"lib_file\");\n+\t\tgoto free;\n+\t}\n+\n+\tobj_file = malloc(length);\n+\tlog_file = malloc(length + 2);\n+\tif (!obj_file || !log_file) {\n+\t\tsnprintf(out, out_size, MSG_OUT_OF_MEMORY);\n+\t\tgoto free;\n+\t}\n+\n+\tmemcpy(obj_file, lib_file, length - 2);\n+\tobj_file[length - 2] = 'o';\n+\tobj_file[length - 1] = 0;\n+\n+\tmemcpy(log_file, lib_file, length - 2);\n+\tlog_file[length - 2] = 'l';\n+\tlog_file[length - 1] = 'o';\n+\tlog_file[length] = 'g';\n+\tlog_file[length + 1] = 0;\n+\n+\tbuffer = malloc(MAX_LINE_SIZE);\n+\tif (!buffer) {\n+\t\tsnprintf(out, out_size, MSG_OUT_OF_MEMORY);\n+\t\treturn;\n+\t}\n+\n+\tsnprintf(buffer,\n+\t\t MAX_LINE_SIZE,\n+\t\t \"gcc -c -O3 -fpic -Wno-deprecated-declarations -o %s %s \"\n+\t\t \"-I %s/lib/pipeline \"\n+\t\t \"-I %s/lib/eal/include \"\n+\t\t \"-I %s/lib/eal/x86/include \"\n+\t\t \"-I %s/lib/eal/include/generic \"\n+\t\t \"-I %s/lib/meter \"\n+\t\t \"-I %s/lib/port \"\n+\t\t \"-I %s/lib/table \"\n+\t\t \"-I %s/lib/pipeline \"\n+\t\t \"-I %s/config \"\n+\t\t \"-I %s/build \"\n+\t\t \"-I %s/lib/eal/linux/include \"\n+\t\t \">%s 2>&1 \"\n+\t\t \"&& \"\n+\t\t \"gcc -shared %s -o %s \"\n+\t\t \">>%s 2>&1\",\n+\t\t obj_file,\n+\t\t code_file,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t install_dir,\n+\t\t log_file,\n+\t\t obj_file,\n+\t\t lib_file,\n+\t\t log_file);\n+\n+\tstatus = system(buffer);\n+\tif (status) {\n+\t\tsnprintf(out,\n+\t\t\t out_size,\n+\t\t\t \"Library build failed, see file \\\"%s\\\" for details.\\n\",\n+\t\t\t log_file);\n+\t\tgoto free;\n+\t}\n+\n+free:\n+\tfree(cwd);\n+\tfree(obj_file);\n+\tfree(log_file);\n+\tfree(buffer);\n+}\n+\n static const char cmd_pipeline_build_help[] =\n \"pipeline <pipeline_name> build lib <lib_file> io <iospec_file> numa <numa_node>\\n\";\n \n@@ -1127,10 +1266,6 @@ table_entry_free(struct rte_swx_table_entry *entry)\n \tfree(entry);\n }\n \n-#ifndef MAX_LINE_SIZE\n-#define MAX_LINE_SIZE 2048\n-#endif\n-\n static int\n pipeline_table_entries_add(struct rte_swx_ctl_pipeline *p,\n \t\t\t   const char *table_name,\n@@ -3057,6 +3192,7 @@ cmd_help(char **tokens,\n \t\t\t\"\\tpipeline port in\\n\"\n \t\t\t\"\\tpipeline port out\\n\"\n \t\t\t\"\\tpipeline codegen\\n\"\n+\t\t\t\"\\tpipeline libbuild\\n\"\n \t\t\t\"\\tpipeline build\\n\"\n \t\t\t\"\\tpipeline table add\\n\"\n \t\t\t\"\\tpipeline table delete\\n\"\n@@ -3132,6 +3268,12 @@ cmd_help(char **tokens,\n \t\treturn;\n \t}\n \n+\tif ((strcmp(tokens[0], \"pipeline\") == 0) &&\n+\t\t(n_tokens == 2) && (strcmp(tokens[1], \"libbuild\") == 0)) {\n+\t\tsnprintf(out, out_size, \"\\n%s\\n\", cmd_pipeline_libbuild_help);\n+\t\treturn;\n+\t}\n+\n \tif ((strcmp(tokens[0], \"pipeline\") == 0) &&\n \t\t(n_tokens == 2) && (strcmp(tokens[1], \"build\") == 0)) {\n \t\tsnprintf(out, out_size, \"\\n%s\\n\", cmd_pipeline_build_help);\n@@ -3417,6 +3559,13 @@ cli_process(char *in, char *out, size_t out_size, void *obj)\n \t\t\treturn;\n \t\t}\n \n+\t\tif ((n_tokens >= 3) &&\n+\t\t\t(strcmp(tokens[1], \"libbuild\") == 0)) {\n+\t\t\tcmd_pipeline_libbuild(tokens, n_tokens, out, out_size,\n+\t\t\t\tobj);\n+\t\t\treturn;\n+\t\t}\n+\n \t\tif ((n_tokens >= 3) &&\n \t\t\t(strcmp(tokens[2], \"build\") == 0)) {\n \t\t\tcmd_pipeline_build(tokens, n_tokens, out, out_size,\n",
    "prefixes": [
        "V3",
        "10/17"
    ]
}