From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20067.outbound.protection.outlook.com [40.107.2.67]) by dpdk.org (Postfix) with ESMTP id CF547A490 for ; Wed, 17 Jan 2018 19:04:08 +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=1ciwBo4GbpieYcrZzuAE0poR6OR5KJDwioFPi2j7yAw=; b=Jp5h9016HibtDQtXfaEJ7D2j9dIKR4aPmG9oOJwO2hOmslD6Vn95tPJnDazidibbIQrzMFOxJyPZ6i6T5gv4RuMQ+h+AasCFnWkBE7wpKYU9PMYdUDTK1s9aIqdlZZKnN7F/88/W26yCnngQDbKY/slMG/da8Zt3wEjFJy0nzFk= Received: from VI1PR0501MB2045.eurprd05.prod.outlook.com (10.167.195.147) by VI1PR0501MB2125.eurprd05.prod.outlook.com (10.167.196.17) 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:04:06 +0000 Received: from VI1PR0501MB2045.eurprd05.prod.outlook.com ([fe80::2d4b:9768:b21a:e7e9]) by VI1PR0501MB2045.eurprd05.prod.outlook.com ([fe80::2d4b:9768:b21a:e7e9%14]) with mapi id 15.20.0407.012; Wed, 17 Jan 2018 18:04:06 +0000 From: Yongseok Koh To: "Lu, Wenzhuo" CC: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: make txonly mode generate multiple flows Thread-Index: AQHTjnN1P71E7h2BfkeizGV1j7wa5aN4XjiA Date: Wed, 17 Jan 2018 18:04:06 +0000 Message-ID: <755704D8-192C-43E6-9EC5-BCB7FA4591C3@mellanox.com> References: <20171215211125.39177-1-yskoh@mellanox.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B710FEA@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B710FEA@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0501MB2125; 6:a4KXxUPfReLCuO2pD4Ar23A/T4u7Dm93efnsPKDFFn0f5sm8EvsaUtA1FsP+JHCgHs9mWY4chVD2R8QZsCPtpIgmelwDgdhTpl9cIeak4lO8YP/mlvF8a7eOAIpnb1roug0gMWxprdKfzZmmZwFQIHodfAzTBHPAEiWTEPdk5G9BFrSPqN4LM0qLDPLILPeOm44tSLa451B4qk6cbbbZ3qUqCs69LUkweD3awgCL9W7M9gbqL51K85z9zh/reHxOTxXuXnvKfeXQkn0Xw3d3GIJY56SXE4qisJT80Bp4Q+SrbGCmP6kcuieYWSV/AyHDXgwm9wJqsGI/Am0QZiP4f/yAWWpSZbyRV4coynzy7eo8Wk5Sog2vfKs9qQVBJ+Fw; 5:+JvVw4tyitp3yV+P5lrC88rzZURUbpLDD5WvHTA9ppSFOkBN87w7yRSiPEhyzPYa/N4ojuzXTMsL0LLzOeACbTdnnpK3oUpTNGZ9+Rtt0YS5h7zpLJO8eFe8e5jQIwrm72PZjGRPjg+I+4gGCfqWhTgmapOY7ETwW5BL0cHefSw=; 24:p+irkXH3R8nR6U7xaTgG49j4mALmwPI3ZmWQcFUSmB73agDh0mdJiLojVxJ1DkHe9y8TjvPOLPIMNMvFla7o1tL2Mi9MyXI8WCqloOADZdU=; 7:E99anXFGb6ASld6h1DHmaXoSJDqTDja/I/eqALD1JeGvyNXs5jzQzEYXBsBe6zE0aJhJQJUft0xUA6vkswwTB9hCc3y2pqacLPcS4McTyRBU3nBTXzEkuA4Cb4+pcUsnjVK7E7WwH2hsj7pe+MsUaqOwbwyoPIE49+P3ziCNS3GX3/7n/SaGgBRZ3VHoDJxiw5dEnwi9h+eibSg8xQL5mPL7zpsTBFgr3qBY2iK1SoDlqdQ7t3DpTB9p470tBftD x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 4517e0d1-2809-4094-2851-08d55dd4b38b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060)(7193020); SRVR:VI1PR0501MB2125; x-ms-traffictypediagnostic: VI1PR0501MB2125: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(944501161)(93006095)(93001095)(10201501046)(6055026)(6041268)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR0501MB2125; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR0501MB2125; x-forefront-prvs: 0555EC8317 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(39380400002)(366004)(376002)(199004)(13464003)(24454002)(189003)(6486002)(26005)(82746002)(3846002)(305945005)(36756003)(6116002)(2906002)(7736002)(5660300001)(229853002)(3280700002)(83716003)(6246003)(2950100002)(5250100002)(86362001)(102836004)(33656002)(8936002)(2900100001)(478600001)(53936002)(6506007)(76176011)(53546011)(6916009)(6436002)(68736007)(25786009)(59450400001)(4326008)(99286004)(316002)(97736004)(54906003)(6512007)(81166006)(66066001)(105586002)(14454004)(106356001)(81156014)(3660700001)(20673002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2125; H:VI1PR0501MB2045.eurprd05.prod.outlook.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-antispam-message-info: e/iZDp/jl5C95qkE6FgAZx3TDQJej6erdsNcgFn06pEwMX/BUHb6B/K6laMD/Wxz/rnYgz8Z5qSdSswXTX2y5w== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4517e0d1-2809-4094-2851-08d55dd4b38b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2018 18:04:06.8234 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2125 Subject: Re: [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: Wed, 17 Jan 2018 18:04:09 -0000 > On Jan 15, 2018, at 6:40 PM, Lu, Wenzhuo wrote: >=20 > Hi Yongseok, >=20 >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yongseok Koh >> Sent: Saturday, December 16, 2017 5:11 AM >> To: Wu, Jingjing >> Cc: dev@dpdk.org; Yongseok Koh >> Subject: [dpdk-dev] [PATCH] app/testpmd: make txonly mode generate >> multiple flows >>=20 >> Testpmd can generate multiple flows without taking much cost and this >> could be a simple traffic generator for developer's quick tests. IP dest= ination >> address is varied. >>=20 >> Signed-off-by: Yongseok Koh >> --- >> app/test-pmd/txonly.c | 12 +++++++++++- >> 1 file changed, 11 insertions(+), 1 deletion(-) >>=20 >> 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 >>=20 >> #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)) >>=20 >> #define IP_DEFTTL 64 /* from RFC 1340. */ >> #define IP_VERSION 0x40 >> @@ -81,6 +81,7 @@ >> #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) >>=20 >> static struct ipv4_hdr pkt_ip_hdr; /**< IP header of transmitted packe= ts. */ >> +static __thread uint8_t ip_var; /**< IP address variation */ >> static struct udp_hdr pkt_udp_hdr; /**< UDP header of transmitted packet= s. >> */ >>=20 >> 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 =3D rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, >> + sizeof(struct ether_hdr)); >> + /* >> + * Generate multiple flows by varying IP dest addr. >> + */ >> + ip_hdr->dst_addr =3D >> + rte_cpu_to_be_32(IP_DST_ADDR | (ip_var++ << 8) | >> + (rte_lcore_id() + 1)); > Just curious if we can avoid call rte_lcore_id for every packet? rte_lcore_id() is just to read a per-lcore variable and it is an inline function, not a real branch. I don't think it has any performance hit. Actually, I'm using txonly with this patch as a good packet generator to test development tasks. Mellanox ConnectX-5 can generate 100Gbps @ 64B (149Mpps) with multiple IP flows. > And suggest to add more explanation here, like purpose, scenario. So when= we want to change the behavior, for example, like adding a parameter to ma= ke IP addresses configurable, we know what we will break. Okay, will add more comment here. Thanks, Yongseok