From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jing.d.chen@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id F0CA46A80
 for <dev@dpdk.org>; Tue, 27 Oct 2015 06:43:48 +0100 (CET)
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by orsmga103.jf.intel.com with ESMTP; 26 Oct 2015 22:43:47 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,203,1444719600"; d="scan'208";a="836278807"
Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206])
 by fmsmga002.fm.intel.com with ESMTP; 26 Oct 2015 22:43:47 -0700
Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) 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:43:47 -0700
Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by
 FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Mon, 26 Oct 2015 22:43:47 -0700
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.253]) by
 SHSMSX104.ccr.corp.intel.com ([169.254.5.194]) with mapi id 14.03.0248.002;
 Tue, 27 Oct 2015 13:43:45 +0800
From: "Chen, Jing D" <jing.d.chen@intel.com>
To: "Liang, Cunming" <cunming.liang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2 08/16] fm10k: add Vector RX scatter function
Thread-Index: AQHRDK5n9eJ7u3OnEUaE0ET/Cnol3p5+UPGAgACJASA=
Date: Tue, 27 Oct 2015 05:43:44 +0000
Message-ID: <4341B239C0EFF9468EE453F9E9F4604D02AE4AC8@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-9-git-send-email-jing.d.chen@intel.com>
 <562F0B51.9080508@intel.com>
In-Reply-To: <562F0B51.9080508@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 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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 27 Oct 2015 05:43:49 -0000

Hi, Steve,

Best Regards,
Mark


> -----Original Message-----
> From: Liang, Cunming
> Sent: Tuesday, October 27, 2015 1:28 PM
> To: Chen, Jing D; dev@dpdk.org
> Cc: Tao, Zhe; He, Shaopeng; Ananyev, Konstantin; Richardson, Bruce
> Subject: Re: [PATCH v2 08/16] fm10k: add Vector RX scatter function
>=20
> Hi,
>=20
> On 10/22/2015 5:44 PM, Chen Jing D(Mark) wrote:
> > From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
> >
> > Add func fm10k_recv_scattered_pkts_vec to receive chained packets
> > with SSE instructions.
> >
> > Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
> > ---
> >   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().

I'll remove the improper comments. In func fm10k_recv_raw_pkts_vec, it will=
 use
nb_pkts as index to iterate properly.
After then, below func will use actual received packet size nb_bufs as inde=
x to iterate.
So, I think RTE_MIN() is not necessary?

> > + * - 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 =3D rx_queue;
> > +	uint8_t split_flags[RTE_FM10K_MAX_RX_BURST] =3D {0};
> > +	unsigned i =3D 0;
> > +
> > +	/* get some new buffers */
> > +	uint16_t nb_bufs =3D fm10k_recv_raw_pkts_vec(rxq, rx_pkts, nb_pkts,
> > +			split_flags);
> > +	if (nb_bufs =3D=3D 0)
> > +		return 0;
> > +
> > +	/* happy day case, full burst + no packets to be joined */
> > +	const uint64_t *split_fl64 =3D (uint64_t *)split_flags;
> > +	if (rxq->pkt_first_seg =3D=3D NULL &&
> > +			split_fl64[0] =3D=3D 0 && split_fl64[1] =3D=3D 0 &&
> > +			split_fl64[2] =3D=3D 0 && split_fl64[3] =3D=3D 0)
> > +		return nb_bufs;
> > +
> > +	/* reassemble any packets that need reassembly*/
> > +	if (rxq->pkt_first_seg =3D=3D NULL) {
> > +		/* find the first split flag, and only reassemble then*/
> > +		while (i < nb_bufs && !split_flags[i])
> > +			i++;
> > +		if (i =3D=3D nb_bufs)
> > +			return nb_bufs;
> > +	}
> > +	return i + fm10k_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
> > +		&split_flags[i]);
> > +}