From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 5705A5B34 for ; Tue, 9 Apr 2019 11:33:00 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x399RUpJ030202; Tue, 9 Apr 2019 02:32:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=L0rh44B1pncULvsjjEnHDpzRMsOgSdPCuhUBE1HknpU=; b=RwdOKf3wcRDWfB7937fuCuP9lReIhGGKHX+ioKFaBtmhlV4EpRir2VQjyYZOyBccVYi/ jzkWyJQ/1s1bFONcTYoAulTPvkh51DDMeEr0MfzDTSHkq8qyhjoiLifbf9SOOzt9KfBe fWofdAPtcIWEwgwv7x0bHwcrLizc1IOSKD+RBTUgnkWkMajjq3mmZUu7nLbhE/brDV1A rmx3a5f2mbGKtpJC2kEARHd5ovDzmhV0M47Y3oeCIjDcJGsHgvDFAt7NO+nQlO7iqthU VHIqqF9xpYCix2Qzy1w5ZekudMJ9w8WSedxD7b7jbooWgSSoQ+DMn3PIUmYcnmh/Hxwr cw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2rrjf8sapy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 09 Apr 2019 02:32:58 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 9 Apr 2019 02:32:56 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (104.47.50.54) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 9 Apr 2019 02:32:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L0rh44B1pncULvsjjEnHDpzRMsOgSdPCuhUBE1HknpU=; b=FL7h+vGaJYZqXwfSA1h+RZs7Us8HnoS6AWIe0Fa1OUwP9fX0T4p4KBe+P2FZBxj/oTjlUGoFwvDzVEOpNGylCg+GhrDySFPoDmsH7fGSUNyacky6uTpvz3MR6KYo+27AefPBaQyGAU4iXm1sEv70fhU2pGCcTzH2Z94lVEn+NUI= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.14) by CY4PR1801MB1992.namprd18.prod.outlook.com (10.171.255.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.21; Tue, 9 Apr 2019 09:32:56 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::e980:fa09:c83a:851d]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::e980:fa09:c83a:851d%3]) with mapi id 15.20.1771.021; Tue, 9 Apr 2019 09:32:56 +0000 From: Pavan Nikhilesh Bhagavatula To: "Lin, Xueqin" , "Yigit, Ferruh" CC: "dev@dpdk.org" , "Xu, Qian Q" , "Li, WenjieX A" , "Wang, FengqinX" , "Yao, Lei A" , "Wang, Yinan" , Jerin Jacob Kollanukkaran , "thomas@monjalon.net" , "arybchenko@solarflare.com" , "Iremonger, Bernard" , "alialnu@mellanox.com" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare logic into a separate function Thread-Index: AQHU6Tnuk6OIfXNVpkavSaGgCzn9HKYzmrqAgAAAyAA= Date: Tue, 9 Apr 2019 09:32:56 +0000 Message-ID: References: <20190228194128.14236-1-pbhagavatula@marvell.com> <20190402095255.848-1-pbhagavatula@marvell.com> <20190402095255.848-3-pbhagavatula@marvell.com> <0D300480287911409D9FF92C1FA2A3355B4D2DE1@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <0D300480287911409D9FF92C1FA2A3355B4D2DE1@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [49.205.218.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3f6d53de-590d-4318-9160-08d6bcce5940 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020); SRVR:CY4PR1801MB1992; x-ms-traffictypediagnostic: CY4PR1801MB1992: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 000227DA0C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(366004)(199004)(13464003)(189003)(26005)(7416002)(5660300002)(186003)(8676002)(99286004)(4326008)(6116002)(3846002)(6306002)(9686003)(55016002)(966005)(11346002)(486006)(68736007)(53546011)(6506007)(97736004)(446003)(305945005)(74316002)(25786009)(7736002)(93886005)(7696005)(71190400001)(8936002)(102836004)(76176011)(81156014)(81166006)(71200400001)(476003)(86362001)(52536014)(316002)(256004)(6436002)(54906003)(6246003)(2906002)(53936002)(33656002)(229853002)(14454004)(66066001)(110136005)(106356001)(105586002)(478600001)(78486014); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1992; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mYVyklSgZFF/cBZ79yC71Y4LebN3gdR+/BJUDAIX9p/CvWJCi2Ay/5iVpeEBD4nCRUgv72kk5MSczFPVnwy576AgEjMpdg/Gj/EjIcfzlIafDM3TBkJoNp4sFLjO2+/twPMabIPoKFt5ud1I2xSvorDXfEGVYOHqc0gfWku60NkOzs4TfjMqNvEdSmQZnHSY5r2AHt3Uwl1RCK7+OWU3+jkZu3kScbvnkxp9jQZFm+HZj5CHdMjVnW90MFJkMXAaFywQuN58kzlGR4eXj8NyjnewSjuyXRpRijt4Q/PoYtiasWnat7mCNFN2tKoguOVgxKD5P/rZIQmEgI6aa+c5Wo+Eeuz1gFQwn2DY7hjcYFoY+xHoOoR2AHCgws8FlleqzGOD8BV0F4WgTfbTlHHcvI2L+EWp1lwgOk0+vA8/qCk= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3f6d53de-590d-4318-9160-08d6bcce5940 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2019 09:32:56.4801 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1992 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-09_03:, , signatures=0 Subject: Re: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare logic into a separate function 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: Tue, 09 Apr 2019 09:33:00 -0000 Hi Lin, Can you check if the following patch fixes the issue? http://patches.dpdk.org/patch/52395/ I wasn't able to catch this earlier. Regards, Pavan. >-----Original Message----- >From: Lin, Xueqin >Sent: Tuesday, April 9, 2019 2:58 PM >To: Pavan Nikhilesh Bhagavatula ; Yigit, Ferruh > >Cc: dev@dpdk.org; Xu, Qian Q ; Li, WenjieX A >; Wang, FengqinX ; Yao, >Lei A ; Wang, Yinan ; Jerin Jac= ob >Kollanukkaran ; thomas@monjalon.net; >arybchenko@solarflare.com; Iremonger, Bernard >; alialnu@mellanox.com; Zhang, Qi Z > >Subject: [EXT] RE: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare >logic into a separate function > >External Email > >---------------------------------------------------------------------- >Hi NIkhilesh, > >This patchset impacts some of 19.05 rc1 txonly/burst tests on Intel NIC. I= f set >txonly fwd, IXIA or tester peer can't receive packets that sent from app >generated. >This is high issue, block some cases test. Detailed information as below, = need >you to check it soon. > >*DPDK version: 19.05.0-rc1 >*NIC hardware: Fortville_eagle/Fortville_spirit/Niantic >Environment: one NIC port connect with another NIC port, or one NIC port >connect with IXIA > >Test Setup >1. Bind port to igb_uio or vfio >2. On DUT, setup testpmd: > ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x1e -n 4 -- -i --rxq=3D4= --txq=3D4 -- >port-topology=3Dloop 3. Set txonly forward, start testpmd >testpmd>set fwd txonly >testpmd>start >4. Dump packets from tester NIC port or IXIA, find no packets were receive= d on >the PORT0. >tcpdump -i -v > >Best regards, >Xueqin > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh >> Bhagavatula >> Sent: Tuesday, April 2, 2019 5:54 PM >> To: Jerin Jacob Kollanukkaran ; >> thomas@monjalon.net; arybchenko@solarflare.com; Yigit, Ferruh >> ; Iremonger, Bernard >> ; alialnu@mellanox.com >> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula >> >> Subject: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare logic >> into a separate function >> >> From: Pavan Nikhilesh >> >> Move the packet prepare logic into a separate function so that it can >> be reused later. >> >> Signed-off-by: Pavan Nikhilesh >> --- >> app/test-pmd/txonly.c | 163 >> +++++++++++++++++++++--------------------- >> 1 file changed, 83 insertions(+), 80 deletions(-) >> >> diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index >> 65171c1d1..56ca0ad24 100644 >> --- a/app/test-pmd/txonly.c >> +++ b/app/test-pmd/txonly.c >> @@ -148,6 +148,80 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr, >> ip_hdr->hdr_checksum =3D (uint16_t) ip_cksum; } >> >> +static inline bool >> +pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, >> + struct ether_hdr *eth_hdr, const uint16_t vlan_tci, >> + const uint16_t vlan_tci_outer, const uint64_t ol_flags) { >> + struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT]; >> + uint8_t ip_var =3D RTE_PER_LCORE(_ip_var); >> + struct rte_mbuf *pkt_seg; >> + uint32_t nb_segs, pkt_len; >> + uint8_t i; >> + >> + if (unlikely(tx_pkt_split =3D=3D TX_PKT_SPLIT_RND)) >> + nb_segs =3D random() % tx_pkt_nb_segs + 1; >> + else >> + nb_segs =3D tx_pkt_nb_segs; >> + >> + if (nb_segs > 1) { >> + if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, nb_segs)) >> + return false; >> + } >> + >> + rte_pktmbuf_reset_headroom(pkt); >> + pkt->data_len =3D tx_pkt_seg_lengths[0]; >> + pkt->ol_flags =3D ol_flags; >> + pkt->vlan_tci =3D vlan_tci; >> + pkt->vlan_tci_outer =3D vlan_tci_outer; >> + pkt->l2_len =3D sizeof(struct ether_hdr); >> + pkt->l3_len =3D sizeof(struct ipv4_hdr); >> + >> + pkt_len =3D pkt->data_len; >> + pkt_seg =3D pkt; >> + for (i =3D 1; i < nb_segs; i++) { >> + pkt_seg->next =3D pkt_segs[i - 1]; >> + pkt_seg =3D pkt_seg->next; >> + pkt_seg->data_len =3D tx_pkt_seg_lengths[i]; >> + pkt_len +=3D pkt_seg->data_len; >> + } >> + pkt_seg->next =3D NULL; /* Last segment of packet. */ >> + /* >> + * Copy headers in first packet segment(s). >> + */ >> + copy_buf_to_pkt(eth_hdr, sizeof(eth_hdr), pkt, 0); >> + copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt, >> + sizeof(struct ether_hdr)); >> + if (txonly_multi_flow) { >> + struct ipv4_hdr *ip_hdr; >> + uint32_t addr; >> + >> + ip_hdr =3D rte_pktmbuf_mtod_offset(pkt, >> + struct ipv4_hdr *, >> + sizeof(struct ether_hdr)); >> + /* >> + * Generate multiple flows by varying IP src 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. >> + */ >> + addr =3D (IP_DST_ADDR | (ip_var++ << 8)) + rte_lcore_id(); >> + ip_hdr->src_addr =3D rte_cpu_to_be_32(addr); >> + } >> + copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, >> + sizeof(struct ether_hdr) + >> + sizeof(struct ipv4_hdr)); >> + /* >> + * Complete first mbuf of packet and append it to the >> + * burst of packets to be transmitted. >> + */ >> + pkt->nb_segs =3D nb_segs; >> + pkt->pkt_len =3D pkt_len; >> + >> + return true; >> +} >> + >> /* >> * Transmit a burst of multi-segments packets. >> */ >> @@ -155,10 +229,8 @@ static void >> pkt_burst_transmit(struct fwd_stream *fs) { >> struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; >> - struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT]; >> struct rte_port *txp; >> struct rte_mbuf *pkt; >> - struct rte_mbuf *pkt_seg; >> struct rte_mempool *mbp; >> struct ether_hdr eth_hdr; >> uint16_t nb_tx; >> @@ -166,15 +238,12 @@ pkt_burst_transmit(struct fwd_stream *fs) >> uint16_t vlan_tci, vlan_tci_outer; >> uint32_t retry; >> uint64_t ol_flags =3D 0; >> - uint8_t ip_var =3D RTE_PER_LCORE(_ip_var); >> - uint8_t i; >> uint64_t tx_offloads; >> #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES >> uint64_t start_tsc; >> uint64_t end_tsc; >> uint64_t core_cycles; >> #endif >> - uint32_t nb_segs, pkt_len; >> >> #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES >> start_tsc =3D rte_rdtsc(); >> @@ -201,85 +270,19 @@ pkt_burst_transmit(struct fwd_stream *fs) >> >> for (nb_pkt =3D 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) { >> pkt =3D rte_mbuf_raw_alloc(mbp); >> - if (pkt =3D=3D NULL) { >> - nomore_mbuf: >> - if (nb_pkt =3D=3D 0) >> - return; >> + if (pkt =3D=3D NULL) >> + break; >> + if (unlikely(!pkt_burst_prepare(pkt, mbp, ð_hdr, vlan_tci, >> + vlan_tci_outer, ol_flags))) { >> + rte_pktmbuf_free(pkt); >> break; >> } >> - >> - /* >> - * Using raw alloc is good to improve performance, >> - * but some consumers may use the headroom and so >> - * decrement data_off. We need to make sure it is >> - * reset to default value. >> - */ >> - rte_pktmbuf_reset_headroom(pkt); >> - pkt->data_len =3D tx_pkt_seg_lengths[0]; >> - pkt_seg =3D pkt; >> - >> - if (tx_pkt_split =3D=3D TX_PKT_SPLIT_RND) >> - nb_segs =3D random() % tx_pkt_nb_segs + 1; >> - else >> - nb_segs =3D tx_pkt_nb_segs; >> - >> - if (nb_segs > 1) { >> - if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, >> - nb_segs)) { >> - rte_pktmbuf_free(pkt); >> - goto nomore_mbuf; >> - } >> - } >> - >> - pkt_len =3D pkt->data_len; >> - for (i =3D 1; i < nb_segs; i++) { >> - pkt_seg->next =3D pkt_segs[i - 1]; >> - pkt_seg =3D pkt_seg->next; >> - pkt_seg->data_len =3D tx_pkt_seg_lengths[i]; >> - pkt_len +=3D pkt_seg->data_len; >> - } >> - pkt_seg->next =3D NULL; /* Last segment of packet. */ >> - >> - /* >> - * Copy headers in first packet segment(s). >> - */ >> - 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)); >> - if (txonly_multi_flow) { >> - struct ipv4_hdr *ip_hdr; >> - uint32_t addr; >> - >> - ip_hdr =3D rte_pktmbuf_mtod_offset(pkt, >> - struct ipv4_hdr *, >> - sizeof(struct ether_hdr)); >> - /* >> - * Generate multiple flows by varying IP src 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. >> - */ >> - addr =3D (IP_DST_ADDR | (ip_var++ << 8)) + >> rte_lcore_id(); >> - ip_hdr->src_addr =3D rte_cpu_to_be_32(addr); >> - } >> - copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, >> - sizeof(struct ether_hdr) + >> - sizeof(struct ipv4_hdr)); >> - >> - /* >> - * Complete first mbuf of packet and append it to the >> - * burst of packets to be transmitted. >> - */ >> - pkt->nb_segs =3D nb_segs; >> - pkt->pkt_len =3D pkt_len; >> - pkt->ol_flags =3D ol_flags; >> - pkt->vlan_tci =3D vlan_tci; >> - pkt->vlan_tci_outer =3D vlan_tci_outer; >> - pkt->l2_len =3D sizeof(struct ether_hdr); >> - pkt->l3_len =3D sizeof(struct ipv4_hdr); >> pkts_burst[nb_pkt] =3D pkt; >> } >> + >> + if (nb_pkt =3D=3D 0) >> + return; >> + >> nb_tx =3D rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, >> nb_pkt); >> /* >> * Retry if necessary >> -- >> 2.21.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7838EA0096 for ; Tue, 9 Apr 2019 11:33:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 302175B38; Tue, 9 Apr 2019 11:33:02 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 5705A5B34 for ; Tue, 9 Apr 2019 11:33:00 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x399RUpJ030202; Tue, 9 Apr 2019 02:32:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=L0rh44B1pncULvsjjEnHDpzRMsOgSdPCuhUBE1HknpU=; b=RwdOKf3wcRDWfB7937fuCuP9lReIhGGKHX+ioKFaBtmhlV4EpRir2VQjyYZOyBccVYi/ jzkWyJQ/1s1bFONcTYoAulTPvkh51DDMeEr0MfzDTSHkq8qyhjoiLifbf9SOOzt9KfBe fWofdAPtcIWEwgwv7x0bHwcrLizc1IOSKD+RBTUgnkWkMajjq3mmZUu7nLbhE/brDV1A rmx3a5f2mbGKtpJC2kEARHd5ovDzmhV0M47Y3oeCIjDcJGsHgvDFAt7NO+nQlO7iqthU VHIqqF9xpYCix2Qzy1w5ZekudMJ9w8WSedxD7b7jbooWgSSoQ+DMn3PIUmYcnmh/Hxwr cw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2rrjf8sapy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 09 Apr 2019 02:32:58 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 9 Apr 2019 02:32:56 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (104.47.50.54) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 9 Apr 2019 02:32:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L0rh44B1pncULvsjjEnHDpzRMsOgSdPCuhUBE1HknpU=; b=FL7h+vGaJYZqXwfSA1h+RZs7Us8HnoS6AWIe0Fa1OUwP9fX0T4p4KBe+P2FZBxj/oTjlUGoFwvDzVEOpNGylCg+GhrDySFPoDmsH7fGSUNyacky6uTpvz3MR6KYo+27AefPBaQyGAU4iXm1sEv70fhU2pGCcTzH2Z94lVEn+NUI= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.14) by CY4PR1801MB1992.namprd18.prod.outlook.com (10.171.255.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.21; Tue, 9 Apr 2019 09:32:56 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::e980:fa09:c83a:851d]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::e980:fa09:c83a:851d%3]) with mapi id 15.20.1771.021; Tue, 9 Apr 2019 09:32:56 +0000 From: Pavan Nikhilesh Bhagavatula To: "Lin, Xueqin" , "Yigit, Ferruh" CC: "dev@dpdk.org" , "Xu, Qian Q" , "Li, WenjieX A" , "Wang, FengqinX" , "Yao, Lei A" , "Wang, Yinan" , Jerin Jacob Kollanukkaran , "thomas@monjalon.net" , "arybchenko@solarflare.com" , "Iremonger, Bernard" , "alialnu@mellanox.com" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare logic into a separate function Thread-Index: AQHU6Tnuk6OIfXNVpkavSaGgCzn9HKYzmrqAgAAAyAA= Date: Tue, 9 Apr 2019 09:32:56 +0000 Message-ID: References: <20190228194128.14236-1-pbhagavatula@marvell.com> <20190402095255.848-1-pbhagavatula@marvell.com> <20190402095255.848-3-pbhagavatula@marvell.com> <0D300480287911409D9FF92C1FA2A3355B4D2DE1@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <0D300480287911409D9FF92C1FA2A3355B4D2DE1@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [49.205.218.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3f6d53de-590d-4318-9160-08d6bcce5940 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020); SRVR:CY4PR1801MB1992; x-ms-traffictypediagnostic: CY4PR1801MB1992: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 000227DA0C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(366004)(199004)(13464003)(189003)(26005)(7416002)(5660300002)(186003)(8676002)(99286004)(4326008)(6116002)(3846002)(6306002)(9686003)(55016002)(966005)(11346002)(486006)(68736007)(53546011)(6506007)(97736004)(446003)(305945005)(74316002)(25786009)(7736002)(93886005)(7696005)(71190400001)(8936002)(102836004)(76176011)(81156014)(81166006)(71200400001)(476003)(86362001)(52536014)(316002)(256004)(6436002)(54906003)(6246003)(2906002)(53936002)(33656002)(229853002)(14454004)(66066001)(110136005)(106356001)(105586002)(478600001)(78486014); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1992; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mYVyklSgZFF/cBZ79yC71Y4LebN3gdR+/BJUDAIX9p/CvWJCi2Ay/5iVpeEBD4nCRUgv72kk5MSczFPVnwy576AgEjMpdg/Gj/EjIcfzlIafDM3TBkJoNp4sFLjO2+/twPMabIPoKFt5ud1I2xSvorDXfEGVYOHqc0gfWku60NkOzs4TfjMqNvEdSmQZnHSY5r2AHt3Uwl1RCK7+OWU3+jkZu3kScbvnkxp9jQZFm+HZj5CHdMjVnW90MFJkMXAaFywQuN58kzlGR4eXj8NyjnewSjuyXRpRijt4Q/PoYtiasWnat7mCNFN2tKoguOVgxKD5P/rZIQmEgI6aa+c5Wo+Eeuz1gFQwn2DY7hjcYFoY+xHoOoR2AHCgws8FlleqzGOD8BV0F4WgTfbTlHHcvI2L+EWp1lwgOk0+vA8/qCk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3f6d53de-590d-4318-9160-08d6bcce5940 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2019 09:32:56.4801 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1992 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-09_03:, , signatures=0 Subject: Re: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare logic into a separate function 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190409093256.LKlOUd9Gd51Vzy06oqPwluKUYja9QnQWWfcODveIpQ4@z> Hi Lin, Can you check if the following patch fixes the issue? http://patches.dpdk.org/patch/52395/ I wasn't able to catch this earlier. Regards, Pavan. >-----Original Message----- >From: Lin, Xueqin >Sent: Tuesday, April 9, 2019 2:58 PM >To: Pavan Nikhilesh Bhagavatula ; Yigit, Ferruh > >Cc: dev@dpdk.org; Xu, Qian Q ; Li, WenjieX A >; Wang, FengqinX ; Yao, >Lei A ; Wang, Yinan ; Jerin Jac= ob >Kollanukkaran ; thomas@monjalon.net; >arybchenko@solarflare.com; Iremonger, Bernard >; alialnu@mellanox.com; Zhang, Qi Z > >Subject: [EXT] RE: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare >logic into a separate function > >External Email > >---------------------------------------------------------------------- >Hi NIkhilesh, > >This patchset impacts some of 19.05 rc1 txonly/burst tests on Intel NIC. I= f set >txonly fwd, IXIA or tester peer can't receive packets that sent from app >generated. >This is high issue, block some cases test. Detailed information as below, = need >you to check it soon. > >*DPDK version: 19.05.0-rc1 >*NIC hardware: Fortville_eagle/Fortville_spirit/Niantic >Environment: one NIC port connect with another NIC port, or one NIC port >connect with IXIA > >Test Setup >1. Bind port to igb_uio or vfio >2. On DUT, setup testpmd: > ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x1e -n 4 -- -i --rxq=3D4= --txq=3D4 -- >port-topology=3Dloop 3. Set txonly forward, start testpmd >testpmd>set fwd txonly >testpmd>start >4. Dump packets from tester NIC port or IXIA, find no packets were receive= d on >the PORT0. >tcpdump -i -v > >Best regards, >Xueqin > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh >> Bhagavatula >> Sent: Tuesday, April 2, 2019 5:54 PM >> To: Jerin Jacob Kollanukkaran ; >> thomas@monjalon.net; arybchenko@solarflare.com; Yigit, Ferruh >> ; Iremonger, Bernard >> ; alialnu@mellanox.com >> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula >> >> Subject: [dpdk-dev] [PATCH v6 3/4] app/testpmd: move pkt prepare logic >> into a separate function >> >> From: Pavan Nikhilesh >> >> Move the packet prepare logic into a separate function so that it can >> be reused later. >> >> Signed-off-by: Pavan Nikhilesh >> --- >> app/test-pmd/txonly.c | 163 >> +++++++++++++++++++++--------------------- >> 1 file changed, 83 insertions(+), 80 deletions(-) >> >> diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index >> 65171c1d1..56ca0ad24 100644 >> --- a/app/test-pmd/txonly.c >> +++ b/app/test-pmd/txonly.c >> @@ -148,6 +148,80 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr, >> ip_hdr->hdr_checksum =3D (uint16_t) ip_cksum; } >> >> +static inline bool >> +pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, >> + struct ether_hdr *eth_hdr, const uint16_t vlan_tci, >> + const uint16_t vlan_tci_outer, const uint64_t ol_flags) { >> + struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT]; >> + uint8_t ip_var =3D RTE_PER_LCORE(_ip_var); >> + struct rte_mbuf *pkt_seg; >> + uint32_t nb_segs, pkt_len; >> + uint8_t i; >> + >> + if (unlikely(tx_pkt_split =3D=3D TX_PKT_SPLIT_RND)) >> + nb_segs =3D random() % tx_pkt_nb_segs + 1; >> + else >> + nb_segs =3D tx_pkt_nb_segs; >> + >> + if (nb_segs > 1) { >> + if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, nb_segs)) >> + return false; >> + } >> + >> + rte_pktmbuf_reset_headroom(pkt); >> + pkt->data_len =3D tx_pkt_seg_lengths[0]; >> + pkt->ol_flags =3D ol_flags; >> + pkt->vlan_tci =3D vlan_tci; >> + pkt->vlan_tci_outer =3D vlan_tci_outer; >> + pkt->l2_len =3D sizeof(struct ether_hdr); >> + pkt->l3_len =3D sizeof(struct ipv4_hdr); >> + >> + pkt_len =3D pkt->data_len; >> + pkt_seg =3D pkt; >> + for (i =3D 1; i < nb_segs; i++) { >> + pkt_seg->next =3D pkt_segs[i - 1]; >> + pkt_seg =3D pkt_seg->next; >> + pkt_seg->data_len =3D tx_pkt_seg_lengths[i]; >> + pkt_len +=3D pkt_seg->data_len; >> + } >> + pkt_seg->next =3D NULL; /* Last segment of packet. */ >> + /* >> + * Copy headers in first packet segment(s). >> + */ >> + copy_buf_to_pkt(eth_hdr, sizeof(eth_hdr), pkt, 0); >> + copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt, >> + sizeof(struct ether_hdr)); >> + if (txonly_multi_flow) { >> + struct ipv4_hdr *ip_hdr; >> + uint32_t addr; >> + >> + ip_hdr =3D rte_pktmbuf_mtod_offset(pkt, >> + struct ipv4_hdr *, >> + sizeof(struct ether_hdr)); >> + /* >> + * Generate multiple flows by varying IP src 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. >> + */ >> + addr =3D (IP_DST_ADDR | (ip_var++ << 8)) + rte_lcore_id(); >> + ip_hdr->src_addr =3D rte_cpu_to_be_32(addr); >> + } >> + copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, >> + sizeof(struct ether_hdr) + >> + sizeof(struct ipv4_hdr)); >> + /* >> + * Complete first mbuf of packet and append it to the >> + * burst of packets to be transmitted. >> + */ >> + pkt->nb_segs =3D nb_segs; >> + pkt->pkt_len =3D pkt_len; >> + >> + return true; >> +} >> + >> /* >> * Transmit a burst of multi-segments packets. >> */ >> @@ -155,10 +229,8 @@ static void >> pkt_burst_transmit(struct fwd_stream *fs) { >> struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; >> - struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT]; >> struct rte_port *txp; >> struct rte_mbuf *pkt; >> - struct rte_mbuf *pkt_seg; >> struct rte_mempool *mbp; >> struct ether_hdr eth_hdr; >> uint16_t nb_tx; >> @@ -166,15 +238,12 @@ pkt_burst_transmit(struct fwd_stream *fs) >> uint16_t vlan_tci, vlan_tci_outer; >> uint32_t retry; >> uint64_t ol_flags =3D 0; >> - uint8_t ip_var =3D RTE_PER_LCORE(_ip_var); >> - uint8_t i; >> uint64_t tx_offloads; >> #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES >> uint64_t start_tsc; >> uint64_t end_tsc; >> uint64_t core_cycles; >> #endif >> - uint32_t nb_segs, pkt_len; >> >> #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES >> start_tsc =3D rte_rdtsc(); >> @@ -201,85 +270,19 @@ pkt_burst_transmit(struct fwd_stream *fs) >> >> for (nb_pkt =3D 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) { >> pkt =3D rte_mbuf_raw_alloc(mbp); >> - if (pkt =3D=3D NULL) { >> - nomore_mbuf: >> - if (nb_pkt =3D=3D 0) >> - return; >> + if (pkt =3D=3D NULL) >> + break; >> + if (unlikely(!pkt_burst_prepare(pkt, mbp, ð_hdr, vlan_tci, >> + vlan_tci_outer, ol_flags))) { >> + rte_pktmbuf_free(pkt); >> break; >> } >> - >> - /* >> - * Using raw alloc is good to improve performance, >> - * but some consumers may use the headroom and so >> - * decrement data_off. We need to make sure it is >> - * reset to default value. >> - */ >> - rte_pktmbuf_reset_headroom(pkt); >> - pkt->data_len =3D tx_pkt_seg_lengths[0]; >> - pkt_seg =3D pkt; >> - >> - if (tx_pkt_split =3D=3D TX_PKT_SPLIT_RND) >> - nb_segs =3D random() % tx_pkt_nb_segs + 1; >> - else >> - nb_segs =3D tx_pkt_nb_segs; >> - >> - if (nb_segs > 1) { >> - if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, >> - nb_segs)) { >> - rte_pktmbuf_free(pkt); >> - goto nomore_mbuf; >> - } >> - } >> - >> - pkt_len =3D pkt->data_len; >> - for (i =3D 1; i < nb_segs; i++) { >> - pkt_seg->next =3D pkt_segs[i - 1]; >> - pkt_seg =3D pkt_seg->next; >> - pkt_seg->data_len =3D tx_pkt_seg_lengths[i]; >> - pkt_len +=3D pkt_seg->data_len; >> - } >> - pkt_seg->next =3D NULL; /* Last segment of packet. */ >> - >> - /* >> - * Copy headers in first packet segment(s). >> - */ >> - 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)); >> - if (txonly_multi_flow) { >> - struct ipv4_hdr *ip_hdr; >> - uint32_t addr; >> - >> - ip_hdr =3D rte_pktmbuf_mtod_offset(pkt, >> - struct ipv4_hdr *, >> - sizeof(struct ether_hdr)); >> - /* >> - * Generate multiple flows by varying IP src 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. >> - */ >> - addr =3D (IP_DST_ADDR | (ip_var++ << 8)) + >> rte_lcore_id(); >> - ip_hdr->src_addr =3D rte_cpu_to_be_32(addr); >> - } >> - copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, >> - sizeof(struct ether_hdr) + >> - sizeof(struct ipv4_hdr)); >> - >> - /* >> - * Complete first mbuf of packet and append it to the >> - * burst of packets to be transmitted. >> - */ >> - pkt->nb_segs =3D nb_segs; >> - pkt->pkt_len =3D pkt_len; >> - pkt->ol_flags =3D ol_flags; >> - pkt->vlan_tci =3D vlan_tci; >> - pkt->vlan_tci_outer =3D vlan_tci_outer; >> - pkt->l2_len =3D sizeof(struct ether_hdr); >> - pkt->l3_len =3D sizeof(struct ipv4_hdr); >> pkts_burst[nb_pkt] =3D pkt; >> } >> + >> + if (nb_pkt =3D=3D 0) >> + return; >> + >> nb_tx =3D rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, >> nb_pkt); >> /* >> * Retry if necessary >> -- >> 2.21.0