From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60066.outbound.protection.outlook.com [40.107.6.66]) by dpdk.org (Postfix) with ESMTP id 074F01B2A9 for ; Wed, 17 Jan 2018 19:19:07 +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=kWtLjTQJYeU6wtRhsn9ZwFMjWDdwOo4rmBrnAVjc9ik=; b=DoQRz6xTQcqvsVwh6dSZxqhcciwctX4+5zTVS1xv/p5sLJA2+h0vyokDUU8hdVtgWXQeWZWxiCCpha+i8lLVeTYFVvw4uUryfQYaOWrzAM9yy67ZFytTL6BsaSnIH6q34fwnw4JtmEyE2beUkJZwsqg2iEcrslkUqDLYRD8OVC4= 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.407.7; Wed, 17 Jan 2018 18:19:04 +0000 From: Yongseok Koh To: wenzhuo.lu@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org, Yongseok Koh Date: Wed, 17 Jan 2018 10:18:46 -0800 Message-Id: <20180117181846.3565-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171215211125.39177-1-yskoh@mellanox.com> References: <20171215211125.39177-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: MWHPR2001CA0010.namprd20.prod.outlook.com (2603:10b6:301:15::20) To AM5PR0501MB2034.eurprd05.prod.outlook.com (2603:10a6:203:1a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2029e0da-40be-4c40-98ff-08d55dd6cb2c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM5PR0501MB2034; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 3:Sj+UfBuyXt9zCGyWYo7TQJFL/cv5eqMdolkiLDnMcmDKfHpzOMhgPk9/r5f5E0ckSZx0gxyJCPcDHY54wKJ5/yiDq1wbYYZhUQ7REdzgrro/bRTaCiaGkMyJ4et+6uuD2CAvDE8oSiliLlftkVXsIA4vL06miLpUw0e+0f1YKisLmo363K/RXjQbTq4hwM4riWXjsPhNPaT/v9BvsVghiUlZtp2kMp+kJD3S+v0kjDX/YbmB6QT2M0PSGbLLMGif; 25:aVve3WUkYuqJu2vdPhhvVBTGz/4v0AgW6POv9OsF93Z1oHCBc2EqkIkb0uRYaYkIMdloKjzBXJ68ZpIxHYPjguA7stCFliarnTnDUW21sWCAG2T7gyTyokGCAxKyR4oS4BjoJOZ6MKDJ6vJ+Us5rmhy5Rz/g/gNXZzQuWrtQ1Mb+uXWvPdoIUdMJ/xCV9hCPyt0aZyH7RmgLVd/9fs31+kER5puk2yoIpvKcY+/vJGtIS8qE8ecK5qTEX3cIioIs19ejHJcHlsEHHT2lJJxxwyJohxIeYCfQV8MweRWiy5tmgvzNlSRLvCU8QQpa79baF9rDIdMEwXg9rfVwMHDrhg==; 31:imdYNRxShiErm6guGMkrIUFjpNp8CnddDUaJ1+/r/LVCn30RdsTMsgonY8/Essbl7g5xVlDSfr6Fj88m/vFqOMIL+tJSpaVjS4Tk3VNLiZx8z4fX2ezhLhptBNfxDk25KpJkg4Z32uw9PcLLrQGJbBqsyl6mYku96vKMk7mKYXVk5IplWQ20A6/D+cFREFydVA2rFAKwVV2ttNmwQ6t42fTWD65e3xUWGXsLth5nyyM= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2034: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 20:4yQ9dS2Tt1W1Mp8x1IDe2Nd6FTVjLhadqtW8lEkokOvn/5pRk5i4kGgP+mjtjEL2bbwkz/NKYl4XOIlQSsDY0Yqv1rZtFYAQxe5z00tI0v2SCVALonvq9/1ztPTVxei/wt7QMHVEXID/06MO7gWSZR04hlko47Kc1r2ljlzxwZFWhq/7ZD9SprQAyuxc5fo3ZqckmTVGs9GRquc8TtrsjbVW7GVkKEfY0axJnXnOiTrkftUNmWRtEKIZcQVifJyiSwh+NB7WTVOJCni2H1VTy3Mzz/yRdrsRvNZacb0GR6VDR4gpjI1PFmgvzIxw0b5xVCTYab6nmttWk6WSg9u+D0NxK2URpAbzDYHorIlCYG3YFpuqoIhlL/xHo6s0woC+tdJ6fjAvAo+KPS97LVEKn09q3BIBLYV+pJ3PNVE/2CB4H5iyx7HClqx8HddwGZfYDEss6OBYMzTjqJh/AxNrTW5hkC5lH2hT3+6hJrI68HyF6hCNXEXT+tI30E573s8v; 4:6ncNfBkubN5XgrL0nvifXQO1iB0Ve8UtO29UXDfepWmiCzcJZcQDuMselI3pVwjEKQOiPlUmUE9QZWKckIQrSJ3+IK5KPGVZx76I7cSzk9oVOSMVEL7hspGZ3mwaaa3MSEuVtvcoRAV9BGN3EGvyBGTlI5Qn4P7K89fcvumqkCDTe+xR2C0b89cccpy+qrImE0tczHOA8ZS8hht6BDWcM8JSPRFvtIqhPQnb/eJb1ZKP0RkCioX5dwlj+e9Cq8SPk8cH3N1wHp80+lGWokmTMA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(944501161)(10201501046)(3002001)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:AM5PR0501MB2034; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM5PR0501MB2034; X-Forefront-PRVS: 0555EC8317 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(39380400002)(39860400002)(189003)(199004)(86362001)(106356001)(105586002)(69596002)(36756003)(50466002)(48376002)(47776003)(66066001)(50226002)(8936002)(7696005)(8676002)(68736007)(52116002)(21086003)(16526018)(81166006)(97736004)(81156014)(25786009)(305945005)(478600001)(59450400001)(386003)(51416003)(76176011)(16586007)(107886003)(2906002)(4326008)(316002)(7736002)(5660300001)(26005)(6666003)(2950100002)(6116002)(3846002)(1076002)(55016002)(53936002)(20673002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2034; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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:IiMaeHe1xHX9iMh4hpmbDgpkPXBOhg+lYHJ/tfr?= =?us-ascii?Q?xS6mmJ3EwabaDeaWXEQFlsBoHgdqznj3ptHHmkkBuBOkVfXqmLjNH5acGplz?= =?us-ascii?Q?x7jDU35SN30GwKbCFaD7fIgnT5t1jTMb1HkPdICqFaax+6mXqRNxCIAisdRG?= =?us-ascii?Q?9r1P1UW2G63xo5vSI642Xvibq8opkMMnQZ2KlhBerYlCZ4u/3pT1CxkmxfrC?= =?us-ascii?Q?/M2R9JKCp3/ycPEalGZ8G+utXH0qNz8iwLM92BB1wBJpM/4gNreleLOmLZEq?= =?us-ascii?Q?HnXON+6cuIWjSf58VndlqV56njaHh/oOpZ9HM/+Aqt7YVHO6LQyPMVqzf4Y/?= =?us-ascii?Q?KRld2fBowumxzMVqElGz7X4RhL+9jspATx2HSVt6AXqSS3Ow+oav6I/EgjP2?= =?us-ascii?Q?yBaciZJZRfcgMz69SUSZqlFopvK9owTzZ5w22cKr9Bl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sStfJKNEHJlXplDv/NWRlqu3AYWAfCJsK1oaGGld/zrlfG75sXf+7fhgMMDjs/qGWsjaE/1vGvu3nunqhbffU2m0dVG/kmyfQTZQSnvQFWe7C0cyDDcrRVSEp5wyFtRri4SAcTq4juaNT4OcYOzw8DUrewCqIu0tT+Y6pac9yGEmn/32jEL+yRNfi+8gLqxSyCpwjpTtvoCn5fpmD1hQe4PQeX6XTutR58WJnEqK0Cob8ZjlAuM0aVQ2olgg00twD/bbg=; 5:xtNNB9ZbbC8Zhmt7nmXHKK/joFsEwkJessl1Fq0uE1KhNAegVn2SNn0qZfI6Mm4aWT6dQHzl0t/i02jIdUSuTIat6Q4X44UrhuZ6G3G4jQsdC7KsGdsIiy1yZeIsKlvh3jML6yJIxmglCbNLdzbDgCZ6OX5QjR3fQlQ0QSTE96U=; 24:xhXLpJFvqx4BUmgbmBnjRYudiJmOIHxxnUAUtc5JmKoHD5pNXVLASysMFetG2ikolSI+rFYJsAdtpzlY+mh/h9cUPGdFz9XQXctMI+7v5a0=; 7:/HVWu52ygsobEPyyLdmtmmozu0patkVLyrQh6ddc2k43dUwT8fpRk08mXA5lxNwkb0rDAP5+cwJ3IeI5IpWVGTD1iPmHy2lcBf8XpGWiYG8GYux1gGMtPHkNo2BE8bUmLbr4MUC/W+3A9y7xafEWWpa9QAyNRrGRJwtxtUHbJ0YOoqcUSsuAIU46RUwWsVD7IDK4Y2w66I8noMFEyfpsOSdochrzkoxGL75d5fEykY+XKr0enqpc8+y0rEDjWKyg SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 18:19:04.3687 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2029e0da-40be-4c40-98ff-08d55dd6cb2c 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 v2] 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: Wed, 17 Jan 2018 18:19:08 -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 --- v2: * Add detailed explanation in a comment. app/test-pmd/txonly.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index 1f08b6ed3..253cf2385 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -44,7 +44,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 @@ -52,6 +52,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 @@ -159,6 +160,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; @@ -237,6 +239,17 @@ 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. This enables + * packets are well distributed by RSS in receiver side if any + * and txonly mode can be a decent packet generator for + * developer's quick performance regression test. + */ + 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