From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60070.outbound.protection.outlook.com [40.107.6.70]) by dpdk.org (Postfix) with ESMTP id 1CD2B1B010 for ; Fri, 15 Dec 2017 22:11:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PDfD+zTx819wo6PjQmyZAfnnjlVSugbZsLgQ10iyO7U=; b=EmhNbmQc5O8CsrXksQqgtA6K4ZUTJLIDoAwWoSRO05OOWqcSBPHF2q+HDPq0LHr4yqmswMEYNi4yLMT6fdJEUCz2bNFJ0f/rgkLvU2glOOvl2MTiqn4H7E+W9YE52wjia+1pR2Q1OrT+kAlwXSw0Zi/ZpElO4hlK8q4hgWlWrxM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by AM5PR0501MB2034.eurprd05.prod.outlook.com (2603:10a6:203:1a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Fri, 15 Dec 2017 21:11:39 +0000 From: Yongseok Koh To: jingjing.wu@intel.com Cc: dev@dpdk.org, Yongseok Koh Date: Fri, 15 Dec 2017 13:11:25 -0800 Message-Id: <20171215211125.39177-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: YQXPR0101CA0013.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:15::26) To AM5PR0501MB2034.eurprd05.prod.outlook.com (2603:10a6:203:1a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dfd6efd4-d5e7-45e7-1d62-08d544006f97 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:AM5PR0501MB2034; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 3:jfdmysp38UM6UyJYeya4LLRQrBp+azd/l0f4yRT3ahsRaUyY/Hv2XDgNw/74QKHNS5DbqoMiBrFwkPPGh7mo7hTvL40RCId9YXetff6jsPk5FuX9H7edbkI30z501+RDwKZQFRKcQghGxafmg4UOBVvgOV6sns3bdgijIYs1KurmUu9CTKVWtsiK3JBWKR3Gy5rqNVit7Go4T8wj4XCNTuB/EwGK3uAJ0nCFbABOntxBQutr6Djc/YchKBmZzBcN; 25:+ETWlvM7ohDY/AxPVcv2bDBktaP9zBSn7IeqyZKOQXmZFMrydgEYjsANdHO8TxdVoW2SllCfu6+uh9dqAuxaGGVV9q+NI9EPexf1nxbAByI2oY/KaBzbZxoX9KZw8bqgX1Zto1EWW20HFTTw68V4TP1WYnjbkLt0qHoL/DcPCLeC5nQVyzbyQRIqHEIIsmK6zi5eM6zglOkZXUfEocrQ7zxMWzIRA9fWx0020slZIDNtldDTRvpoUyXHh/tF8ijxvP7ChFq+mYWMv0ypO487oJegp7ZZkTmU5m1S9cKQjlWzFbuWyoQk8kGVjtsDCUNg+tCV2dF6hY6lmIpOWTC4RA==; 31:ThimFf4pqZE6WWbnisXvWyqs2FsGAW56J83FoETWH0dV0G4bGf37UJEO9Re0vAdQP/Dom0zlEFK1XXjX1bDen94G4bJXMRahof1tPAtZa3ArSiDFvy9QTwQy4aJXmAMhQn4226+1b3gPP3bZuXuiSr5jyguP29RrdzcE1I6hN8LFBCKulossVetWvGYDiBMHErqZ0O0G4FWVmHSwNscxpB2wiA4gdbnMyUgHe0q5Tf4= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2034: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 20:gelWVoQCEkxU4+maeBPDieCqt/c1zTio1ABssqbhuPzldTXZm0LBTSwBcvQ3Yoea0T9rURd4Zys/VM7P20G2dED0xLLwCJX7UGDxhdYo0Mkn6L+yqTYscIVz5uKG6P1HZIHMsBO/HXU3TixeXMniQ+i+xcWaBDSMzzgraGWxK+GFeMBhsOySzt59P1h10UclbRJ00m/JB6FlYUGLi3spneOGSydr54qxDHP5ste+b7f3da2qPG0yBFlAybzT4XXdn+W9tOsBHsfJIiRXHJAdc27D1xI6RDHdQT+4ITVO23kkl4r45xjKwaTHVWbI/fvQlTsJrGXYJKrGoTQF8FzX7hmWHbPSWjbn450jSKUA2naOU5Kem3+Mo6ZPMlAlJp6IKYQbIQTOQcZfdpIpgxD/aZXNL4D4EkS1Kgpo3pKKdbWgAx2jsdQqybc1GNVtZ2t8sNqYq6d6UIGTZhbjbrN20o53ruEDoDN7shxFNcEidYJpib4z0AriZ3w/yrK1MWsQ; 4:Jb2AFMfpAkboqmGBS7V98MC0P2JE+fjxWVXWiYRn0Z3qqONaHL0iEaAYvLhqLXbRHxIiSrq9INq6EgMUbfKEFOFrvGWsbF6Ekh/4wkvW84kwjt0Lwbp6+Ge0l250Z/bfCtjON6zu8Yfn3O9hxu9YQ2GdH+XZwdKudqNVNYl80/7/wPPCiY97lRuOnkny2Et3egNqfki3GBjc2zApl8gylzxgWnr7djPcCrOhQcg3rModBFBCtq6wnNsOZxi4NkhamBSs56I5EaDKr5FKV6mTGw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123562025)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM5PR0501MB2034; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM5PR0501MB2034; X-Forefront-PRVS: 05220145DE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(396003)(376002)(366004)(199004)(189003)(7736002)(105586002)(106356001)(97736004)(68736007)(2906002)(69596002)(4326008)(2361001)(2351001)(6116002)(25786009)(386003)(59450400001)(1076002)(16586007)(55016002)(36756003)(16526018)(3846002)(50226002)(50466002)(8676002)(8936002)(81156014)(81166006)(478600001)(53936002)(51416003)(7696005)(52116002)(48376002)(5660300001)(6666003)(305945005)(86362001)(21086003)(47776003)(107886003)(66066001)(6916009)(316002)(20673002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2034; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2034; 23:FUqcW5xV6miJ9fK98gwun94YLbbaD6eaPf8bF7I?= =?us-ascii?Q?gCPwOKXr3OH2PPAfTfykbdhwgpiRcW6gCD3Wz3KVG086uq7j7a2qFGtUuVNC?= =?us-ascii?Q?VTM7cWbo8vJmHdZGML8dXdaHoU/VpXepyZvfjt9vS+Zd2fIHGaM4fA4v+YZe?= =?us-ascii?Q?Egn5WgLBO2Rmy8gRHjH4TOef6QdfAOV8ygg/RzMZ6HcD8mb/uVFMaKs4G//c?= =?us-ascii?Q?4iiE08NVcovgfvrGZbUjzJuWtV+Wc8cQFl/7BkB3a+n0QLDiX+/OnMtZk3e2?= =?us-ascii?Q?J0vA0ff6YWPPQeCSMVjEb/kbIvqCfQNI8JF0Cp8U+Oln0RX3qVJaOaiZqNEy?= =?us-ascii?Q?xC6atAq8eqeUsy51ZDqYzyBtzr3uJ9sgF5H7SMs80NmRIIl1rG6VeXrgunAQ?= =?us-ascii?Q?Pxo94QWUWoScPKZYofTuTFT1t9N/50LiRpCIfDvv+I9jFZhkrzh5hSw6OAvB?= =?us-ascii?Q?rNvz9Q9fGfY1JPe88yJpiF+UNGQ0UJZ0sZH785EbNl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JbeppLOCzdco/P+A9OvkFyKcYleXPVf02+PwE66C11yobPb2OCinQxHv0TG+Ag4f2/8h3U7ySsfXXQOSxMcmya98OOeRYinfVF40MBVTa/1jd20QCNWFnv2EKzBsA=; 5:bbKi+TdkU9D9Y6VyvrYwMFQ7lLO5+SmyRPeUWkhpap1qBbn0eFHLOMNvAD/0WqaCk1/5SIF92B69/IlUHv41ApQttlf1uRfrHY3en4y4JmAEWV5OxrsztyHK4kbJFv/+4ny7OSz2gJ7M0p1LIll81H6zQGAk5rAqf5+2WxNth4o=; 24:wNHT0npb5KQHNb/uZoXKuTqqsBoYkRBqQ5iG/O3719/MN+9k7efiLTrvLexjygfJrvzoyNZsLlnDuyUaGYIruysZrT9Lao85amFaoFqi6bM=; 7:eCFbYdSKQ+yXBBOOmo7VAM2eWLks7egyeAkkPOFWz4t4tp7nsKWtbCFMXZK403dMR0OMPpjmTHMAIGaJfdIOcpCV8htCs2awbBhQAc2bCbbc1IH5LuRPkVP93w3GVD4u6OKkJahdCrj2aAQAUmo+vLtvmj/UnV8l53TEWgp2gYzZBsCDdIZxmj0jVFcQKoCtj7TZyTujGmBV2tL6uzG8DSFoIxWu1R7cwiMVD86omMz+X1iEjq8f7iE9mHl8VCDH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 21:11:39.6592 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfd6efd4-d5e7-45e7-1d62-08d544006f97 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2034 Subject: [dpdk-dev] [PATCH] app/testpmd: make txonly mode generate multiple flows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Dec 2017 21:11:42 -0000 Testpmd can generate multiple flows without taking much cost and this could be a simple traffic generator for developer's quick tests. IP destination address is varied. Signed-off-by: Yongseok Koh --- app/test-pmd/txonly.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index 309c73893..aa4c379c4 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -73,7 +73,7 @@ #define UDP_DST_PORT 1024 #define IP_SRC_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 1) -#define IP_DST_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 2) +#define IP_DST_ADDR ((192U << 24) | (168 << 16)) #define IP_DEFTTL 64 /* from RFC 1340. */ #define IP_VERSION 0x40 @@ -81,6 +81,7 @@ #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) static struct ipv4_hdr pkt_ip_hdr; /**< IP header of transmitted packets. */ +static __thread uint8_t ip_var; /**< IP address variation */ static struct udp_hdr pkt_udp_hdr; /**< UDP header of transmitted packets. */ static void @@ -187,6 +188,7 @@ pkt_burst_transmit(struct fwd_stream *fs) struct rte_mbuf *pkt_seg; struct rte_mempool *mbp; struct ether_hdr eth_hdr; + struct ipv4_hdr *ip_hdr; uint16_t nb_tx; uint16_t nb_pkt; uint16_t vlan_tci, vlan_tci_outer; @@ -263,6 +265,14 @@ pkt_burst_transmit(struct fwd_stream *fs) copy_buf_to_pkt(ð_hdr, sizeof(eth_hdr), pkt, 0); copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt, sizeof(struct ether_hdr)); + ip_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, + sizeof(struct ether_hdr)); + /* + * Generate multiple flows by varying IP dest addr. + */ + ip_hdr->dst_addr = + rte_cpu_to_be_32(IP_DST_ADDR | (ip_var++ << 8) | + (rte_lcore_id() + 1)); copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr)); -- 2.11.0