* [dpdk-dev] [PATCH] common/qat: fix queue head update
@ 2020-05-05 15:30 Adam Dybkowski
2020-05-05 15:42 ` Trahe, Fiona
2020-05-07 8:30 ` Zhao, XinfengX
0 siblings, 2 replies; 4+ messages in thread
From: Adam Dybkowski @ 2020-05-05 15:30 UTC (permalink / raw)
To: dev, fiona.trahe; +Cc: Adam Dybkowski
This patch fixes missing queue head update that occured when
a multiple-request dynamic Huffman compression operation was not
complete within one qat_dequeue_op_burst function call.
Fixes: c13cecf60f12 ("compress/qat: support IM buffer too small operation")
Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
drivers/common/qat/qat_qp.c | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index 64dfd85c4..098b99786 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -831,7 +831,7 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)
uint32_t head;
uint32_t op_resp_counter = 0, fw_resp_counter = 0;
uint8_t *resp_msg;
- int nb_fw_responses = 0;
+ int nb_fw_responses;
rx_queue = &(tmp_qp->rx_q);
head = rx_queue->head;
@@ -840,24 +840,20 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)
while (*(uint32_t *)resp_msg != ADF_RING_EMPTY_SIG &&
op_resp_counter != nb_ops) {
- nb_fw_responses = 0;
- if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC) {
- qat_sym_process_response(ops, resp_msg);
- nb_fw_responses = 1;
- } else if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION)
+ nb_fw_responses = 1;
+ if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC)
+ qat_sym_process_response(ops, resp_msg);
+ else if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION)
nb_fw_responses = qat_comp_process_response(
ops, resp_msg,
tmp_qp->op_cookies[head >> rx_queue->trailz],
&tmp_qp->stats.dequeue_err_count);
-
- else if (tmp_qp->service_type == QAT_SERVICE_ASYMMETRIC) {
#ifdef BUILD_QAT_ASYM
+ else if (tmp_qp->service_type == QAT_SERVICE_ASYMMETRIC)
qat_asym_process_response(ops, resp_msg,
tmp_qp->op_cookies[head >> rx_queue->trailz]);
- nb_fw_responses = 1;
#endif
- }
head = adf_modulo(head + rx_queue->msg_size,
rx_queue->modulo_mask);
@@ -879,18 +875,17 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)
* finished with all firmware responses.
*/
fw_resp_counter += nb_fw_responses;
+
+ rx_queue->nb_processed_responses++;
}
- if (fw_resp_counter > 0) {
- rx_queue->head = head;
- tmp_qp->dequeued += fw_resp_counter;
- tmp_qp->stats.dequeued_count += fw_resp_counter;
- rx_queue->nb_processed_responses += fw_resp_counter;
+ tmp_qp->dequeued += fw_resp_counter;
+ tmp_qp->stats.dequeued_count += fw_resp_counter;
+
+ rx_queue->head = head;
+ if (rx_queue->nb_processed_responses > QAT_CSR_HEAD_WRITE_THRESH)
+ rxq_free_desc(tmp_qp, rx_queue);
- if (rx_queue->nb_processed_responses >
- QAT_CSR_HEAD_WRITE_THRESH)
- rxq_free_desc(tmp_qp, rx_queue);
- }
QAT_DP_LOG(DEBUG, "Dequeue burst return: %u, QAT responses: %u",
op_resp_counter, fw_resp_counter);
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] common/qat: fix queue head update
2020-05-05 15:30 [dpdk-dev] [PATCH] common/qat: fix queue head update Adam Dybkowski
@ 2020-05-05 15:42 ` Trahe, Fiona
2020-05-07 8:30 ` Zhao, XinfengX
1 sibling, 0 replies; 4+ messages in thread
From: Trahe, Fiona @ 2020-05-05 15:42 UTC (permalink / raw)
To: Dybkowski, AdamX, dev
> -----Original Message-----
> From: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> Sent: Tuesday, May 5, 2020 4:31 PM
> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
> Cc: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> Subject: [PATCH] common/qat: fix queue head update
>
> This patch fixes missing queue head update that occured when
> a multiple-request dynamic Huffman compression operation was not
> complete within one qat_dequeue_op_burst function call.
>
> Fixes: c13cecf60f12 ("compress/qat: support IM buffer too small operation")
>
> Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] common/qat: fix queue head update
2020-05-05 15:30 [dpdk-dev] [PATCH] common/qat: fix queue head update Adam Dybkowski
2020-05-05 15:42 ` Trahe, Fiona
@ 2020-05-07 8:30 ` Zhao, XinfengX
2020-05-09 21:56 ` Akhil Goyal
1 sibling, 1 reply; 4+ messages in thread
From: Zhao, XinfengX @ 2020-05-07 8:30 UTC (permalink / raw)
To: dev; +Cc: Dybkowski, AdamX
Tested-by: Zhao, Xinfeng<xinfengx.zhao@intel.com>
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adam Dybkowski
Sent: Tuesday, May 5, 2020 11:31 PM
To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
Cc: Dybkowski, AdamX <adamx.dybkowski@intel.com>
Subject: [dpdk-dev] [PATCH] common/qat: fix queue head update
This patch fixes missing queue head update that occured when a multiple-request dynamic Huffman compression operation was not complete within one qat_dequeue_op_burst function call.
Fixes: c13cecf60f12 ("compress/qat: support IM buffer too small operation")
Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
drivers/common/qat/qat_qp.c | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c index 64dfd85c4..098b99786 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -831,7 +831,7 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)
uint32_t head;
uint32_t op_resp_counter = 0, fw_resp_counter = 0;
uint8_t *resp_msg;
- int nb_fw_responses = 0;
+ int nb_fw_responses;
rx_queue = &(tmp_qp->rx_q);
head = rx_queue->head;
@@ -840,24 +840,20 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)
while (*(uint32_t *)resp_msg != ADF_RING_EMPTY_SIG &&
op_resp_counter != nb_ops) {
- nb_fw_responses = 0;
- if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC) {
- qat_sym_process_response(ops, resp_msg);
- nb_fw_responses = 1;
- } else if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION)
+ nb_fw_responses = 1;
+ if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC)
+ qat_sym_process_response(ops, resp_msg);
+ else if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION)
nb_fw_responses = qat_comp_process_response(
ops, resp_msg,
tmp_qp->op_cookies[head >> rx_queue->trailz],
&tmp_qp->stats.dequeue_err_count);
-
- else if (tmp_qp->service_type == QAT_SERVICE_ASYMMETRIC) {
#ifdef BUILD_QAT_ASYM
+ else if (tmp_qp->service_type == QAT_SERVICE_ASYMMETRIC)
qat_asym_process_response(ops, resp_msg,
tmp_qp->op_cookies[head >> rx_queue->trailz]);
- nb_fw_responses = 1;
#endif
- }
head = adf_modulo(head + rx_queue->msg_size,
rx_queue->modulo_mask);
@@ -879,18 +875,17 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)
* finished with all firmware responses.
*/
fw_resp_counter += nb_fw_responses;
+
+ rx_queue->nb_processed_responses++;
}
- if (fw_resp_counter > 0) {
- rx_queue->head = head;
- tmp_qp->dequeued += fw_resp_counter;
- tmp_qp->stats.dequeued_count += fw_resp_counter;
- rx_queue->nb_processed_responses += fw_resp_counter;
+ tmp_qp->dequeued += fw_resp_counter;
+ tmp_qp->stats.dequeued_count += fw_resp_counter;
+
+ rx_queue->head = head;
+ if (rx_queue->nb_processed_responses > QAT_CSR_HEAD_WRITE_THRESH)
+ rxq_free_desc(tmp_qp, rx_queue);
- if (rx_queue->nb_processed_responses >
- QAT_CSR_HEAD_WRITE_THRESH)
- rxq_free_desc(tmp_qp, rx_queue);
- }
QAT_DP_LOG(DEBUG, "Dequeue burst return: %u, QAT responses: %u",
op_resp_counter, fw_resp_counter);
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] common/qat: fix queue head update
2020-05-07 8:30 ` Zhao, XinfengX
@ 2020-05-09 21:56 ` Akhil Goyal
0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2020-05-09 21:56 UTC (permalink / raw)
To: Zhao, XinfengX, dev; +Cc: Dybkowski, AdamX
> Tested-by: Zhao, Xinfeng<xinfengx.zhao@intel.com>
>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-09 21:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 15:30 [dpdk-dev] [PATCH] common/qat: fix queue head update Adam Dybkowski
2020-05-05 15:42 ` Trahe, Fiona
2020-05-07 8:30 ` Zhao, XinfengX
2020-05-09 21:56 ` 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).