Show a patch.

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

{
    "id": 41235,
    "url": "http://patches.dpdk.org/api/patches/41235/?format=api",
    "web_url": "http://patches.dpdk.org/patch/41235/",
    "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"
    },
    "msgid": "<20180618213557.15209-2-stephen@networkplumber.org>",
    "date": "2018-06-18T21:35:55",
    "name": "[v3,1/3] testpmd: add ability to set tx IP and UDP parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f7d8b1edddb1bb6b4789724f22d9308a5500280e",
    "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/patch/41235/mbox/",
    "series": [
        {
            "id": 157,
            "url": "http://patches.dpdk.org/api/series/157/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=157",
            "date": "2018-06-18T21:35:54",
            "name": "use RFC addresses for testing",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/157/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41235/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41235/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.17.1",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "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=K/RbMRXH+tC2fmTJM9CxU2swZJtOBhzqhQDwvzIlVX0=;\n\tb=yejtO+ssA2LhEQ/kXRANGDRP/+/g5AzTGw7UKXZR65qVtfv6R6jOmiPjQ+U0tjc1sU\n\tWIpdwy8ORltqQ5ZCExMe1q48F6mbUjRNz+zIaAAnKmAf5u9plluaFOxEolc+YlUj5Jb7\n\ti10+7SlHNm3Q5uZlomxRqGz1e3NMvNqHizCO5cDsTWwZFNVft2WMlU6BSSiAdFhioVbY\n\tnFLv6yUF65nufvmu7MjOkYggPYVYkv8i9BfMOXMXB0v5Y9ffJIYWQiTKxnKo3xJDj854\n\tINsxV/7lOg6/uHTlpW0D91nk3wOr6degNZITwIPJuvZyf5Eq/auZcLsLnQj0MOPuiTKf\n\tj9Qw==",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "X-Gm-Message-State": "APt69E0MSRo9Zv+r7eZ7CQVNXF7LPLuhmRv5npxabr64VfgFvhqndwF/\n\tsOR+zpIJNUOPvGOkTI13/bHzWrtbvAQ=",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<20180618213557.15209-1-stephen@networkplumber.org>",
        "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=K/RbMRXH+tC2fmTJM9CxU2swZJtOBhzqhQDwvzIlVX0=;\n\tb=j58q6/eYQKSiny75S21wdWi2w/8ngo2HdEZWa7eSQdErELMUVgtnSls1PCrIlfa4nh\n\toX3cvHv0KILKtxl2Dn1iu/Df2jc68zCm0sL1S3Z+9OvDubQAEFPDjt/yjykDen0sHlGa\n\ttwD4CY0dKe01JK126G/nfihDbOGU2Vlw4+Bl5s4nQn2UQNxNL5JaffEnw8Obtfi2lwvF\n\tSRlKsoDPBamwgs6XFcGTjT3QQCyYYjKdQ1INj/0Lr1oLCfO3vR4m+tuH2zTgIsRJ241+\n\tL00rrbNOpoYSn08DZ5MoJan3frDTpGF8izJ7fNAJY1XV9kt1E0dl0DNXDS2w1vHuZVIJ\n\t16yA==",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4A6563230;\n\tMon, 18 Jun 2018 23:36:04 +0200 (CEST)",
            "from mail-pl0-f47.google.com (mail-pl0-f47.google.com\n\t[209.85.160.47]) by dpdk.org (Postfix) with ESMTP id D7DF02C0C\n\tfor <dev@dpdk.org>; Mon, 18 Jun 2018 23:36:01 +0200 (CEST)",
            "by mail-pl0-f47.google.com with SMTP id g20-v6so9740870plq.1\n\tfor <dev@dpdk.org>; Mon, 18 Jun 2018 14:36:01 -0700 (PDT)",
            "from xeon-e3.lan (204-195-35-107.wavecable.com. [204.195.35.107])\n\tby smtp.gmail.com with ESMTPSA id\n\tn70-v6sm34246969pfh.140.2018.06.18.14.35.59\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 18 Jun 2018 14:35:59 -0700 (PDT)"
        ],
        "Date": "Mon, 18 Jun 2018 14:35:55 -0700",
        "X-Received": "by 2002:a17:902:2884:: with SMTP id\n\tf4-v6mr15864704plb.204.1529357760749; \n\tMon, 18 Jun 2018 14:36:00 -0700 (PDT)",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v3 1/3] testpmd: add ability to set tx IP and UDP\n\tparameters",
        "In-Reply-To": "<20180618213557.15209-1-stephen@networkplumber.org>",
        "Message-Id": "<20180618213557.15209-2-stephen@networkplumber.org>",
        "Precedence": "list",
        "X-BeenThere": "dev@dpdk.org",
        "X-Original-To": "patchwork@dpdk.org",
        "X-Google-Smtp-Source": "ADUXVKL8nUtXdl7DB6lNlAYSKZNALVRB3uCbAlCq/jDxEor6laPWN4J9wWWeTSMr/pZZJHycfL0m7g=="
    },
    "content": "Use RFC standard values for Tx only test as defaults.\nBut let the user override those values on command line.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n app/test-pmd/parameters.c             | 49 +++++++++++++++++++++++++++\n app/test-pmd/testpmd.h                |  6 ++++\n app/test-pmd/txonly.c                 | 18 +++++-----\n doc/guides/testpmd_app_ug/run_app.rst |  9 +++++\n 4 files changed, 74 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 75807623c719..6d666e088fd9 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@@ -625,6 +627,8 @@ launch_args_parse(int argc, char** argv)\n \t\t{ \"vxlan-gpe-port\",\t\t1, 0, 0 },\n \t\t{ \"mlockall\",\t\t\t0, 0, 0 },\n \t\t{ \"no-mlockall\",\t\t0, 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{ 0, 0, 0, 0 },\n \t};\n \n@@ -717,6 +721,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 f51cd9dd9bbd..48f7b364e9b3 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -444,6 +444,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 1f08b6ed37a2..689c53eb73f8 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@@ -104,8 +106,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@@ -120,8 +122,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.\ndiff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst\nindex f301c2b6f709..ae9eb712e209 100644\n--- a/doc/guides/testpmd_app_ug/run_app.rst\n+++ b/doc/guides/testpmd_app_ug/run_app.rst\n@@ -249,6 +249,15 @@ The commandline options are:\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+\n+*   ``--tx-ip=SRC,DST``\n+    Set the source and destination IP address used when doing transmit only test.\n+    The defaults are source 192.18.0.1 and destination 192.18.0.2.\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 9 (discard).\n+\n *   ``--pkt-filter-mode=mode``\n \n     Set Flow Director mode where mode is either ``none`` (the default), ``signature`` or ``perfect``.\n",
    "prefixes": [
        "v3",
        "1/3"
    ]
}