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. Coverity issue: 194998 Fixes: 571365dd4c5e ("crypto/qat: enable Rx head writes coalescing") Cc: stable@dpdk.org Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
This commit is contained in:
parent
3c60756c73
commit
3b12d382db
@ -80,6 +80,7 @@
|
|||||||
#define ADF_RING_NEAR_WATERMARK_512 0x08
|
#define ADF_RING_NEAR_WATERMARK_512 0x08
|
||||||
#define ADF_RING_NEAR_WATERMARK_0 0x00
|
#define ADF_RING_NEAR_WATERMARK_0 0x00
|
||||||
#define ADF_RING_EMPTY_SIG 0x7F7F7F7F
|
#define ADF_RING_EMPTY_SIG 0x7F7F7F7F
|
||||||
|
#define ADF_RING_EMPTY_SIG_BYTE 0x7F
|
||||||
|
|
||||||
/* Valid internal ring size values */
|
/* Valid internal ring size values */
|
||||||
#define ADF_RING_SIZE_128 0x01
|
#define ADF_RING_SIZE_128 0x01
|
||||||
|
@ -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;
|
void *cur_desc = (uint8_t *)q->base_addr + old_head;
|
||||||
|
|
||||||
if (new_head < old_head) {
|
if (new_head < old_head) {
|
||||||
memset(cur_desc, ADF_RING_EMPTY_SIG, max_head - old_head);
|
memset(cur_desc, ADF_RING_EMPTY_SIG_BYTE, max_head - old_head);
|
||||||
memset(q->base_addr, ADF_RING_EMPTY_SIG, new_head);
|
memset(q->base_addr, ADF_RING_EMPTY_SIG_BYTE, new_head);
|
||||||
} else {
|
} 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->nb_processed_responses = 0;
|
||||||
q->csr_head = new_head;
|
q->csr_head = new_head;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user