From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id BE3316A80 for ; Tue, 27 Oct 2015 06:32:25 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 26 Oct 2015 22:32:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,203,1444719600"; d="scan'208";a="588672955" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 26 Oct 2015 22:32:24 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 26 Oct 2015 22:32:24 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.253]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.204]) with mapi id 14.03.0248.002; Tue, 27 Oct 2015 13:32:22 +0800 From: "Chen, Jing D" To: "Liang, Cunming" , "dev@dpdk.org" Thread-Topic: [PATCH v2 06/16] fm10k: add Vector RX function Thread-Index: AQHRDK5nO9McJoKdwka9Vk8/X05XWZ5+UCoAgACH3GA= Date: Tue, 27 Oct 2015 05:32:22 +0000 Message-ID: <4341B239C0EFF9468EE453F9E9F4604D02AE4A7B@shsmsx102.ccr.corp.intel.com> References: <1443531824-22767-2-git-send-email-jing.d.chen@intel.com> <1445507104-22563-1-git-send-email-jing.d.chen@intel.com> <1445507104-22563-7-git-send-email-jing.d.chen@intel.com> <562F0AAA.6060008@intel.com> In-Reply-To: <562F0AAA.6060008@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v2 06/16] fm10k: add Vector RX function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 05:32:26 -0000 Hi, Steve, Best Regards, Mark > -----Original Message----- > From: Liang, Cunming > Sent: Tuesday, October 27, 2015 1:25 PM > To: Chen, Jing D; dev@dpdk.org > Cc: Tao, Zhe; He, Shaopeng; Ananyev, Konstantin; Richardson, Bruce > Subject: Re: [PATCH v2 06/16] fm10k: add Vector RX function >=20 > Hi, >=20 > On 10/22/2015 5:44 PM, Chen Jing D(Mark) wrote: > > From: "Chen Jing D(Mark)" > > > > Add func fm10k_recv_raw_pkts_vec to parse raw packets, in which > > includes possible chained packets. > > Add func fm10k_recv_pkts_vec to receive single mbuf packet. > > > > Signed-off-by: Chen Jing D(Mark) > > --- > > drivers/net/fm10k/fm10k.h | 1 + > > drivers/net/fm10k/fm10k_rxtx_vec.c | 196 > ++++++++++++++++++++++++++++++++++++ > > 2 files changed, 197 insertions(+), 0 deletions(-) > [...] > > + /* mask to shuffle from desc. to mbuf */ > > + shuf_msk =3D _mm_set_epi8( > > + 7, 6, 5, 4, /* octet 4~7, 32bits rss */ > > + 15, 14, /* octet 14~15, low 16 bits vlan_macip */ > > + 13, 12, /* octet 12~13, 16 bits data_len */ > > + 0xFF, 0xFF, /* skip high 16 bits pkt_len, zero out */ > > + 13, 12, /* octet 12~13, low 16 bits pkt_len */ > > + 0xFF, 0xFF, /* skip high 16 bits pkt_type */ > > + 0xFF, 0xFF /* Skip pkt_type field in shuffle operation */ > > + ); > > + > > + /* Cache is empty -> need to scan the buffer rings, but first move > > + * the next 'n' mbufs into the cache > > + */ > > + mbufp =3D &rxq->sw_ring[next_dd]; > > + > > + /* A. load 4 packet in one loop > > + * [A*. mask out 4 unused dirty field in desc] > > + * B. copy 4 mbuf point from swring to rx_pkts > > + * C. calc the number of DD bits among the 4 packets > > + * [C*. extract the end-of-packet bit, if requested] > > + * D. fill info. from desc to mbuf > > + */ > > + for (pos =3D 0, nb_pkts_recd =3D 0; pos < nb_pkts; > It's necessary to floor align the nb_pkts into RTE_FM10K_DESCS_PER_LOOP, > otherwise it may exceed the rx_pkts array. > e.g. nb_pkts is 6, it executes twice in the loop which has chance to get > 8 packets done, but rx_pkts only expect 6 packets. You are right. I'll change accordingly.=20 > > > > + pos +=3D RTE_FM10K_DESCS_PER_LOOP, > > + rxdp +=3D RTE_FM10K_DESCS_PER_LOOP) { > > + __m128i descs0[RTE_FM10K_DESCS_PER_LOOP]; > > + __m128i pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4; > > + __m128i zero, staterr, sterr_tmp1, sterr_tmp2; > > + __m128i mbp1, mbp2; /* two mbuf pointer in one XMM reg. > */ > > + > >