From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0073.outbound.protection.outlook.com [104.47.42.73]) by dpdk.org (Postfix) with ESMTP id C8245160 for ; Tue, 24 Jul 2018 09:45:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LaHtuvVHkaxfZO9Qv5Fnu05IlbjVqkU+V9sVEyFI2P0=; b=TbFYZhzF70Q9vAuOMv6Xyt4iTK0zvJrGT4c1XlDgzR5QO55Ed59WMabO0SevMZaiIWZ/UcZIWc8VAGEZu5H9RKLIuyU+kZ6pRo6ShvpKtx7FPPbiRv2k0mw34wZRqquy0YILKpe51RohnDcUhsStRLqBhfRbClbuKcGKKjaYotk= Received: from CY4PR0701MB3634.namprd07.prod.outlook.com (52.132.101.164) by CY4PR0701MB3778.namprd07.prod.outlook.com (52.132.102.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Tue, 24 Jul 2018 07:45:00 +0000 Received: from CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f0d4:1828:37f5:5927]) by CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f0d4:1828:37f5:5927%2]) with mapi id 15.20.0973.022; Tue, 24 Jul 2018 07:44:59 +0000 From: "Verma, Shally" To: "De Lara Guarch, Pablo" CC: "dev@dpdk.org" , "Athreya, Narayana Prasad" , "Challa, Mahipal" , "Sahu, Sunila" , "Sahu, Sunila" , "Gupta, Ashish" Thread-Topic: [PATCH v4 4/5] compress/zlib: support burst enqueue/dequeue Thread-Index: AQHUItQPKmq2JwkIfUmYf9geT9S7PaSd+46A Date: Tue, 24 Jul 2018 07:44:59 +0000 Message-ID: References: <1532357474-9544-1-git-send-email-shally.verma@caviumnetworks.com> <1532357474-9544-5-git-send-email-shally.verma@caviumnetworks.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Shally.Verma@cavium.com; x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR0701MB3778; 6:k2UsDdHmpgAoV7oCaB/nyqnnJZKrhsXBoBTqBDeqc31F80Ju31CkYHtvIuTttGiAVq+kpHNnCgH5rfxO2gZ1rn+I5zPYMWGmVjMtsyrajAiJLi7OJ09qslBHexRCGO0e7A+ncpEGr5GOJL0q1NG2JJsukfnHzyHIwEY5PYigkbXjq443ONP+sZrOQpCHH6ib2yQ0hqhAZwt2416UcExjXY8Hf37t4jZzzpK1PVcSlB1OLOPoBxBitDUHwY9fZJxxYBuGDYfyMqbcSp5q1/tMWTr+d8V3qUrnw2XLWL1iYEFi2Aj9ZZOI21Rpkuf73VNnf8vLtEddWbfdvI0Iv+LxDWw1V6PNw7Stug+Gxb6q3Sp6qiQBGxM+WlJ1yUFRtzrOxEnA6Ixc0DBYuzS7GUJUpDoeMAwnupQSZNklHSpuW9cSo7zYTwn5L7l/cRoQzQg/cC1IsnkARKIuzenntkvkHA==; 5:SoMSYnC+BQEBJ1rMQfAMI0nI9F08Buo01ZFrngwO28dXWGjaxDm+VL4Pe3OWH/l7FRsSRRWSAvLsmURpulKjLG803wUywzLe0YCQsDPTMtwxKIzuBaVGUjYpmBUqYLuQj2xuCvadLdZQ2k15rtDmCqWCscV340SMZzi2My8NCdU=; 7:p6a+81/ywnA36mkDDXUIq4nKtBqcFkEpMGiZCMLQL3ugLsFkbdiz7TsGrqOhSLPfqInbZdgb7/WcGISxNOiimXwBgluJ64roh+3Rs1yBCYDCOHCjaz65yWXIPPCHNEvrXa7yrEMDcDaIPehbl6ZUt/Yeqvt2R358HyStmThsIuZ5u1NRjUGgJxHqDdfQAfZBDFt5cH7ajJCyybwT8hH++oICTNkIoRlyMdmG70RY+B/h6lueVszs9TijU2vZPXd8 x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(366004)(39860400002)(396003)(13464003)(189003)(199004)(74316002)(4326008)(54906003)(6506007)(26005)(478600001)(316002)(102836004)(14454004)(55236004)(966005)(55016002)(86362001)(72206003)(229853002)(68736007)(66066001)(53936002)(53546011)(2900100001)(5250100002)(7696005)(76176011)(6246003)(107886003)(6116002)(3846002)(25786009)(305945005)(14444005)(81166006)(256004)(6306002)(8936002)(9686003)(8676002)(6916009)(81156014)(476003)(2906002)(97736004)(5660300001)(446003)(486006)(6436002)(11346002)(99286004)(33656002)(7736002)(105586002)(186003)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3778; H:CY4PR0701MB3634.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-office365-filtering-correlation-id: 491be5a5-6dc5-45a4-f20f-08d5f1395bda x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:CY4PR0701MB3778; x-ms-traffictypediagnostic: CY4PR0701MB3778: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3778; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3778; x-forefront-prvs: 0743E8D0A6 received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 2FTYXqF/8EK/bRRIQjikyCvqmrOfIojZUeRkTI/rTLTCaoLVUuGPRmEM7CaLfkEDgTd5GAlo6GZtdC54aqINSfQP1FQTpmhXdcCFpOaz320h5lclqwg5tUmq4XSoaJoINN7k1yDP480evh1Ty6JTC0ZUtCoeMyNWoEicPL75L2vymNzqTC2EZwo07jr/tnPEruWb3H5Qflne5yR+n1kQO0CuIEsJmM12uDj0HywN/KWRbbMF4G+IWVu1E+E00ewyZgleg6VuouqnWWAwbQZLwNL9hNAquuVMiKjV2mt6pqip8HXQQr+rPRw3vXiH3cKKD5J4/bkfA+BiptrGCYMCAjLIwonTOIk2SsPDCHvojHU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 491be5a5-6dc5-45a4-f20f-08d5f1395bda X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2018 07:44:59.8127 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3778 Subject: Re: [dpdk-dev] [PATCH v4 4/5] compress/zlib: support burst enqueue/dequeue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 07:45:03 -0000 >-----Original Message----- >From: De Lara Guarch, Pablo >Sent: 24 July 2018 03:55 >To: Verma, Shally >Cc: dev@dpdk.org; Athreya, Narayana Prasad ; Challa, Mahipal >; Sahu, Sunila ; Sahu, = Sunila ; Gupta, Ashish > >Subject: RE: [PATCH v4 4/5] compress/zlib: support burst enqueue/dequeue > >External Email > >> -----Original Message----- >> From: Shally Verma [mailto:shally.verma@caviumnetworks.com] >> Sent: Monday, July 23, 2018 3:51 PM >> To: De Lara Guarch, Pablo >> Cc: dev@dpdk.org; pathreya@caviumnetworks.com; >> mchalla@caviumnetworks.com; Sunila Sahu ; >> Sunila Sahu ; Ashish Gupta >> >> Subject: [PATCH v4 4/5] compress/zlib: support burst enqueue/dequeue >> >> From: Sunila Sahu >> >> Signed-off-by: Sunila Sahu >> Signed-off-by: Shally Verma >> Signed-off-by: Ashish Gupta >> --- >> drivers/compress/zlib/zlib_pmd.c | 255 >> ++++++++++++++++++++++++++++++++++++++- >> 1 file changed, 254 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zl= ib_pmd.c >> index 47bc73d..dc1e230 100644 >> --- a/drivers/compress/zlib/zlib_pmd.c >> +++ b/drivers/compress/zlib/zlib_pmd.c >> @@ -7,7 +7,214 @@ >> >> #include "zlib_pmd_private.h" >> >> -/** Parse comp xform and set private xform/stream parameters */ >> +/** Compute next mbuf in the list, assign data buffer and length, >> + * returns 0 if mbuf is NULL >> + */ >> +#define COMPUTE_BUF(mbuf, data, len) \ >> + ((mbuf =3D mbuf->next) ? \ >> + (data =3D rte_pktmbuf_mtod(mbuf, uint8_t *)), \ >> + (len =3D rte_pktmbuf_data_len(mbuf)) : 0) >> + >> +static void >> +process_zlib_deflate(struct rte_comp_op *op, z_stream *strm) { > >... > >> + /* Update z_stream with the inputs provided by application */ >> + strm->next_in =3D rte_pktmbuf_mtod_offset(mbuf_src, uint8_t *, >> + op->src.offset); > >This is assuming that src buffer is a linear buffer or that offset won't b= e large enough to cross boundaries between segments. >If an SGL is passed and offset is bigger than the first segment, next_in s= hould point at a different segment, with the remaining part of >the offset in that segment >(look at ISA-L SGL patch: http://patches.dpdk.org/patch/43283/). Same appl= ies to avail_in, next_out and avail_out. [Shally] as per my last knowledge, offset was expected to be belonging only= to the first segment in chained mbuf. Isn't that the case anymore? Did I m= iss any update on its definition? We had added the logic earlier that you're suggesting but removed that late= r, as I understood clarification about offset falling into any segment is s= till pending. Thanks Shally > >> + >> + strm->avail_in =3D rte_pktmbuf_data_len(mbuf_src) - op->src.offset= ; >> + >> + strm->next_out =3D rte_pktmbuf_mtod_offset(mbuf_dst, uint8_t *, >> + op->dst.offset); >> + >> + strm->avail_out =3D rte_pktmbuf_data_len(mbuf_dst) - op->dst.offse= t; >> + > >... > >> + strm->next_in =3D rte_pktmbuf_mtod_offset(mbuf_src, uint8_t *, >> + op->src.offset); >> + >> + strm->avail_in =3D rte_pktmbuf_data_len(mbuf_src) - op->src.offset= ; >> + >> + strm->next_out =3D rte_pktmbuf_mtod_offset(mbuf_dst, uint8_t *, >> + op->dst.offset); >> + >> + strm->avail_out =3D rte_pktmbuf_data_len(mbuf_dst) - op->dst.offse= t; > >Same comments as above (compression). > >... > >> +static inline int >> +process_zlib_op(struct zlib_qp *qp, struct rte_comp_op *op) { >> + struct zlib_stream *stream; >> + struct zlib_priv_xform *private_xform; >> + >> + if ((op->op_type =3D=3D RTE_COMP_OP_STATEFUL) || >> + (op->src.offset > rte_pktmbuf_data_len(op->m_src)) || >> + (op->dst.offset > rte_pktmbuf_data_len(op->m_dst))) { > >Since m_src and m_dst could be SGLs, pkt_len should be checked, instead of= data_len (which would be only for single segment). >Also, you should check the length too, in case of source buffers (src.offs= et + src.length > m_src->pkt_len). > >Lastly, the two lines after the first if line should have double indentati= on to distinguish clearly against the body of the if. >If line is too long, consider storing the length of the buffers in variabl= es. > > >> + op->status =3D RTE_COMP_OP_STATUS_INVALID_ARGS; >> + ZLIB_PMD_ERR("Invalid source or destination buffers or " >> + "invalid Operation requested\n");