get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 114327,
    "url": "https://patches.dpdk.org/api/patches/114327/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220727230132.601114-15-cristian.dumitrescu@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": "<20220727230132.601114-15-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220727230132.601114-15-cristian.dumitrescu@intel.com",
    "date": "2022-07-27T23:01:30",
    "name": "[V5,15/17] examples/pipeline: rework the link CLI command",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "155bb8bbe59335e2e466249cfa1a2e2bfecc6203",
    "submitter": {
        "id": 19,
        "url": "https://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@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/20220727230132.601114-15-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 24108,
            "url": "https://patches.dpdk.org/api/series/24108/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24108",
            "date": "2022-07-27T23:01:16",
            "name": "[V5,01/17] pipeline: add pipeline name",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/24108/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/114327/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/114327/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 08D30A00C4;\n\tThu, 28 Jul 2022 01:03:12 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 35B0542BE8;\n\tThu, 28 Jul 2022 01:01:56 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 2CFDA42BD9\n for <dev@dpdk.org>; Thu, 28 Jul 2022 01:01:49 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Jul 2022 16:01:49 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com.) ([10.237.223.157])\n by fmsmga006.fm.intel.com with ESMTP; 27 Jul 2022 16:01:48 -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=1658962911; x=1690498911;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=HmDg1AR982LIltOn9SqBqacO17+vmGA8gmgWNPsCCAk=;\n b=UJxDx6W0WtFwGkA1bvwm6G6oIw/zyzMmhU4er/q4kzEp5vaOz0Y6t0Y+\n xejA0lrMFuE+s6V7NOcL086Kp/BDINmL8rU9+j2bF+bNHafYB8uxO+qqf\n nh/jg28tMCl70ieM6WR0lDsStWi0MTd2bKcxh3LBtPzflMR5WyJUOA7Od\n aopa00w8iRez1e/3qGj6shXTOMGKMzc7MLvUfMZPL725RpNEQRHH6irxJ\n 5noBuCNIIHrydnI8oQgleN7gEpUIcjTQGRuLIpZ5kb0TjubaSHcg4tzem\n ZFDMimrgo/mYzTEmog+iazoLBpvv5MDuaqWNKl7iMJE0ZbsR9tJDGS43u Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10421\"; a=\"289135841\"",
            "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"289135841\"",
            "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"846444404\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "\"Kamalakannan R .\" <kamalakannan.r@intel.com>",
        "Subject": "[PATCH V5 15/17] examples/pipeline: rework the link CLI command",
        "Date": "Wed, 27 Jul 2022 23:01:30 +0000",
        "Message-Id": "<20220727230132.601114-15-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220727230132.601114-1-cristian.dumitrescu@intel.com>",
        "References": "<20220727225431.600913-1-cristian.dumitrescu@intel.com>\n <20220727230132.601114-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": "Rework the link CLI command for better alignment with the naming\nconventions used in the pipeline I/O specification file. Use the\nlibrary linked list of devices and remove the application list.\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 | 81 +++++++++++++----------------------------\n examples/pipeline/obj.c | 16 ++------\n examples/pipeline/obj.h |  4 --\n 3 files changed, 29 insertions(+), 72 deletions(-)",
    "diff": "diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c\nindex f48ff326be..d56a830fb7 100644\n--- a/examples/pipeline/cli.c\n+++ b/examples/pipeline/cli.c\n@@ -106,22 +106,6 @@ parser_read_uint32(uint32_t *value, const char *p)\n \treturn 0;\n }\n \n-static int\n-parser_read_uint16(uint16_t *value, const char *p)\n-{\n-\tuint64_t val = 0;\n-\tint ret = parser_read_uint64(&val, p);\n-\n-\tif (ret < 0)\n-\t\treturn ret;\n-\n-\tif (val > UINT16_MAX)\n-\t\treturn -ERANGE;\n-\n-\t*value = val;\n-\treturn 0;\n-}\n-\n #define PARSE_DELIMITER \" \\f\\n\\r\\t\\v\"\n \n static int\n@@ -230,16 +214,15 @@ cmd_mempool(char **tokens,\n \t}\n }\n \n-static const char cmd_link_help[] =\n-\"link <link_name>\\n\"\n-\"   dev <device_name> | port <port_id>\\n\"\n+static const char cmd_ethdev_help[] =\n+\"ethdev <ethdev_name>\\n\"\n \"   rxq <n_queues> <queue_size> <mempool_name>\\n\"\n \"   txq <n_queues> <queue_size>\\n\"\n \"   promiscuous on | off\\n\"\n \"   [rss <qid_0> ... <qid_n>]\\n\";\n \n static void\n-cmd_link(char **tokens,\n+cmd_ethdev(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n@@ -252,65 +235,51 @@ cmd_link(char **tokens,\n \n \tmemset(&p, 0, sizeof(p));\n \n-\tif ((n_tokens < 13) || (n_tokens > 14 + LINK_RXQ_RSS_MAX)) {\n+\tif ((n_tokens < 11) || (n_tokens > 12 + LINK_RXQ_RSS_MAX)) {\n \t\tsnprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);\n \t\treturn;\n \t}\n \tname = tokens[1];\n \n-\tif (strcmp(tokens[2], \"dev\") == 0)\n-\t\tp.dev_name = tokens[3];\n-\telse if (strcmp(tokens[2], \"port\") == 0) {\n-\t\tp.dev_name = NULL;\n-\n-\t\tif (parser_read_uint16(&p.port_id, tokens[3]) != 0) {\n-\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"port_id\");\n-\t\t\treturn;\n-\t\t}\n-\t} else {\n-\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"dev or port\");\n-\t\treturn;\n-\t}\n-\n-\tif (strcmp(tokens[4], \"rxq\") != 0) {\n+\tif (strcmp(tokens[2], \"rxq\") != 0) {\n \t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"rxq\");\n \t\treturn;\n \t}\n \n-\tif (parser_read_uint32(&p.rx.n_queues, tokens[5]) != 0) {\n+\tif (parser_read_uint32(&p.rx.n_queues, tokens[3]) != 0) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"n_queues\");\n \t\treturn;\n \t}\n-\tif (parser_read_uint32(&p.rx.queue_size, tokens[6]) != 0) {\n+\tif (parser_read_uint32(&p.rx.queue_size, tokens[4]) != 0) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"queue_size\");\n \t\treturn;\n \t}\n \n-\tp.rx.mempool_name = tokens[7];\n+\tp.rx.mempool_name = tokens[5];\n \n-\tif (strcmp(tokens[8], \"txq\") != 0) {\n+\tif (strcmp(tokens[6], \"txq\") != 0) {\n \t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"txq\");\n \t\treturn;\n \t}\n \n-\tif (parser_read_uint32(&p.tx.n_queues, tokens[9]) != 0) {\n+\tif (parser_read_uint32(&p.tx.n_queues, tokens[7]) != 0) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"n_queues\");\n \t\treturn;\n \t}\n \n-\tif (parser_read_uint32(&p.tx.queue_size, tokens[10]) != 0) {\n+\tif (parser_read_uint32(&p.tx.queue_size, tokens[8]) != 0) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"queue_size\");\n \t\treturn;\n \t}\n \n-\tif (strcmp(tokens[11], \"promiscuous\") != 0) {\n+\tif (strcmp(tokens[9], \"promiscuous\") != 0) {\n \t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"promiscuous\");\n \t\treturn;\n \t}\n \n-\tif (strcmp(tokens[12], \"on\") == 0)\n+\tif (strcmp(tokens[10], \"on\") == 0)\n \t\tp.promiscuous = 1;\n-\telse if (strcmp(tokens[12], \"off\") == 0)\n+\telse if (strcmp(tokens[10], \"off\") == 0)\n \t\tp.promiscuous = 0;\n \telse {\n \t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"on or off\");\n@@ -319,10 +288,10 @@ cmd_link(char **tokens,\n \n \t/* RSS */\n \tp.rx.rss = NULL;\n-\tif (n_tokens > 13) {\n+\tif (n_tokens > 11) {\n \t\tuint32_t queue_id, i;\n \n-\t\tif (strcmp(tokens[13], \"rss\") != 0) {\n+\t\tif (strcmp(tokens[11], \"rss\") != 0) {\n \t\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"rss\");\n \t\t\treturn;\n \t\t}\n@@ -330,7 +299,7 @@ cmd_link(char **tokens,\n \t\tp.rx.rss = &rss;\n \n \t\trss.n_queues = 0;\n-\t\tfor (i = 14; i < n_tokens; i++) {\n+\t\tfor (i = 12; i < n_tokens; i++) {\n \t\t\tif (parser_read_uint32(&queue_id, tokens[i]) != 0) {\n \t\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID,\n \t\t\t\t\t\"queue_id\");\n@@ -406,10 +375,10 @@ print_link_info(struct link *link, char *out, size_t out_size)\n }\n \n /*\n- * link show [<link_name>]\n+ * ethdev show [<ethdev_name>]\n  */\n static void\n-cmd_link_show(char **tokens,\n+cmd_ethdev_show(char **tokens,\n \t      uint32_t n_tokens,\n \t      char *out,\n \t      size_t out_size,\n@@ -2675,7 +2644,7 @@ cmd_help(char **tokens,\n \t\t\t\"Type 'help <command>' for command details.\\n\\n\"\n \t\t\t\"List of commands:\\n\"\n \t\t\t\"\\tmempool\\n\"\n-\t\t\t\"\\tlink\\n\"\n+\t\t\t\"\\tethdev\\n\"\n \t\t\t\"\\ttap\\n\"\n \t\t\t\"\\tpipeline codegen\\n\"\n \t\t\t\"\\tpipeline libbuild\\n\"\n@@ -2711,8 +2680,8 @@ cmd_help(char **tokens,\n \t\treturn;\n \t}\n \n-\tif (strcmp(tokens[0], \"link\") == 0) {\n-\t\tsnprintf(out, out_size, \"\\n%s\\n\", cmd_link_help);\n+\tif (strcmp(tokens[0], \"ethdev\") == 0) {\n+\t\tsnprintf(out, out_size, \"\\n%s\\n\", cmd_ethdev_help);\n \t\treturn;\n \t}\n \n@@ -2966,13 +2935,13 @@ cli_process(char *in, char *out, size_t out_size, void *obj)\n \t\treturn;\n \t}\n \n-\tif (strcmp(tokens[0], \"link\") == 0) {\n+\tif (strcmp(tokens[0], \"ethdev\") == 0) {\n \t\tif ((n_tokens >= 2) && (strcmp(tokens[1], \"show\") == 0)) {\n-\t\t\tcmd_link_show(tokens, n_tokens, out, out_size, obj);\n+\t\t\tcmd_ethdev_show(tokens, n_tokens, out, out_size, obj);\n \t\t\treturn;\n \t\t}\n \n-\t\tcmd_link(tokens, n_tokens, out, out_size, obj);\n+\t\tcmd_ethdev(tokens, n_tokens, out, out_size, obj);\n \t\treturn;\n \t}\n \ndiff --git a/examples/pipeline/obj.c b/examples/pipeline/obj.c\nindex d1f519180e..950ab831fb 100644\n--- a/examples/pipeline/obj.c\n+++ b/examples/pipeline/obj.c\n@@ -181,7 +181,7 @@ link_create(struct obj *obj, const char *name, struct link_params *params)\n \tstruct mempool *mempool;\n \tuint32_t cpu_id, i;\n \tint status;\n-\tuint16_t port_id;\n+\tuint16_t port_id = 0;\n \n \t/* Check input params */\n \tif ((name == NULL) ||\n@@ -193,16 +193,9 @@ link_create(struct obj *obj, const char *name, struct link_params *params)\n \t\t(params->tx.queue_size == 0))\n \t\treturn NULL;\n \n-\tport_id = params->port_id;\n-\tif (params->dev_name) {\n-\t\tstatus = rte_eth_dev_get_port_by_name(params->dev_name,\n-\t\t\t&port_id);\n-\n-\t\tif (status)\n-\t\t\treturn NULL;\n-\t} else\n-\t\tif (!rte_eth_dev_is_valid_port(port_id))\n-\t\t\treturn NULL;\n+\tstatus = rte_eth_dev_get_port_by_name(name, &port_id);\n+\tif (status)\n+\t\treturn NULL;\n \n \tif (rte_eth_dev_info_get(port_id, &port_info) != 0)\n \t\treturn NULL;\n@@ -315,7 +308,6 @@ link_create(struct obj *obj, const char *name, struct link_params *params)\n \t/* Node fill in */\n \tstrlcpy(link->name, name, sizeof(link->name));\n \tlink->port_id = port_id;\n-\trte_eth_dev_get_name_by_port(port_id, link->dev_name);\n \tlink->n_rxq = params->rx.n_queues;\n \tlink->n_txq = params->tx.n_queues;\n \ndiff --git a/examples/pipeline/obj.h b/examples/pipeline/obj.h\nindex e63a9c0e9a..af270a8e57 100644\n--- a/examples/pipeline/obj.h\n+++ b/examples/pipeline/obj.h\n@@ -63,9 +63,6 @@ struct link_params_rss {\n };\n \n struct link_params {\n-\tconst char *dev_name;\n-\tuint16_t port_id; /**< Valid only when *dev_name* is NULL. */\n-\n \tstruct {\n \t\tuint32_t n_queues;\n \t\tuint32_t queue_size;\n@@ -84,7 +81,6 @@ struct link_params {\n struct link {\n \tTAILQ_ENTRY(link) node;\n \tchar name[NAME_SIZE];\n-\tchar dev_name[NAME_SIZE];\n \tuint16_t port_id;\n \tuint32_t n_rxq;\n \tuint32_t n_txq;\n",
    "prefixes": [
        "V5",
        "15/17"
    ]
}