From mboxrd@z Thu Jan 1 00:00:00 1970 From: "De Lara Guarch, Pablo" Subject: Re: [PATCH 04/13] baseband/turbo_sw: memcpy changed or removed from driver Date: Mon, 7 May 2018 12:26:50 +0000 Message-ID: References: <20180426133008.12388-1-kamilx.chalupnik@intel.com> <20180426133008.12388-4-kamilx.chalupnik@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Mokhtar, Amr" To: "Chalupnik, KamilX" , "dev@dpdk.org" Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7FC3C23A for ; Mon, 7 May 2018 14:26:53 +0200 (CEST) In-Reply-To: <20180426133008.12388-4-kamilx.chalupnik@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Chalupnik, KamilX > Sent: Thursday, April 26, 2018 2:30 PM > To: dev@dpdk.org > Cc: Mokhtar, Amr ; De Lara Guarch, Pablo > ; Chalupnik, KamilX > > Subject: [PATCH 04/13] baseband/turbo_sw: memcpy changed or removed from > driver >=20 It is not clear what this patch is trying to do, based on the title? Minimizing memory copying? Please, modify the title to be more clear. > From: KamilX Chalupnik >=20 > Optimization of Turbo Software driver: > - usage of memcpy changed or removed > - minor changes in defines definitions Could you split this patch in two patches? One with the macro changes and the other one making changes on the memory copying? Also, do those macros need to be in bbdev layer? Will they be used in other PMDs? >=20 > Signed-off-by: Kamil Chalupnik > --- > drivers/baseband/turbo_sw/bbdev_turbo_software.c | 143 +++++++++++++----= - > ----- > lib/librte_bbdev/rte_bbdev_op.h | 18 ++- > 2 files changed, 100 insertions(+), 61 deletions(-) >=20 > diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c > b/drivers/baseband/turbo_sw/bbdev_turbo_software.c > index 26b8560..2728b30 100644 > --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c > +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c ... > - /* copy the input to the temporary buffer to be able to extend > - * it by 3 CRC bytes > - */ > - rte_memcpy(q->enc_in, in, (k - 24) >> 3); > crc_req.data =3D in; > crc_req.len =3D (k - 24) >> 3; > - crc_resp.data =3D q->enc_in; > - bblib_lte_crc24a_gen(&crc_req, &crc_resp); > + /* Check if there is a room for CRC bits if not use > + * the temporary buffer. > + */ Check if there is room for CRC bits. If not.... > + if (rte_pktmbuf_append(m_in, 3) =3D=3D NULL) { > + rte_memcpy(q->enc_in, in, (k - 24) >> 3); > + in =3D q->enc_in; > + } else { > + /* Store 3 first bytes of next CB as they will be > + * overwritten by CRC bytes. If it is the last CB then > + * there is no point to store 3 next bytes and this > + * if..else branch will be omitted. > + */ > + first_3_bytes =3D *((uint64_t *)&in[(k - 32) >> 3]); >=20 ... > - rte_memcpy(q->enc_in, in, (k - 24) >> 3); > crc_req.data =3D in; > crc_req.len =3D (k - 24) >> 3; > - crc_resp.data =3D q->enc_in; > - bblib_lte_crc24b_gen(&crc_req, &crc_resp); > + /* Check if there is a room for CRC bits if this is the last > + * CB in TB. If not use temporary buffer. Same as above. > + */