DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] compress/qat: display error in case IM buffer too small
@ 2018-10-31  0:44 Fiona Trahe
  2018-10-31 21:46 ` [dpdk-dev] [PATCH v2] " Fiona Trahe
  0 siblings, 1 reply; 4+ messages in thread
From: Fiona Trahe @ 2018-10-31  0:44 UTC (permalink / raw)
  To: dev; +Cc: thomas, akhil.goyal, tomaszx.jozwiak, Fiona Trahe

Display trace if error returned from firmware is likely due
to intermediate buffers being too small for the compressed
output. Update documentation to explain this error case
and to clarify intermediate buffer memory usage.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 doc/guides/cryptodevs/qat.rst   | 22 +++++++++++++++++++---
 drivers/compress/qat/qat_comp.c |  8 ++++++++
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index b2dfeb0..de61a92 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -156,6 +156,7 @@ These are the build configuration options affecting QAT, and their default value
 	CONFIG_RTE_LIBRTE_PMD_QAT_SYM=n
 	CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES=48
 	CONFIG_RTE_PMD_QAT_COMP_SGL_MAX_SEGMENTS=16
+	CONFIG_RTE_PMD_QAT_COMP_IM_BUFFER_SIZE=65536
 
 CONFIG_RTE_LIBRTE_PMD_QAT must be enabled for any QAT PMD to be built.
 
@@ -168,14 +169,29 @@ options and is built by default.
 The number of VFs per PF varies - see table below. If multiple QAT packages are
 installed on a platform then CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES should be
 adjusted to the number of VFs which the QAT common code will need to handle.
-Note, there is a separate config item for max cryptodevs CONFIG_RTE_CRYPTO_MAX_DEVS,
-if necessary this should be adjusted to handle the total of QAT and other devices
-which the process will use.
+Note, there are separate config items for max cryptodevs CONFIG_RTE_CRYPTO_MAX_DEVS
+and max compressdevs CONFIG_RTE_COMPRESS_MAX_DEVS, if necessary these should be
+adjusted to handle the total of QAT and other devices which the process will use.
 
 QAT allocates internal structures to handle SGLs. For the compression service
 CONFIG_RTE_PMD_QAT_COMP_SGL_MAX_SEGMENTS can be changed if more segments are needed.
 An extra (max_inflight_ops x 16) bytes per queue_pair will be used for every increment.
 
+QAT compression PMD needs intermediate buffers to support Deflate compression
+with Dynamic Huffman encoding. CONFIG_RTE_PMD_QAT_COMP_IM_BUFFER_SIZE
+specifies the size of a single buffer, the PMD will allocate a multiple of these,
+plus some extra space for associated meta-data. For GEN2 devices, 20 buffers plus
+1472 bytes are allocated.
+
+.. Note::
+
+	If the compressed output of a Deflate operation using Dynamic Huffman
+        Encoding is too big to fit in an intermediate buffer, then the
+        operation will return RTE_COMP_OP_STATUS_ERROR and an error will be
+        displayed. Options for the application in this case
+        are to split the input data into smaller chunks and resubmit
+        in multiple operations or to allocate larger buffers.
+
 
 Device and driver naming
 ~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index d70c594..2754742 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -141,6 +141,14 @@ qat_comp_process_response(void **op, uint8_t *resp)
 				resp_msg->comn_resp.comn_status)) !=
 				ICP_QAT_FW_COMN_STATUS_FLAG_OK) {
 
+		if (unlikely((ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(
+				resp_msg->comn_resp.comn_status) !=
+				ICP_QAT_FW_COMN_STATUS_FLAG_OK) &&
+				(qat_xform->qat_comp_request_type
+				== QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS)))
+			QAT_DP_LOG(ERR, "QAT intermediate buffer may be too "
+			    "small for output, try configuring a larger size");
+
 		rx_op->status = RTE_COMP_OP_STATUS_ERROR;
 		rx_op->debug_status =
 			*((uint16_t *)(&resp_msg->comn_resp.comn_error));
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v2] compress/qat: display error in case IM buffer too small
  2018-10-31  0:44 [dpdk-dev] [PATCH] compress/qat: display error in case IM buffer too small Fiona Trahe
@ 2018-10-31 21:46 ` Fiona Trahe
  2018-11-01 20:52   ` Jozwiak, TomaszX
  0 siblings, 1 reply; 4+ messages in thread
From: Fiona Trahe @ 2018-10-31 21:46 UTC (permalink / raw)
  To: dev; +Cc: thomas, akhil.goyal, tomaszx.jozwiak, Fiona Trahe

Display trace if error returned from firmware is likely due
to intermediate buffers being too small for the compressed
output. Update documentation to explain this error case
and to clarify intermediate buffer memory usage.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
v2 changes:
 - improved some text in qat.rst

 doc/guides/cryptodevs/qat.rst   | 23 ++++++++++++++++++++---
 drivers/compress/qat/qat_comp.c |  8 ++++++++
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index b2dfeb0..1db9868 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -156,6 +156,7 @@ These are the build configuration options affecting QAT, and their default value
 	CONFIG_RTE_LIBRTE_PMD_QAT_SYM=n
 	CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES=48
 	CONFIG_RTE_PMD_QAT_COMP_SGL_MAX_SEGMENTS=16
+	CONFIG_RTE_PMD_QAT_COMP_IM_BUFFER_SIZE=65536
 
 CONFIG_RTE_LIBRTE_PMD_QAT must be enabled for any QAT PMD to be built.
 
@@ -168,14 +169,30 @@ options and is built by default.
 The number of VFs per PF varies - see table below. If multiple QAT packages are
 installed on a platform then CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES should be
 adjusted to the number of VFs which the QAT common code will need to handle.
-Note, there is a separate config item for max cryptodevs CONFIG_RTE_CRYPTO_MAX_DEVS,
-if necessary this should be adjusted to handle the total of QAT and other devices
-which the process will use.
+Note, there are separate config items for max cryptodevs CONFIG_RTE_CRYPTO_MAX_DEVS
+and max compressdevs CONFIG_RTE_COMPRESS_MAX_DEVS, if necessary these should be
+adjusted to handle the total of QAT and other devices which the process will use.
 
 QAT allocates internal structures to handle SGLs. For the compression service
 CONFIG_RTE_PMD_QAT_COMP_SGL_MAX_SEGMENTS can be changed if more segments are needed.
 An extra (max_inflight_ops x 16) bytes per queue_pair will be used for every increment.
 
+QAT compression PMD needs intermediate buffers to support Deflate compression
+with Dynamic Huffman encoding. CONFIG_RTE_PMD_QAT_COMP_IM_BUFFER_SIZE
+specifies the size of a single buffer, the PMD will allocate a multiple of these,
+plus some extra space for associated meta-data. For GEN2 devices, 20 buffers plus
+1472 bytes are allocated.
+
+.. Note::
+
+	If the compressed output of a Deflate operation using Dynamic Huffman
+        Encoding is too big to fit in an intermediate buffer, then the
+        operation will return RTE_COMP_OP_STATUS_ERROR and an error will be
+        displayed. Options for the application in this case
+        are to split the input data into smaller chunks and resubmit
+        in multiple operations or to configure QAT with
+        larger intermediate buffers.
+
 
 Device and driver naming
 ~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index d70c594..2754742 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -141,6 +141,14 @@ qat_comp_process_response(void **op, uint8_t *resp)
 				resp_msg->comn_resp.comn_status)) !=
 				ICP_QAT_FW_COMN_STATUS_FLAG_OK) {
 
+		if (unlikely((ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(
+				resp_msg->comn_resp.comn_status) !=
+				ICP_QAT_FW_COMN_STATUS_FLAG_OK) &&
+				(qat_xform->qat_comp_request_type
+				== QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS)))
+			QAT_DP_LOG(ERR, "QAT intermediate buffer may be too "
+			    "small for output, try configuring a larger size");
+
 		rx_op->status = RTE_COMP_OP_STATUS_ERROR;
 		rx_op->debug_status =
 			*((uint16_t *)(&resp_msg->comn_resp.comn_error));
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] compress/qat: display error in case IM buffer too small
  2018-10-31 21:46 ` [dpdk-dev] [PATCH v2] " Fiona Trahe
@ 2018-11-01 20:52   ` Jozwiak, TomaszX
  2018-11-02 11:37     ` Akhil Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Jozwiak, TomaszX @ 2018-11-01 20:52 UTC (permalink / raw)
  To: Trahe, Fiona, dev; +Cc: thomas, akhil.goyal



> -----Original Message-----
> From: Trahe, Fiona
> Sent: Wednesday, October 31, 2018 10:47 PM
> To: dev@dpdk.org
> Cc: thomas@monjalon.net; akhil.goyal@nxp.com; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: [PATCH v2] compress/qat: display error in case IM buffer too small
> 
> Display trace if error returned from firmware is likely due to intermediate
> buffers being too small for the compressed output. Update documentation
> to explain this error case and to clarify intermediate buffer memory usage.
> 
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
> ---

Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] compress/qat: display error in case IM buffer too small
  2018-11-01 20:52   ` Jozwiak, TomaszX
@ 2018-11-02 11:37     ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2018-11-02 11:37 UTC (permalink / raw)
  To: Jozwiak, TomaszX, Trahe, Fiona, dev; +Cc: thomas



On 11/2/2018 2:22 AM, Jozwiak, TomaszX wrote:
>
>> -----Original Message-----
>> From: Trahe, Fiona
>> Sent: Wednesday, October 31, 2018 10:47 PM
>> To: dev@dpdk.org
>> Cc: thomas@monjalon.net; akhil.goyal@nxp.com; Jozwiak, TomaszX
>> <tomaszx.jozwiak@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>
>> Subject: [PATCH v2] compress/qat: display error in case IM buffer too small
>>
>> Display trace if error returned from firmware is likely due to intermediate
>> buffers being too small for the compressed output. Update documentation
>> to explain this error case and to clarify intermediate buffer memory usage.
>>
>> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
>> ---
> Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Applied to dpdk-next-crypto

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-02 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31  0:44 [dpdk-dev] [PATCH] compress/qat: display error in case IM buffer too small Fiona Trahe
2018-10-31 21:46 ` [dpdk-dev] [PATCH v2] " Fiona Trahe
2018-11-01 20:52   ` Jozwiak, TomaszX
2018-11-02 11:37     ` Akhil Goyal

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).