From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3F0776A80 for ; Tue, 27 Oct 2015 06:25:01 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 26 Oct 2015 22:25:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,203,1444719600"; d="scan'208";a="588669426" Received: from shwdeisgchi017.ccr.corp.intel.com (HELO [10.239.66.70]) ([10.239.66.70]) by FMSMGA003.fm.intel.com with ESMTP; 26 Oct 2015 22:24:59 -0700 Message-ID: <562F0AAA.6060008@intel.com> Date: Tue, 27 Oct 2015 13:24:58 +0800 From: "Liang, Cunming" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Chen Jing D(Mark)" , dev@dpdk.org 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> In-Reply-To: <1445507104-22563-7-git-send-email-jing.d.chen@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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:25:01 -0000 Hi, 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 = _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 = &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 = 0, nb_pkts_recd = 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. > > + pos += RTE_FM10K_DESCS_PER_LOOP, > + rxdp += 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. */ > + >