DPDK Coverity issue 381631, 381646
v3 cover DPDK Coverity issue 381631, 381646
v3: Split commits further for clarity.
v2: Split code unrelated to coverity fix in separate commit.
v1: Upstream fix to 23.03 for potential issue of dereferencing a pointer before null check.
Hernan Vargas (3):
baseband/acc: fix check after deref and dead code baseband/acc: remove unused ops check baseband/acc: add check for empty queue
drivers/baseband/acc/rte_acc100_pmd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 1 line
2.37.1
PATCH v3 1/3 baseband/acc: fix check after deref and dead code
Fix potential issue of dereferencing a pointer before null check. Remove null check for value that could never be null.
Coverity issue: 381646, 381631
--- drivers/baseband/acc/rte_acc100_pmd.c | 2 -- 1 file changed, 2 deletions(-)
drivers/baseband/acc/rte_acc100_pmd.c +0 -2
@@ -4106,8 +4106,6 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,int ret, cbm;struct rte_bbdev_enc_op *op; -if (q ==NULL ) -return 0 ;#ifdef RTE_LIBRTE_BBDEV_DEBUG if (unlikely (ops ==0 ))return 0 ;
Signature · 1 line
2.37.1
PATCH v3 2/3 baseband/acc: remove unused ops check
In reply to Hernan VargasRemove unnecessary debug check for ops.
--- drivers/baseband/acc/rte_acc100_pmd.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/baseband/acc/rte_acc100_pmd.c +0 -4
@@ -4106,10 +4106,6 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,int ret, cbm;struct rte_bbdev_enc_op *op; -#ifdef RTE_LIBRTE_BBDEV_DEBUG -if (unlikely (ops ==0 )) -return 0 ; -#endif op =acc_op_tail (q,0 );if (unlikely (ops ==NULL || op ==NULL ))return 0 ;
Signature · 1 line
2.37.1
Re: [PATCH v3 2/3] baseband/acc: remove unused ops check
Quoted 12 lines · Hernan Vargas
Remove unnecessary debug check for ops.
Signed-off-by Hernan Vargas <[email protected]>--- drivers/baseband/acc/rte_acc100_pmd.c | 4 ---- 1 file changed, 4 deletions(-)drivers/baseband/acc/rte_acc100_pmd.c +0
-0
drivers/baseband/acc/rte_acc100_pmd.c acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data, · line 4111
Quoted 10 lines
drivers/baseband/acc/rte_acc100_pmd.c +0
-4@@ -4106,10 +4106,6 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,int ret, cbm;struct rte_bbdev_enc_op *op; -#ifdef RTE_LIBRTE_BBDEV_DEBUG -if (unlikely (ops ==0 )) -return 0 ; -#endif op =acc_op_tail (q,0 );if (unlikely (ops ==NULL || op ==NULL ))return 0 ;
Thanks,
Maxime
PATCH v3 3/3 baseband/acc: add check for empty queue
In reply to Hernan VargasAdd optimization to return early if there are no available descriptors in ring to dequeue.
--- drivers/baseband/acc/rte_acc100_pmd.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/baseband/acc/rte_acc100_pmd.c +3 -0
@@ -4106,6 +4106,9 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,int ret, cbm;struct rte_bbdev_enc_op *op; +if (avail ==0 ) +return 0 ; + op =acc_op_tail (q,0 );if (unlikely (ops ==NULL || op ==NULL ))return 0 ;
Signature · 1 line
2.37.1
Re: [PATCH v3 3/3] baseband/acc: add check for empty queue
Quoted 13 lines · Hernan Vargas
Add optimization to return early if there are no available descriptors in ring to dequeue.
Signed-off-by Hernan Vargas <[email protected]>--- drivers/baseband/acc/rte_acc100_pmd.c | 3 +++ 1 file changed, 3 insertions(+)drivers/baseband/acc/rte_acc100_pmd.c +0
-0
drivers/baseband/acc/rte_acc100_pmd.c acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data, · line 4114
Quoted 9 lines
drivers/baseband/acc/rte_acc100_pmd.c +3
-0@@ -4106,6 +4106,9 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,int ret, cbm;struct rte_bbdev_enc_op *op; +if (avail ==0 ) +return 0 ; + op =acc_op_tail (q,0 );if (unlikely (ops ==NULL || op ==NULL ))return 0 ;
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 4 lines · Hernan Vargas
v3: Split commits further for clarity.
v2: Split code unrelated to coverity fix in separate commit.
v1: Upstream fix to 23.03 for potential issue of dereferencing a pointer before null check.
Quoted 8 lines
Hernan Vargas (3):
baseband/acc: fix check after deref and dead code baseband/acc: remove unused ops check baseband/acc: add check for empty queuedrivers/baseband/acc/rte_acc100_pmd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Applied to dpdk-next-baseband/for-main.
Thanks,
Maxime