From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AA6BB1B4D2 for ; Thu, 2 Aug 2018 17:09:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2018 08:09:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,436,1526367600"; d="scan'208";a="77750107" Received: from tjozwiax-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.103.104.43]) by fmsmga001.fm.intel.com with ESMTP; 02 Aug 2018 08:09:29 -0700 From: Tomasz Jozwiak To: pablo.de.lara.guarch@intel.com, dev@dpdk.org, fiona.trahe@intel.com, tomaszx.jozwiak@intel.com Date: Thu, 2 Aug 2018 17:09:25 +0200 Message-Id: <1533222566-17685-2-git-send-email-tomaszx.jozwiak@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533222566-17685-1-git-send-email-tomaszx.jozwiak@intel.com> References: <1533222566-17685-1-git-send-email-tomaszx.jozwiak@intel.com> Subject: [dpdk-dev] [PATCH 1/2] compress/qat: fix buffer lengths in offset case 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: Thu, 02 Aug 2018 15:09:34 -0000 Fixed lengths for src and dest buffers Fixes: 32842f2a6d7d ("compress/qat: create FW request and process response") Signed-off-by: Tomasz Jozwiak Acked-by: Fiona Trahe --- drivers/compress/qat/qat_comp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c index cbf7614..522edfc 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -44,7 +44,8 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg, /* common for sgl and flat buffers */ comp_req->comp_pars.comp_len = op->src.length; - comp_req->comp_pars.out_buffer_sz = rte_pktmbuf_pkt_len(op->m_dst); + comp_req->comp_pars.out_buffer_sz = rte_pktmbuf_pkt_len(op->m_dst) - + op->dst.offset; if (op->m_src->next != NULL || op->m_dst->next != NULL) { /* sgl */ @@ -85,8 +86,9 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg, /* flat aka linear buffer */ ICP_QAT_FW_COMN_PTR_TYPE_SET(comp_req->comn_hdr.comn_req_flags, QAT_COMN_PTR_TYPE_FLAT); - comp_req->comn_mid.src_length = rte_pktmbuf_data_len(op->m_src); - comp_req->comn_mid.dst_length = rte_pktmbuf_data_len(op->m_dst); + comp_req->comn_mid.src_length = op->src.length; + comp_req->comn_mid.dst_length = + comp_req->comp_pars.out_buffer_sz; comp_req->comn_mid.src_data_addr = rte_pktmbuf_mtophys_offset(op->m_src, op->src.offset); -- 2.7.4