Message ID | 20190402095255.848-1-pbhagavatula@marvell.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Ferruh Yigit |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9807B316B; Tue, 2 Apr 2019 11:53:36 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 917CA2B99 for <dev@dpdk.org>; Tue, 2 Apr 2019 11:53:35 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x329j4Fm014061; Tue, 2 Apr 2019 02:53:34 -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=LOlWy8ZGIiqhigYTj8T+vOkM4Rhp8qt5iIZlSY5lYx8=; b=fkgpFsjKCekXZWnPH3BsvKYaq5jty4WQdHnnSsZ5f/U7M3nyRGPqVjTRcxtumRzju9pK Mo12nMuxtTVDhBGy1MmncTVLt2zB1XQRGY/SE6K+ilQ5wgykKM8No+DlaJr/mTFi0G4d eVEbFNeSbaYXMdBjl3d761k1Rnu5nkDAtaWzE9t+Bpx7jWVT5itdppkDcXTxG0hbWQ5m Ws5OkayopEYmBciF4KS3DoOFm+YbCxX6scbf/X/BZPNK3T05g7sPQRIbj3LJuWDYU0WY x4b928XLT6M0B4USjCW63/t2RhMoQIHxTCumNXSHj+sn510L1kZX4HilKqT2D79bUQVZ Ag== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2rkrb49wy3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 02 Apr 2019 02:53:34 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 2 Apr 2019 02:53:27 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (104.47.32.57) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 2 Apr 2019 02:53:28 -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=LOlWy8ZGIiqhigYTj8T+vOkM4Rhp8qt5iIZlSY5lYx8=; b=i+99WtpYXlH7heGxPaBPy/yFPQTf7z4GpKDUVFPi6psktQIaWUYmCD6EJvLbQCEk4yWpNyW1Df17WzBZn8IlWe7QuX8WoPROfItLceWEAvf096V4SiAmZNxo1tpT7dv//TWtkuhRS9fqNGUccvUhO6FJaPYNFY/tZLRj6JZFfM0= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.14) by CY4PR1801MB1926.namprd18.prod.outlook.com (10.171.255.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Tue, 2 Apr 2019 09:53:26 +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.1750.021; Tue, 2 Apr 2019 09:53:26 +0000 From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>, "thomas@monjalon.net" <thomas@monjalon.net>, "arybchenko@solarflare.com" <arybchenko@solarflare.com>, "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>, "bernard.iremonger@intel.com" <bernard.iremonger@intel.com>, "alialnu@mellanox.com" <alialnu@mellanox.com> CC: "dev@dpdk.org" <dev@dpdk.org>, Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com> Thread-Topic: [dpdk-dev] [PATCH v6 1/4] app/testpmd: move eth header generation outside the loop Thread-Index: AQHU6TnqdxZKp+84Pk6xF0nPOKXqag== Date: Tue, 2 Apr 2019 09:53:25 +0000 Message-ID: <20190402095255.848-1-pbhagavatula@marvell.com> References: <20190228194128.14236-1-pbhagavatula@marvell.com> In-Reply-To: <20190228194128.14236-1-pbhagavatula@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0029.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::15) To CY4PR1801MB1863.namprd18.prod.outlook.com (2603:10b6:910:7a::14) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.21.0 x-originating-ip: [115.113.156.3] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 27592073-2a16-4c96-58c6-08d6b7510cd0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:CY4PR1801MB1926; x-ms-traffictypediagnostic: CY4PR1801MB1926: x-microsoft-antispam-prvs: <CY4PR1801MB1926E9960473A984FEB14559DE560@CY4PR1801MB1926.namprd18.prod.outlook.com> x-forefront-prvs: 0995196AA2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(346002)(39860400002)(376002)(189003)(199004)(6486002)(8676002)(55236004)(102836004)(106356001)(26005)(486006)(186003)(86362001)(476003)(107886003)(2906002)(105586002)(36756003)(11346002)(66066001)(2201001)(8936002)(71200400001)(305945005)(7736002)(2616005)(478600001)(4326008)(71190400001)(446003)(97736004)(6436002)(256004)(1076003)(2501003)(50226002)(54906003)(6506007)(316002)(81156014)(14454004)(81166006)(53936002)(25786009)(6116002)(52116002)(76176011)(110136005)(3846002)(5660300002)(6512007)(386003)(68736007)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1926; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 1WF/+hp43PvFSWnewox/GOLN+BLluvuiYHqewjLeqYG8nSQDM4reWl7I8qpHKYpHxsioZT2nB9sy6r6jiGGDHCGl33eeqKUs4S7puKh9/tqt4EnjqAzP7e8PeCnZWaKFpdNTUzVh5l9ogrI2JzWNALqiCLAQPcRoRlo0QxoDIrqrmTkWjGOW2c3GN8eRtI3cG1Q+UZdYEdan7p2TiCgut/P6Mld8Brk78Rn2OrTOVpp6jL2V07cj51xN96RLnoAG37vNNqNlkASCU92pmmyAvpFHwyxkshlmJX22VnT8XDn6zj9sC/FrsEra0cblbX4jiL1rdm/34cdWxJeQMdOPMLrZSFPfIR5Zv26oPN1GN0FEcicrX9qoDssda+kVKvX/T64FBMVqYx+5BXDqXq6z3GQZM1BJ9+/Z3/Se8MITqhY= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 27592073-2a16-4c96-58c6-08d6b7510cd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2019 09:53:25.9602 (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: CY4PR1801MB1926 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-02_04:, , signatures=0 Subject: [dpdk-dev] [PATCH v6 1/4] app/testpmd: move eth header generation outside the loop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
[v6,1/4] app/testpmd: move eth header generation outside the loop
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
ci/mellanox-Performance-Testing | success | Performance Testing PASS |
ci/intel-Performance-Testing | success | Performance Testing PASS |
Commit Message
Pavan Nikhilesh Bhagavatula
April 2, 2019, 9:53 a.m. UTC
From: Pavan Nikhilesh <pbhagavatula@marvell.com> Testpmd txonly copies the src/dst mac address of the port being processed to ethernet header structure on the stack for every packet. Move it outside the loop and reuse it. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> --- v6 Changes - Rebase onto ToT. - Split the changes further v5 Changes - Remove unnecessary change to struct rte_port *txp (movement). (Bernard) v4 Changes: - Fix packet len calculation. v3 Changes: - Split the patches for easier review. (Thomas) - Remove unnecessary assignments to 0. (Bernard) v2 Changes: - Use bulk ops for fetching segments. (Andrew Rybchenko) - Fallback to rte_mbuf_raw_alloc if bulk get fails. (Andrew Rybchenko) - Fix mbufs not being freed when there is no more mbufs available for segments. (Andrew Rybchenko) app/test-pmd/txonly.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.21.0
Comments
Hi, The performance issue that we saw in Mellanox is now fixed with latest version: The issue was with the packet len calculation that was changed in the latest versions > 4: diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index af0be89..2f40949 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -176,6 +176,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, pkt->l3_len = sizeof(struct ipv4_hdr); pkt_seg = pkt; + pkt_len = pkt->data_len; for (i = 1; i < nb_segs; i++) { pkt_seg->next = pkt_segs[i - 1]; pkt_seg = pkt_seg->next; @@ -198,7 +199,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, * burst of packets to be transmitted. */ pkt->nb_segs = nb_segs; - pkt->pkt_len += pkt_len; + pkt->pkt_len = pkt_len; return true; and now we see ~20% improvement in performance. Kindest regards, Raslan Darawsheh > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Pavan Nikhilesh > Bhagavatula > Sent: Tuesday, April 2, 2019 12:53 PM > To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Thomas Monjalon > <thomas@monjalon.net>; arybchenko@solarflare.com; > ferruh.yigit@intel.com; bernard.iremonger@intel.com; Ali Alnubani > <alialnu@mellanox.com> > Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula > <pbhagavatula@marvell.com> > Subject: [dpdk-dev] [PATCH v6 1/4] app/testpmd: move eth header > generation outside the loop > > From: Pavan Nikhilesh <pbhagavatula@marvell.com> > > Testpmd txonly copies the src/dst mac address of the port being > processed to ethernet header structure on the stack for every packet. > Move it outside the loop and reuse it. > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> > --- > v6 Changes > - Rebase onto ToT. > - Split the changes further > > v5 Changes > - Remove unnecessary change to struct rte_port *txp (movement). > (Bernard) > > v4 Changes: > - Fix packet len calculation. > > v3 Changes: > - Split the patches for easier review. (Thomas) > - Remove unnecessary assignments to 0. (Bernard) > > v2 Changes: > - Use bulk ops for fetching segments. (Andrew Rybchenko) > - Fallback to rte_mbuf_raw_alloc if bulk get fails. (Andrew Rybchenko) > - Fix mbufs not being freed when there is no more mbufs available for > segments. (Andrew Rybchenko) > > app/test-pmd/txonly.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c > index def52a048..0d411dbf4 100644 > --- a/app/test-pmd/txonly.c > +++ b/app/test-pmd/txonly.c > @@ -190,6 +190,14 @@ pkt_burst_transmit(struct fwd_stream *fs) > ol_flags |= PKT_TX_QINQ_PKT; > if (tx_offloads & DEV_TX_OFFLOAD_MACSEC_INSERT) > ol_flags |= PKT_TX_MACSEC; > + > + /* > + * Initialize Ethernet header. > + */ > + ether_addr_copy(&peer_eth_addrs[fs->peer_addr], > ð_hdr.d_addr); > + ether_addr_copy(&ports[fs->tx_port].eth_addr, ð_hdr.s_addr); > + eth_hdr.ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); > + > for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) { > pkt = rte_mbuf_raw_alloc(mbp); > if (pkt == NULL) { > @@ -226,13 +234,6 @@ pkt_burst_transmit(struct fwd_stream *fs) > } > pkt_seg->next = NULL; /* Last segment of packet. */ > > - /* > - * Initialize Ethernet header. > - */ > - ether_addr_copy(&peer_eth_addrs[fs- > >peer_addr],ð_hdr.d_addr); > - ether_addr_copy(&ports[fs->tx_port].eth_addr, > ð_hdr.s_addr); > - eth_hdr.ether_type = > rte_cpu_to_be_16(ETHER_TYPE_IPv4); > - > /* > * Copy headers in first packet segment(s). > */ > -- > 2.21.0
On 4/2/2019 10:53 AM, Pavan Nikhilesh Bhagavatula wrote: > From: Pavan Nikhilesh <pbhagavatula@marvell.com> > > Testpmd txonly copies the src/dst mac address of the port being > processed to ethernet header structure on the stack for every packet. > Move it outside the loop and reuse it. > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Hi Bernard, Jingjing, Wenzhuo, Can you please check this testpmd patchset? Thanks, ferruh
On 4/2/2019 10:53 AM, Pavan Nikhilesh Bhagavatula wrote: > From: Pavan Nikhilesh <pbhagavatula@marvell.com> > > Testpmd txonly copies the src/dst mac address of the port being > processed to ethernet header structure on the stack for every packet. > Move it outside the loop and reuse it. > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> For series, Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Series applied to dpdk-next-net/master, thanks.
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index def52a048..0d411dbf4 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -190,6 +190,14 @@ pkt_burst_transmit(struct fwd_stream *fs) ol_flags |= PKT_TX_QINQ_PKT; if (tx_offloads & DEV_TX_OFFLOAD_MACSEC_INSERT) ol_flags |= PKT_TX_MACSEC; + + /* + * Initialize Ethernet header. + */ + ether_addr_copy(&peer_eth_addrs[fs->peer_addr], ð_hdr.d_addr); + ether_addr_copy(&ports[fs->tx_port].eth_addr, ð_hdr.s_addr); + eth_hdr.ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); + for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) { pkt = rte_mbuf_raw_alloc(mbp); if (pkt == NULL) { @@ -226,13 +234,6 @@ pkt_burst_transmit(struct fwd_stream *fs) } pkt_seg->next = NULL; /* Last segment of packet. */ - /* - * Initialize Ethernet header. - */ - ether_addr_copy(&peer_eth_addrs[fs->peer_addr],ð_hdr.d_addr); - ether_addr_copy(&ports[fs->tx_port].eth_addr, ð_hdr.s_addr); - eth_hdr.ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); - /* * Copy headers in first packet segment(s). */