* [dpdk-dev] [PATCH] crypto/qat: fix truncated response ring value
@ 2018-01-29 18:33 Fiona Trahe
2018-01-29 19:19 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 2+ messages in thread
From: Fiona Trahe @ 2018-01-29 18:33 UTC (permalink / raw)
To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, stable
Issue detected by coverity. Could never actually cause a
problem as truncated value (0x7f7f7f7f->0x7f) is what's needed.
But fix in code for correctness.
Fixes: 571365dd4c5e ("crypto/qat: enable Rx head writes coalescing")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
drivers/crypto/qat/qat_adf/adf_transport_access_macros.h | 1 +
drivers/crypto/qat/qat_crypto.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h b/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h
index d218f85..4f8f3d1 100644
--- a/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h
+++ b/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h
@@ -80,6 +80,7 @@
#define ADF_RING_NEAR_WATERMARK_512 0x08
#define ADF_RING_NEAR_WATERMARK_0 0x00
#define ADF_RING_EMPTY_SIG 0x7F7F7F7F
+#define ADF_RING_EMPTY_SIG_BYTE 0x7F
/* Valid internal ring size values */
#define ADF_RING_SIZE_128 0x01
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 61760b6..2315b67 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1010,10 +1010,10 @@ void rxq_free_desc(struct qat_qp *qp, struct qat_queue *q)
void *cur_desc = (uint8_t *)q->base_addr + old_head;
if (new_head < old_head) {
- memset(cur_desc, ADF_RING_EMPTY_SIG, max_head - old_head);
- memset(q->base_addr, ADF_RING_EMPTY_SIG, new_head);
+ memset(cur_desc, ADF_RING_EMPTY_SIG_BYTE, max_head - old_head);
+ memset(q->base_addr, ADF_RING_EMPTY_SIG_BYTE, new_head);
} else {
- memset(cur_desc, ADF_RING_EMPTY_SIG, new_head - old_head);
+ memset(cur_desc, ADF_RING_EMPTY_SIG_BYTE, new_head - old_head);
}
q->nb_processed_responses = 0;
q->csr_head = new_head;
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix truncated response ring value
2018-01-29 18:33 [dpdk-dev] [PATCH] crypto/qat: fix truncated response ring value Fiona Trahe
@ 2018-01-29 19:19 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 2+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-29 19:19 UTC (permalink / raw)
To: Trahe, Fiona, dev; +Cc: stable
> -----Original Message-----
> From: Trahe, Fiona
> Sent: Monday, January 29, 2018 6:34 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; stable@dpdk.org
> Subject: [PATCH] crypto/qat: fix truncated response ring value
>
> Issue detected by coverity. Could never actually cause a problem as
> truncated value (0x7f7f7f7f->0x7f) is what's needed.
> But fix in code for correctness.
>
> Fixes: 571365dd4c5e ("crypto/qat: enable Rx head writes coalescing")
> Cc: stable@dpdk.org
>
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Added "Coverity issue: 194998".
Applied to dpdk-next-crypto.
Thanks,
Pablo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-29 19:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-29 18:33 [dpdk-dev] [PATCH] crypto/qat: fix truncated response ring value Fiona Trahe
2018-01-29 19:19 ` De Lara Guarch, Pablo
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).