get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52616,
    "url": "http://patches.dpdk.org/api/patches/52616/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190410174132.8349-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": "<20190410174132.8349-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190410174132.8349-2-stephen@networkplumber.org",
    "date": "2019-04-10T17:41:30",
    "name": "[v6,1/3] app/testpmd: add ability to set Tx IP and UDP parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "be109c05911ccb993126ea22d766f775c1ecd044",
    "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/20190410174132.8349-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4249,
            "url": "http://patches.dpdk.org/api/series/4249/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4249",
            "date": "2019-04-10T17:41:29",
            "name": "use IPv4 addresses reserved for testing",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/4249/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52616/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/52616/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 CB36F1B399;\n\tWed, 10 Apr 2019 19:41:44 +0200 (CEST)",
            "from mail-pl1-f196.google.com (mail-pl1-f196.google.com\n\t[209.85.214.196]) by dpdk.org (Postfix) with ESMTP id D22A21B184\n\tfor <dev@dpdk.org>; Wed, 10 Apr 2019 19:41:37 +0200 (CEST)",
            "by mail-pl1-f196.google.com with SMTP id b3so1848575plr.7\n\tfor <dev@dpdk.org>; Wed, 10 Apr 2019 10:41:37 -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\tl69sm50229696pga.73.2019.04.10.10.41.35\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 10 Apr 2019 10:41:35 -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=q0j+XL4ZZy9Nf7Q4yVLCZ+DpoSzsAi9uKtvFjbtVHX4=;\n\tb=sW72R+LS4abR4ivqm12ohSkWqcD0EB6tYnTT09Tq2fD5pPbkkgSswMpQlniC7D9kpA\n\tRf1oHdCI/eT0SHls66t+fIQrMIszA1lgEk1QuxOoNia/Va4ec71bzHGXUDDGblA526Tp\n\t4x2co0KfVUKyz2hj2+l/HsfngL0hEzwGG8KpGMkpeg/pADIkrGS0iQ/zn/+ifZUbgFv+\n\tsSWnI7nN2YlZq1ALzLGyX086nM+8e7MNm0Q2ciboPdtMJRmY2m+Wb9hTFH2IAV59bt2L\n\t03uTkrlCG0DKbc2Qu2Uknapjj/P/yN2P6R7H/51i7q2fJhJOkhU6YDtdLhZlobgQdCgW\n\tH0Mw==",
        "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=q0j+XL4ZZy9Nf7Q4yVLCZ+DpoSzsAi9uKtvFjbtVHX4=;\n\tb=hqpam0Cr4RqhnW5b0eUvYjT+emohkHXdTzArSALwSNRw7i4uVzPLnDikULzsNnkmFQ\n\tXn/myfKntd8Fzrkv7nFFF5NmipujQW5dwWKdz/V2htUoh2CgcTUzIq0MkCr+5hRq8B99\n\t6FYs4DPx+NfH4iN8tNjNZFR0PjI16vaX3cgATXcE9aPMRAAtU9+SBt/alqO1uX8xKYtR\n\tM3Bx6JLegIeEy3S+Zfbxi9bEdQfAMtLooL7sjOZeqIoUy6er5iLtMGCILT/xWjCnoyTI\n\t9snM3+TXMvPIOSNZd0NVdMVW4TmTHxAvbrLJxFm+h21kRI+L8U7g9Xz6Y2xHS/W/T6i3\n\tSY1A==",
        "X-Gm-Message-State": "APjAAAXWRUMcyAiAwt3XMKZ0+XLtH2R3iJ0MoaMDkDH1PDIfHYTtAfII\n\tv30w/ovWrW9BiWvmfwK/40LPoAz75CVbXA==",
        "X-Google-Smtp-Source": "APXvYqwc+S2anPrAzT/Fh3harcZUDPTZv2yl7Nvr8ktMMc5fG3shokGa91vmgddVFcm1XUUk5vaLvg==",
        "X-Received": "by 2002:a17:902:f81:: with SMTP id\n\t1mr45799584plz.216.1554918096268; \n\tWed, 10 Apr 2019 10:41:36 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Wed, 10 Apr 2019 10:41:30 -0700",
        "Message-Id": "<20190410174132.8349-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190410174132.8349-1-stephen@networkplumber.org>",
        "References": "<20190409182006.12944-1-stephen@networkplumber.org>\n\t<20190410174132.8349-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH v6 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": "This patch changes what testpmd uses as IP addresses when\nrun in transmit only mode. The old code was using\n192.168.0.1 -> 192.168.0.2\nbut these addresses are reserved for private Internet by RFC 1918.\n\nThe new code uses 192.18.0.1 and 192.18.0.2 which are on the\nsubnet reserved for performance testing by RFC 2544.\n\nNew command line option allows the user to pick any other src/dst\naddress desired.\n\nNotice: this changes the default IP address for transmit only.\nIt may cause some user who has hardcoded network addresses to report\na regression.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\nv6 - fix formatting of document and break long lines\n\n app/test-pmd/parameters.c             | 53 +++++++++++++++++++++++++++\n app/test-pmd/testpmd.h                |  6 +++\n app/test-pmd/txonly.c                 | 20 +++++-----\n doc/guides/testpmd_app_ug/run_app.rst | 14 ++++++-\n 4 files changed, 83 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 7b6b60905dce..d358cda2451f 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,55 @@ 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\",\n+\t\t\t\t\t\t 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\",\n+\t\t\t\t\t\t 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+\t\t\t\t    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\",\n+\t\t\t\t\t\t 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 66e63788a25e..632d655235f0 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@@ -206,7 +208,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,\n \t\t * packet generator for developer's quick performance\n \t\t * regression test.\n \t\t */\n-\t\taddr = (IP_DST_ADDR | (ip_var++ << 8)) + rte_lcore_id();\n+\t\taddr = (tx_ip_dst_addr | (ip_var++ << 8)) + rte_lcore_id();\n \t\tip_hdr->src_addr = rte_cpu_to_be_32(addr);\n \t}\n \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..a3e8e9bf2de2 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,24 @@ 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+\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 benchmarking (RFC 2544).\n+\n+*   ``--tx-udp=SRC[,DST]``\n+\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": [
        "v6",
        "1/3"
    ]
}