From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 566F41B2A4 for ; Thu, 18 Jan 2018 13:21:34 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2018 04:21:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,377,1511856000"; d="scan'208";a="194363825" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga005.jf.intel.com with ESMTP; 18 Jan 2018 04:21:31 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.236]) by IRSMSX153.ger.corp.intel.com ([169.254.9.34]) with mapi id 14.03.0319.002; Thu, 18 Jan 2018 12:21:30 +0000 From: "Ananyev, Konstantin" To: Yongseok Koh , "Lu, Wenzhuo" , "Wu, Jingjing" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] app/testpmd: make txonly mode generate multiple flows Thread-Index: AQHTj7/NTIsZMiNZuE2NYv72uSrixKN5jXeQ Date: Thu, 18 Jan 2018 12:21:30 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725886280145@irsmsx105.ger.corp.intel.com> References: <20171215211125.39177-1-yskoh@mellanox.com> <20180117181846.3565-1-yskoh@mellanox.com> In-Reply-To: <20180117181846.3565-1-yskoh@mellanox.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzg0YjFkZWEtZDg5Zi00YTg2LWE1ZjUtOWQyODBjN2YxY2ViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjlKWDNldVFzXC92Y1lEYnVYWHpzejRJZStOYThXQlMrU2RDXC9LT0RhblwvUUU9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Thu, 18 Jan 2018 12:21:34 -0000 Hi, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yongseok Koh > Sent: Wednesday, January 17, 2018 6:19 PM > To: Lu, Wenzhuo ; Wu, Jingjing > Cc: dev@dpdk.org; Yongseok Koh > Subject: [dpdk-dev] [PATCH v2] app/testpmd: make txonly mode generate mul= tiple flows >=20 > Testpmd can generate multiple flows without taking much cost and this cou= ld > be a simple traffic generator for developer's quick tests. IP destination > address is varied. Correct me if I am wrong - but that the change of existing behavior. Without any announcement and without ability to the user to keep current one (command-line option, new CLI command, etc.). What if there are people who rely on existing behavior (some test scripts or so)? Konstantin >=20 > Signed-off-by: Yongseok Koh > --- >=20 > v2: > * Add detailed explanation in a comment. >=20 > app/test-pmd/txonly.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) >=20 > 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 >=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 > @@ -52,6 +52,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 > @@ -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 =3D 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 =3D > + 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