Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/40985/?format=api
http://patches.dpdk.org/api/patches/40985/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180611182526.32327-3-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": "<20180611182526.32327-3-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20180611182526.32327-3-stephen@networkplumber.org", "date": "2018-06-11T18:25:26", "name": "[v2,2/2] testpmd: add ability to set tx IP and UDP parameters", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "997c94a9f90d006bf5de16009bce2416b460aa3d", "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/20180611182526.32327-3-stephen@networkplumber.org/mbox/", "series": [ { "id": 84, "url": "http://patches.dpdk.org/api/series/84/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=84", "date": "2018-06-11T18:25:24", "name": "testpmd: allow configure of Tx IP parameters", "version": 2, "mbox": "http://patches.dpdk.org/series/84/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/40985/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/40985/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 CBCCF1E3AC;\n\tMon, 11 Jun 2018 20:25:37 +0200 (CEST)", "from mail-pf0-f193.google.com (mail-pf0-f193.google.com\n\t[209.85.192.193]) by dpdk.org (Postfix) with ESMTP id 279DC1E379\n\tfor <dev@dpdk.org>; Mon, 11 Jun 2018 20:25:34 +0200 (CEST)", "by mail-pf0-f193.google.com with SMTP id y8-v6so1606731pfm.10\n\tfor <dev@dpdk.org>; Mon, 11 Jun 2018 11:25:34 -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\tg2-v6sm2982041pfc.4.2018.06.11.11.25.31\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Jun 2018 11:25:31 -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=t2FjeMIpY9tCm1bYZjQwIp5dZ0qUnAxWGPr/dxWUNZk=;\n\tb=uv5JVKzwgAKS7LQYd1MOUrBwmIzN9fNqonOUVh3iGaAgU2gaDT5sYD8vetENk5mGyh\n\t4KtKq6q0AW8HZ7b0Wz/lh8Z7mJo4m06IF23ETgBNXb+fiG42oOobNRDnYy7ei3vy3hqK\n\tvBqOvT+gi97XDe9N7ZDMcbaU4dE7ddqTwOi5XyRf2cz0rYsiAu6pVv0CB0Aclyte4xnU\n\tfIcLV5mngm0M/Ukz51uQV7cnVt5A3KDjkMW9lTix4pl7IN8rVTKNlCgiT+a0OJOKij3G\n\tMCPQi//e/MymndOYi+13o03mo3kcf4Xbkq8B9fVY+fKRMbritRWKWIUq1hbbIkB9+wSW\n\tt2Vg==", "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=t2FjeMIpY9tCm1bYZjQwIp5dZ0qUnAxWGPr/dxWUNZk=;\n\tb=qH0IQjVnA1vnPYE7hVZszt694hDYZQcJy3O1NGO4IWBeIe3CfuejfHUWWdd6ZZzGSI\n\t56It0iEmHN5WbSmdPT9yveMRn8OjbtBJtr8h6Aceao2bkkLvU8mxrILcypWvrjvJ/Ehk\n\tMq/Jf8t12zu+eWknK2M3tDp5v2VY+fI8t1Zs9s1Rhpnf1oIT5EJgOnOen0HvPMU2InEh\n\tQNuIbFGGZ9h5qsXkQYqbjV0yHqCqobOraFHHfQw4tKOa9qlUGGGUkc7Av/QyyvQCXo3x\n\tVai8o9URpabRkm6D9ffJZCK3OqWaCa0rPuW9gKEl7SpdhnCMmoqwX8u7CRNwO7+tKWt4\n\twkJg==", "X-Gm-Message-State": "APt69E09qB9NLEAWkgG+NRwUY8b4vZ+x18CijyRf26HYrfIakh9HpkJo\n\t2dWZSPo09/bUYF8POYth7CHJLuxfPqI=", "X-Google-Smtp-Source": "ADUXVKJiko9ka95ztc2t08MLn3JqzN/9PaSMjAYv8fReqrGOfm9aSdp16D05GYscIOZ6ab/k9kbKoQ==", "X-Received": "by 2002:a62:9e88:: with SMTP id\n\tf8-v6mr305113pfk.206.1528741533067; \n\tMon, 11 Jun 2018 11:25:33 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Date": "Mon, 11 Jun 2018 11:25:26 -0700", "Message-Id": "<20180611182526.32327-3-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20180611182526.32327-1-stephen@networkplumber.org>", "References": "<20180611182526.32327-1-stephen@networkplumber.org>", "Subject": "[dpdk-dev] [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP\n\tparameters", "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Allow user to override the hard coded IP address and UDP\nport values in Tx only test.\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 | 16 ++++-----\n doc/guides/testpmd_app_ug/run_app.rst | 9 +++++\n 4 files changed, 72 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 a24000e3af44..6d7ddf99d639 100644\n--- a/app/test-pmd/txonly.c\n+++ b/app/test-pmd/txonly.c\n@@ -41,12 +41,12 @@\n #include \"testpmd.h\"\n \n /* RFC863 discard port */\n-#define UDP_SRC_PORT 9\n-#define UDP_DST_PORT 9\n+uint16_t tx_udp_src_port = 9;\n+uint16_t tx_udp_dst_port = 9;\n \n /* RFC2544 reserved test subnet 192.18.0.0 */\n-#define IP_SRC_ADDR ((192U << 24) | (18 << 16) | (0 << 8) | 1)\n-#define IP_DST_ADDR ((192U << 24) | (18 << 16) | (0 << 8) | 2)\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@@ -106,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@@ -122,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": [ "v2", "2/2" ] }{ "id": 40985, "url": "