get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52133,
    "url": "http://patches.dpdk.org/api/patches/52133/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190402203907.28679-2-stephen@networkplumber.org/",
    "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": "<20190402203907.28679-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190402203907.28679-2-stephen@networkplumber.org",
    "date": "2019-04-02T20:39:05",
    "name": "[v4,1/3] app/testpmd: add ability to set Tx IP and UDP parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "097b483692a60b35c2dd95b3530c38ae4e65be24",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20190402203907.28679-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4071,
            "url": "http://patches.dpdk.org/api/series/4071/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4071",
            "date": "2019-04-02T20:39:04",
            "name": "use RFC addresses in test applications",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/4071/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52133/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52133/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 641ED1B12A;\n\tTue,  2 Apr 2019 22:39:16 +0200 (CEST)",
            "from mail-pf1-f195.google.com (mail-pf1-f195.google.com\n\t[209.85.210.195]) by dpdk.org (Postfix) with ESMTP id E27471B11C\n\tfor <dev@dpdk.org>; Tue,  2 Apr 2019 22:39:12 +0200 (CEST)",
            "by mail-pf1-f195.google.com with SMTP id 10so6953756pfo.5\n\tfor <dev@dpdk.org>; Tue, 02 Apr 2019 13:39:12 -0700 (PDT)",
            "from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com.\n\t[204.195.22.127]) by smtp.gmail.com with ESMTPSA id\n\tt64sm34191748pfa.86.2019.04.02.13.39.10\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 02 Apr 2019 13:39:10 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=HJtX5V5FJIwTW/kG6PNsptsquwc233N/A/cg4MNE6CA=;\n\tb=Y+wYFipTnpm0G2rn2njITnaxZKmSwltIW9nATFXrE256gcPDRGF9+jUVgqJacvla+N\n\tgjCy7Y9HmW9LvpuZkm9TcSdf9UH4yyVM/ZS8eBFjF0StuLZ8nm/LqLy4RBRxU46DMSGd\n\tpBO8c0NaGGNYzyCi5lYBmGdAx3m6Gqrc3OmpdXgQYOriMRpMqvkQOR9sjOTC7igbGcYd\n\tzCbsInWJEt/Epb2r3mYqqkdPE1hrEmr1ydFKL+4kW5hSITbvvZzrdelQQKR9i9U6QPVE\n\tPsLsJoUNzs2k1Nu12YrJDLEJDnViBuumru9d/HauL0dohtwPBaM7GJgrGmoVqliP6Sby\n\teGbg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=HJtX5V5FJIwTW/kG6PNsptsquwc233N/A/cg4MNE6CA=;\n\tb=A7GaKRqvZ5JzvsxeMnQACZHpYDPG5Xw6LSaVC499GoudWCa5+MbGsV7f2Izo7ZQurM\n\tzZx1vIvS2gaXZJLOmgnjUuALWER/vBgwEO68vfaor5xmVl3Lx2n8GPAz3+qyj9qrcljN\n\tPIctf7mT74JbC+6W0n6kKG0+ku5kyBHvX6NR78g8Ofsiqu1ID0lAAw44rnRIP0NN+QsF\n\t4JSEc8REMbqUud0X0k3eNKtEa4v4xIQSoy+vEN0zrIhm8hfJkumkFonUMAXYzbP97EmY\n\ty2+NOOvd9sGOwjR4XxYNEyY6MOEoMzKB4946p1fGIXVnfVEfp7LBayAJKAKjwFN2KvdS\n\tmY1Q==",
        "X-Gm-Message-State": "APjAAAXimgNR2LxsKLC3F1t5okB/SPA/w6wB2WD0jzsy62L9LQkvgNfE\n\tFUXk8coImsojW21dL6RPxAwVOADA+qKPkA==",
        "X-Google-Smtp-Source": "APXvYqwN3Fz+Z2PRKAqVd9g7MtgEJwthiuH2BW1B24tgxCu6UbCiqFtJ3F9CflUA6BFEkH4jZubjog==",
        "X-Received": "by 2002:aa7:9193:: with SMTP id\n\tx19mr62292766pfa.108.1554237551676; \n\tTue, 02 Apr 2019 13:39:11 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Tue,  2 Apr 2019 13:39:05 -0700",
        "Message-Id": "<20190402203907.28679-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190402203907.28679-1-stephen@networkplumber.org>",
        "References": "<20180618213557.15209-2-stephen@networkplumber.org>\n\t<20190402203907.28679-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH v4 1/3] app/testpmd: add ability to set Tx IP and\n\tUDP parameters",
        "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": "Use RFC 2544 standard values for Tx only test as default IP\naddress and port.  But let the user override those values on command line.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\nv4 - update documentation to be more precise\n     support new tx-multi-flow addresses\n\n app/test-pmd/parameters.c             | 49 +++++++++++++++++++++++++++\n app/test-pmd/testpmd.h                |  6 ++++\n app/test-pmd/txonly.c                 | 22 +++++++-----\n doc/guides/testpmd_app_ug/run_app.rst | 12 ++++++-\n 4 files changed, 79 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 7b6b60905dce..8b523a5c66ed 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -19,6 +19,7 @@\n #include <stdint.h>\n #include <unistd.h>\n #include <inttypes.h>\n+#include <arpa/inet.h>\n \n #include <rte_common.h>\n #include <rte_byteorder.h>\n@@ -65,6 +66,7 @@ usage(char* progname)\n #ifdef RTE_LIBRTE_CMDLINE\n \t       \"--eth-peers-configfile= | \"\n \t       \"--eth-peer=X,M:M:M:M:M:M | \"\n+\t       \"--tx-ip=SRC,DST | --tx-udp=PORT | \"\n #endif\n \t       \"--pkt-filter-mode= |\"\n \t       \"--rss-ip | --rss-udp | \"\n@@ -645,6 +647,8 @@ launch_args_parse(int argc, char** argv)\n \t\t{ \"mlockall\",\t\t\t0, 0, 0 },\n \t\t{ \"no-mlockall\",\t\t0, 0, 0 },\n \t\t{ \"mp-alloc\",\t\t\t1, 0, 0 },\n+\t\t{ \"tx-ip\",\t\t\t1, 0, 0 },\n+\t\t{ \"tx-udp\",\t\t\t1, 0, 0 },\n \t\t{ \"noisy-tx-sw-buffer-size\",\t1, 0, 0 },\n \t\t{ \"noisy-tx-sw-buffer-flushtime\", 1, 0, 0 },\n \t\t{ \"noisy-lkup-memory\",\t\t1, 0, 0 },\n@@ -743,6 +747,51 @@ launch_args_parse(int argc, char** argv)\n \t\t\t\tnb_peer_eth_addrs++;\n \t\t\t}\n #endif\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"tx-ip\")) {\n+\t\t\t\tstruct in_addr in;\n+\t\t\t\tchar *end;\n+\n+\t\t\t\tend = strchr(optarg, ',');\n+\t\t\t\tif (end == optarg || !end)\n+\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t \"Invalid tx-ip: %s\", optarg);\n+\n+\t\t\t\t*end++ = 0;\n+\t\t\t\tif (inet_aton(optarg, &in) == 0)\n+\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t \"Invalid source IP address: %s\\n\", optarg);\n+\t\t\t\ttx_ip_src_addr = rte_be_to_cpu_32(in.s_addr);\n+\n+\t\t\t\tif (inet_aton(end, &in) == 0)\n+\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t \"Invalid destination IP address: %s\\n\", optarg);\n+\t\t\t\ttx_ip_dst_addr = rte_be_to_cpu_32(in.s_addr);\n+\t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"tx-udp\")) {\n+\t\t\t\tchar *end = NULL;\n+\n+\t\t\t\terrno = 0;\n+\t\t\t\tn = strtoul(optarg, &end, 10);\n+\t\t\t\tif (errno != 0 || end == optarg || n > UINT16_MAX ||\n+\t\t\t\t    !(*end == '\\0' || *end == ','))\n+\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t \"Invalid UDP port: %s\\n\", optarg);\n+\t\t\t\ttx_udp_src_port = n;\n+\t\t\t\tif (*end == ',') {\n+\t\t\t\t\tchar *dst = end + 1;\n+\n+\t\t\t\t\tn = strtoul(dst, &end, 10);\n+\t\t\t\t\tif (errno != 0 || end == dst ||\n+\t\t\t\t\t    n > UINT16_MAX || *end)\n+\t\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t\t \"Invalid destination UDP port: %s\\n\",\n+\t\t\t\t\t\t\t dst);\n+\t\t\t\t\ttx_udp_dst_port = n;\n+\t\t\t\t} else {\n+\t\t\t\t\ttx_udp_dst_port = n;\n+\t\t\t\t}\n+\n+\t\t\t}\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"nb-ports\")) {\n \t\t\t\tn = atoi(optarg);\n \t\t\t\tif (n > 0 && n <= nb_ports)\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex a45988ebc524..18d2c1ef1eaf 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -443,6 +443,12 @@ extern int8_t tx_pthresh;\n extern int8_t tx_hthresh;\n extern int8_t tx_wthresh;\n \n+extern uint16_t tx_udp_src_port;\n+extern uint16_t tx_udp_dst_port;\n+\n+extern uint32_t tx_ip_src_addr;\n+extern uint32_t tx_ip_dst_addr;\n+\n extern struct fwd_config cur_fwd_config;\n extern struct fwd_engine *cur_fwd_eng;\n extern uint32_t retry_enabled;\ndiff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c\nindex def52a0487ea..ed5e715ea648 100644\n--- a/app/test-pmd/txonly.c\n+++ b/app/test-pmd/txonly.c\n@@ -40,11 +40,13 @@\n \n #include \"testpmd.h\"\n \n-#define UDP_SRC_PORT 1024\n-#define UDP_DST_PORT 1024\n+/* use RFC863 Discard Protocol */\n+uint16_t tx_udp_src_port = 9;\n+uint16_t tx_udp_dst_port = 9;\n \n-#define IP_SRC_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 1)\n-#define IP_DST_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 2)\n+/* use RFC5735 / RFC2544 reserved network test addresses */\n+uint32_t tx_ip_src_addr = (192U << 24) | (18 << 16) | (0 << 8) | 1;\n+uint32_t tx_ip_dst_addr = (192U << 24) | (18 << 16) | (0 << 8) | 2;\n \n #define IP_DEFTTL  64   /* from RFC 1340. */\n #define IP_VERSION 0x40\n@@ -105,8 +107,8 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,\n \t * Initialize UDP header.\n \t */\n \tpkt_len = (uint16_t) (pkt_data_len + sizeof(struct udp_hdr));\n-\tudp_hdr->src_port = rte_cpu_to_be_16(UDP_SRC_PORT);\n-\tudp_hdr->dst_port = rte_cpu_to_be_16(UDP_DST_PORT);\n+\tudp_hdr->src_port = rte_cpu_to_be_16(tx_udp_src_port);\n+\tudp_hdr->dst_port = rte_cpu_to_be_16(tx_udp_dst_port);\n \tudp_hdr->dgram_len      = RTE_CPU_TO_BE_16(pkt_len);\n \tudp_hdr->dgram_cksum    = 0; /* No UDP checksum. */\n \n@@ -121,8 +123,8 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,\n \tip_hdr->next_proto_id = IPPROTO_UDP;\n \tip_hdr->packet_id = 0;\n \tip_hdr->total_length   = RTE_CPU_TO_BE_16(pkt_len);\n-\tip_hdr->src_addr = rte_cpu_to_be_32(IP_SRC_ADDR);\n-\tip_hdr->dst_addr = rte_cpu_to_be_32(IP_DST_ADDR);\n+\tip_hdr->src_addr = rte_cpu_to_be_32(tx_ip_src_addr);\n+\tip_hdr->dst_addr = rte_cpu_to_be_32(tx_ip_dst_addr);\n \n \t/*\n \t * Compute IP header checksum.\n@@ -253,7 +255,9 @@ pkt_burst_transmit(struct fwd_stream *fs)\n \t\t\t * packet generator for developer's quick performance\n \t\t\t * regression test.\n \t\t\t */\n-\t\t\taddr = (IP_DST_ADDR | (ip_var++ << 8)) + rte_lcore_id();\n+\t\t\taddr = (tx_ip_dst_addr | (ip_var++ << 8))\n+\t\t\t\t+ rte_lcore_id();\n+\n \t\t\tip_hdr->src_addr = rte_cpu_to_be_32(addr);\n \t\t}\n \t\tcopy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt,\ndiff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst\nindex b717b8c7b742..a72f94923210 100644\n--- a/doc/guides/testpmd_app_ug/run_app.rst\n+++ b/doc/guides/testpmd_app_ug/run_app.rst\n@@ -121,12 +121,22 @@ The commandline options are:\n        XX:XX:XX:XX:XX:02\n        ...\n \n-\n *   ``--eth-peer=N,XX:XX:XX:XX:XX:XX``\n \n     Set the MAC address ``XX:XX:XX:XX:XX:XX`` of the peer port N,\n     where 0 <= N < ``CONFIG_RTE_MAX_ETHPORTS`` from the configuration file.\n \n+*   ``--tx-ip=SRC,DST``\n+    Set the source and destination IP address used when doing transmit only test.\n+    The defaults address values are source 192.18.0.1 and\n+    destination 192.18.0.2. These are special purpose addresses\n+    reserved for benchmakring (RFC 2544).\n+\n+*   ``--tx-udp=SRC[,DST]``\n+    Set the source and destination UDP port number for transmit test only test.\n+    The default port is the port 9 which is defined for the discard protocol\n+    (RFC 863).\n+\n *   ``--pkt-filter-mode=mode``\n \n     Set Flow Director mode where mode is either ``none`` (the default), ``signature`` or ``perfect``.\n",
    "prefixes": [
        "v4",
        "1/3"
    ]
}