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 5C5ADE72 for ; Tue, 27 Oct 2015 06:27:48 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 26 Oct 2015 22:27:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,203,1444719600"; d="scan'208";a="588670979" 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:27:46 -0700 Message-ID: <562F0B51.9080508@intel.com> Date: Tue, 27 Oct 2015 13:27:45 +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-9-git-send-email-jing.d.chen@intel.com> In-Reply-To: <1445507104-22563-9-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 08/16] fm10k: add Vector RX scatter 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:27:48 -0000 Hi, On 10/22/2015 5:44 PM, Chen Jing D(Mark) wrote: > From: "Chen Jing D(Mark)" > > Add func fm10k_recv_scattered_pkts_vec to receive chained packets > with SSE instructions. > > Signed-off-by: Chen Jing D(Mark) > --- > drivers/net/fm10k/fm10k.h | 2 + > drivers/net/fm10k/fm10k_rxtx_vec.c | 88 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 90 insertions(+), 0 deletions(-) > [...] > + > +/* > + * vPMD receive routine that reassembles scattered packets > + * > + * Notice: > + * - don't support ol_flags for rss and csum err > + * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet > + * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan RTE_IXGBE_MAX_RX_BURST > + * numbers of DD bit In order to make sure nb_pkts > RTE_IXGBE_MAX_RX_BURST, it's necessary to do RTE_MIN(). > + * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two > + */ > +uint16_t > +fm10k_recv_scattered_pkts_vec(void *rx_queue, > + struct rte_mbuf **rx_pkts, > + uint16_t nb_pkts) > +{ > + struct fm10k_rx_queue *rxq = rx_queue; > + uint8_t split_flags[RTE_FM10K_MAX_RX_BURST] = {0}; > + unsigned i = 0; > + > + /* get some new buffers */ > + uint16_t nb_bufs = fm10k_recv_raw_pkts_vec(rxq, rx_pkts, nb_pkts, > + split_flags); > + if (nb_bufs == 0) > + return 0; > + > + /* happy day case, full burst + no packets to be joined */ > + const uint64_t *split_fl64 = (uint64_t *)split_flags; > + if (rxq->pkt_first_seg == NULL && > + split_fl64[0] == 0 && split_fl64[1] == 0 && > + split_fl64[2] == 0 && split_fl64[3] == 0) > + return nb_bufs; > + > + /* reassemble any packets that need reassembly*/ > + if (rxq->pkt_first_seg == NULL) { > + /* find the first split flag, and only reassemble then*/ > + while (i < nb_bufs && !split_flags[i]) > + i++; > + if (i == nb_bufs) > + return nb_bufs; > + } > + return i + fm10k_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i, > + &split_flags[i]); > +}