From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EDE571B140; Wed, 21 Nov 2018 22:24:30 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2018 13:24:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,262,1539673200"; d="scan'208";a="88238652" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 21 Nov 2018 13:24:30 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 21 Nov 2018 13:24:29 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 21 Nov 2018 13:24:29 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.161]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0415.000; Thu, 22 Nov 2018 05:24:27 +0800 From: "Zhang, Qi Z" To: "Ananyev, Konstantin" , "Richardson, Bruce" , "Wiles, Keith" CC: "dev@dpdk.org" , "Lu, Wenzhuo" , "Iremonger, Bernard" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: improve MAC swap performance Thread-Index: AQHUgIu32aOj5rhZkEe0SJUqUpTu76VYYfvggACBU4CAAAdaIIAAW8HggAF1zlA= Date: Wed, 21 Nov 2018 21:24:26 +0000 Message-ID: <039ED4275CED7440929022BC67E70611532E9410@SHSMSX103.ccr.corp.intel.com> References: <20181120044537.9495-1-qi.z.zhang@intel.com> <2601191342CEEE43887BDE71AB977258010CEBA106@IRSMSX106.ger.corp.intel.com> <039ED4275CED7440929022BC67E70611532E8AAD@SHSMSX103.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258010CEBA476@IRSMSX106.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258010CEBA476@IRSMSX106.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2MwZjc1NGMtYjNjNi00MzU5LTk0MGUtZmZiN2VmZDc2ZThhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoianFTVTFzNWJtaTNmTlpoNlhCTEtIUzFpcXJyd29CMDhsOFdQbmo2V1wvM0RqZ3RQMjFCcFVHQkM0djRSR29EU2gifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: improve MAC swap performance 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, 21 Nov 2018 21:24:31 -0000 > -----Original Message----- > From: Ananyev, Konstantin > Sent: Tuesday, November 20, 2018 2:54 PM > To: Zhang, Qi Z ; Richardson, Bruce > ; Wiles, Keith > Cc: dev@dpdk.org; Lu, Wenzhuo ; Iremonger, Bernard > ; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: improve MAC swap performance >=20 >=20 >=20 > > -----Original Message----- > > From: Ananyev, Konstantin > > Sent: Tuesday, November 20, 2018 5:26 PM > > To: Zhang, Qi Z ; Richardson, Bruce > > ; Wiles, Keith > > Cc: dev@dpdk.org; Lu, Wenzhuo ; Iremonger, > > Bernard ; stable@dpdk.org > > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: improve MAC swap > > performance > > > > > > > > > -----Original Message----- > > > From: Zhang, Qi Z > > > Sent: Tuesday, November 20, 2018 4:58 PM > > > To: Ananyev, Konstantin ; Richardson, > > > Bruce ; Wiles, Keith > > > > > > Cc: dev@dpdk.org; Lu, Wenzhuo ; Iremonger, > > > Bernard ; stable@dpdk.org > > > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: improve MAC swap > > > performance > > > > > > > > > > > > > -----Original Message----- > > > > From: Ananyev, Konstantin > > > > Sent: Tuesday, November 20, 2018 1:17 AM > > > > To: Zhang, Qi Z ; Richardson, Bruce > > > > ; Wiles, Keith > > > > Cc: dev@dpdk.org; Lu, Wenzhuo ; Iremonger, > > > > Bernard ; Zhang, Qi Z > > > > ; stable@dpdk.org > > > > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: improve MAC swap > > > > performance > > > > > > > > Hi Qi, > > > > > > > > > -----Original Message----- > > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang > > > > > Sent: Tuesday, November 20, 2018 4:46 AM > > > > > To: Richardson, Bruce ; Wiles, Keith > > > > > > > > > > Cc: dev@dpdk.org; Lu, Wenzhuo ; Iremonger, > > > > > Bernard ; Zhang, Qi Z > > > > > ; stable@dpdk.org > > > > > Subject: [dpdk-dev] [PATCH] app/testpmd: improve MAC swap > > > > > performance > > > > > > > > > > The patch optimizes the mac swap operation by taking advantage > > > > > of SSE instructions, it only impacts x86 platform. > > > > > > > > > > Cc: stable@dpdk.org > > > > > > > > > > Signed-off-by: Qi Zhang > > > > > --- > > > > > app/test-pmd/macswap.c | 16 +++++++++++++++- > > > > > 1 file changed, 15 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c > > > > > index > > > > > a8384d5b8..0722782b0 100644 > > > > > --- a/app/test-pmd/macswap.c > > > > > +++ b/app/test-pmd/macswap.c > > > > > @@ -78,7 +78,6 @@ pkt_burst_mac_swap(struct fwd_stream *fs) > > > > > struct rte_port *txp; > > > > > struct rte_mbuf *mb; > > > > > struct ether_hdr *eth_hdr; > > > > > - struct ether_addr addr; > > > > > uint16_t nb_rx; > > > > > uint16_t nb_tx; > > > > > uint16_t i; > > > > > @@ -95,6 +94,15 @@ pkt_burst_mac_swap(struct fwd_stream *fs) > > > > > start_tsc =3D rte_rdtsc(); > > > > > #endif > > > > > > > > > > +#ifdef RTE_ARCH_X86 > > > > > + __m128i addr; > > > > > + __m128i shfl_msk =3D _mm_set_epi8(15, 14, 13, 12, > > > > > + 5, 4, 3, 2, > > > > > + 1, 0, 11, 10, > > > > > + 9, 8, 7, 6); > > > > > +#else > > > > > + struct ether_addr addr; > > > > > +#endif > > > > > > > > I think it would better to place IA specific code into a separate > > > > fnction (and probably into a separate .h file). > > > > > > OK, I will think about how to rework this. > > > > Ideally would be good to have an generic one, and IA optimized version. > > > > > > > > > BTW, just curious what % of improvement it gives? > > > > > > So far , the only server I can test is a 1.6GHz Broadwell server with= 2 ports on > 1 i40e 25G. > > > The macswap performance is increase from 16.8mpps to 20mpps (about > > > 19% improvement) I need to add a notice here, I found previous test is running on CPU from r= emote socket. For the test on CPU from local socket on the same server, actually the mac = swap performance is improved from 23.34 to 26.36, its about 12.9% increase,= but still considerable. > > > > Quite a lot, definitely looks like worth it. >=20 > You probably can squeeze few more cycles doing it in bulks of 4 or so. it's a good idea, based on my experience I can get more than 4% increase by= batch with 4,=20 it can reach 27.46mpps, so now its 17.7% increase, I will send patch later,= please help to polish:) Thanks Qi > Konstantin