summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Bronowski <piotrx.bronowski@intel.com>2023-08-21 13:36:38 +0000
committerDave Wallace <dwallacelf@gmail.com>2023-08-22 15:42:49 +0000
commitfeda2ff640e3b928e6489be192cba2a7da048cce (patch)
tree7355ae1e417e497046f83944a7a2c0ec7d794ee6
parent6d4b3fd19c45de81026c6a3a468bd9a5b59ebb5f (diff)
dpdk-cryptodev: fix coverity issues
This patch addresses coverity issues CID 322716 and CID 322717. Type: fix Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com> Change-Id: I59d6f40c1af8e829d8cb3c042a52e144aeaf1e6b
-rw-r--r--src/plugins/dpdk/cryptodev/cryptodev.h2
-rw-r--r--src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/dpdk/cryptodev/cryptodev.h b/src/plugins/dpdk/cryptodev/cryptodev.h
index e7bdfc1bddf..63eb46e2319 100644
--- a/src/plugins/dpdk/cryptodev/cryptodev.h
+++ b/src/plugins/dpdk/cryptodev/cryptodev.h
@@ -293,7 +293,7 @@ cryptodev_mark_frame_fill_err (vnet_crypto_async_frame_t *f, u64 current_err,
for (i = index; i < (index + n); i++)
f->elts[i].status = op_s;
- err |= (~(~(0u) << n) << index);
+ err |= (~(~(0ull) << n) << index);
return err;
}
diff --git a/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c b/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c
index 4e4295a9041..29af2fa1994 100644
--- a/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c
+++ b/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c
@@ -515,10 +515,13 @@ cryptodev_frame_dequeue_internal (vlib_main_t *vm, u32 *nb_elts_processed,
fe[2].status = cryptodev_status_conversion[cop[2]->op.status];
fe[3].status = cryptodev_status_conversion[cop[3]->op.status];
- err0 |= (fe[0].status == VNET_CRYPTO_OP_STATUS_COMPLETED) << n;
- err1 |= (fe[1].status == VNET_CRYPTO_OP_STATUS_COMPLETED) << (n + 1);
- err2 |= (fe[2].status == VNET_CRYPTO_OP_STATUS_COMPLETED) << (n + 2);
- err3 |= (fe[3].status == VNET_CRYPTO_OP_STATUS_COMPLETED) << (n + 3);
+ err0 |= ((u64) (fe[0].status == VNET_CRYPTO_OP_STATUS_COMPLETED)) << n;
+ err1 |= ((u64) (fe[1].status == VNET_CRYPTO_OP_STATUS_COMPLETED))
+ << (n + 1);
+ err2 |= ((u64) (fe[2].status == VNET_CRYPTO_OP_STATUS_COMPLETED))
+ << (n + 2);
+ err3 |= ((u64) (fe[3].status == VNET_CRYPTO_OP_STATUS_COMPLETED))
+ << (n + 3);
cop += 4;
fe += 4;