From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
To: pablo.de.lara.guarch@intel.com, dev@dpdk.org,
fiona.trahe@intel.com, tomaszx.jozwiak@intel.com
Subject: [dpdk-dev] [PATCH 1/2] compress/qat: fix buffer lengths in offset case
Date: Thu, 2 Aug 2018 17:09:25 +0200 [thread overview]
Message-ID: <1533222566-17685-2-git-send-email-tomaszx.jozwiak@intel.com> (raw)
In-Reply-To: <1533222566-17685-1-git-send-email-tomaszx.jozwiak@intel.com>
Fixed lengths for src and dest buffers
Fixes: 32842f2a6d7d ("compress/qat: create FW request and process response")
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
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
next prev parent reply other threads:[~2018-08-02 15:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 15:09 [dpdk-dev] [PATCH 0/2] common/qat: handle offset greater than first sgl segment Tomasz Jozwiak
2018-08-02 15:09 ` Tomasz Jozwiak [this message]
2018-08-02 15:09 ` [dpdk-dev] [PATCH 2/2] common/qat: fix " Tomasz Jozwiak
2018-08-03 10:38 ` [dpdk-dev] [PATCH 0/2] common/qat: handle " De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1533222566-17685-2-git-send-email-tomaszx.jozwiak@intel.com \
--to=tomaszx.jozwiak@intel.com \
--cc=dev@dpdk.org \
--cc=fiona.trahe@intel.com \
--cc=pablo.de.lara.guarch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).