* [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
@ 2019-10-01 13:03 ` Kevin Traynor
2019-10-02 1:28 ` Ajit Khaparde
2019-10-01 13:04 ` [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic Kevin Traynor
` (6 subsequent siblings)
7 siblings, 1 reply; 50+ messages in thread
From: Kevin Traynor @ 2019-10-01 13:03 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, lance.richardson, stable
If rc contains a non-zero return code from bnxt_hwrm_send_message(),
HWRM_CHECK_RESULT_SILENT() will return.
Just after that code, there is an 'if (!rc) {...} else {...}'.
Coverity is complaining that this if else statement is dead code as
rc will always be 0 if that code is reached.
4309 rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),
BNXT_USE_CHIMP_MB);
cond_const: Condition rc, taking false branch.
Now the value of rc is equal to 0.
4310 HWRM_CHECK_RESULT_SILENT();
4311
const: At condition rc, the value of rc must be equal to 0.
dead_error_condition: The condition !rc must be true.
4312 if (!rc) {
[snip]
4373 } else {
CID 343450 (#1 of 1): Logically dead code
(DEADCODE)dead_error_line: Execution cannot
reach this statement: rc = 0;.
4374 rc = 0;
4375 }
Coverity issue: 343450
Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Cc: lance.richardson@broadcom.com
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 118 +++++++++++++++++------------------
1 file changed, 56 insertions(+), 62 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 9883fb506..5378e3e9c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4298,5 +4298,7 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp)
struct hwrm_func_backing_store_qcaps_output *resp =
bp->hwrm_cmd_resp_addr;
- int rc;
+ struct bnxt_ctx_pg_info *ctx_pg;
+ struct bnxt_ctx_mem_info *ctx;
+ int rc, total_alloc_len, i;
if (!BNXT_CHIP_THOR(bp) ||
@@ -4310,68 +4312,60 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp)
HWRM_CHECK_RESULT_SILENT();
- if (!rc) {
- struct bnxt_ctx_pg_info *ctx_pg;
- struct bnxt_ctx_mem_info *ctx;
- int total_alloc_len;
- int i;
+ total_alloc_len = sizeof(*ctx);
+ ctx = rte_malloc("bnxt_ctx_mem", total_alloc_len,
+ RTE_CACHE_LINE_SIZE);
+ if (!ctx) {
+ rc = -ENOMEM;
+ goto ctx_err;
+ }
+ memset(ctx, 0, total_alloc_len);
- total_alloc_len = sizeof(*ctx);
- ctx = rte_malloc("bnxt_ctx_mem", total_alloc_len,
- RTE_CACHE_LINE_SIZE);
- if (!ctx) {
- rc = -ENOMEM;
- goto ctx_err;
- }
- memset(ctx, 0, total_alloc_len);
+ ctx_pg = rte_malloc("bnxt_ctx_pg_mem",
+ sizeof(*ctx_pg) * BNXT_MAX_Q,
+ RTE_CACHE_LINE_SIZE);
+ if (!ctx_pg) {
+ rc = -ENOMEM;
+ goto ctx_err;
+ }
+ for (i = 0; i < BNXT_MAX_Q; i++, ctx_pg++)
+ ctx->tqm_mem[i] = ctx_pg;
- ctx_pg = rte_malloc("bnxt_ctx_pg_mem",
- sizeof(*ctx_pg) * BNXT_MAX_Q,
- RTE_CACHE_LINE_SIZE);
- if (!ctx_pg) {
- rc = -ENOMEM;
- goto ctx_err;
- }
- for (i = 0; i < BNXT_MAX_Q; i++, ctx_pg++)
- ctx->tqm_mem[i] = ctx_pg;
+ bp->ctx = ctx;
+ ctx->qp_max_entries = rte_le_to_cpu_32(resp->qp_max_entries);
+ ctx->qp_min_qp1_entries =
+ rte_le_to_cpu_16(resp->qp_min_qp1_entries);
+ ctx->qp_max_l2_entries =
+ rte_le_to_cpu_16(resp->qp_max_l2_entries);
+ ctx->qp_entry_size = rte_le_to_cpu_16(resp->qp_entry_size);
+ ctx->srq_max_l2_entries =
+ rte_le_to_cpu_16(resp->srq_max_l2_entries);
+ ctx->srq_max_entries = rte_le_to_cpu_32(resp->srq_max_entries);
+ ctx->srq_entry_size = rte_le_to_cpu_16(resp->srq_entry_size);
+ ctx->cq_max_l2_entries =
+ rte_le_to_cpu_16(resp->cq_max_l2_entries);
+ ctx->cq_max_entries = rte_le_to_cpu_32(resp->cq_max_entries);
+ ctx->cq_entry_size = rte_le_to_cpu_16(resp->cq_entry_size);
+ ctx->vnic_max_vnic_entries =
+ rte_le_to_cpu_16(resp->vnic_max_vnic_entries);
+ ctx->vnic_max_ring_table_entries =
+ rte_le_to_cpu_16(resp->vnic_max_ring_table_entries);
+ ctx->vnic_entry_size = rte_le_to_cpu_16(resp->vnic_entry_size);
+ ctx->stat_max_entries =
+ rte_le_to_cpu_32(resp->stat_max_entries);
+ ctx->stat_entry_size = rte_le_to_cpu_16(resp->stat_entry_size);
+ ctx->tqm_entry_size = rte_le_to_cpu_16(resp->tqm_entry_size);
+ ctx->tqm_min_entries_per_ring =
+ rte_le_to_cpu_32(resp->tqm_min_entries_per_ring);
+ ctx->tqm_max_entries_per_ring =
+ rte_le_to_cpu_32(resp->tqm_max_entries_per_ring);
+ ctx->tqm_entries_multiple = resp->tqm_entries_multiple;
+ if (!ctx->tqm_entries_multiple)
+ ctx->tqm_entries_multiple = 1;
+ ctx->mrav_max_entries =
+ rte_le_to_cpu_32(resp->mrav_max_entries);
+ ctx->mrav_entry_size = rte_le_to_cpu_16(resp->mrav_entry_size);
+ ctx->tim_entry_size = rte_le_to_cpu_16(resp->tim_entry_size);
+ ctx->tim_max_entries = rte_le_to_cpu_32(resp->tim_max_entries);
- bp->ctx = ctx;
- ctx->qp_max_entries = rte_le_to_cpu_32(resp->qp_max_entries);
- ctx->qp_min_qp1_entries =
- rte_le_to_cpu_16(resp->qp_min_qp1_entries);
- ctx->qp_max_l2_entries =
- rte_le_to_cpu_16(resp->qp_max_l2_entries);
- ctx->qp_entry_size = rte_le_to_cpu_16(resp->qp_entry_size);
- ctx->srq_max_l2_entries =
- rte_le_to_cpu_16(resp->srq_max_l2_entries);
- ctx->srq_max_entries = rte_le_to_cpu_32(resp->srq_max_entries);
- ctx->srq_entry_size = rte_le_to_cpu_16(resp->srq_entry_size);
- ctx->cq_max_l2_entries =
- rte_le_to_cpu_16(resp->cq_max_l2_entries);
- ctx->cq_max_entries = rte_le_to_cpu_32(resp->cq_max_entries);
- ctx->cq_entry_size = rte_le_to_cpu_16(resp->cq_entry_size);
- ctx->vnic_max_vnic_entries =
- rte_le_to_cpu_16(resp->vnic_max_vnic_entries);
- ctx->vnic_max_ring_table_entries =
- rte_le_to_cpu_16(resp->vnic_max_ring_table_entries);
- ctx->vnic_entry_size = rte_le_to_cpu_16(resp->vnic_entry_size);
- ctx->stat_max_entries =
- rte_le_to_cpu_32(resp->stat_max_entries);
- ctx->stat_entry_size = rte_le_to_cpu_16(resp->stat_entry_size);
- ctx->tqm_entry_size = rte_le_to_cpu_16(resp->tqm_entry_size);
- ctx->tqm_min_entries_per_ring =
- rte_le_to_cpu_32(resp->tqm_min_entries_per_ring);
- ctx->tqm_max_entries_per_ring =
- rte_le_to_cpu_32(resp->tqm_max_entries_per_ring);
- ctx->tqm_entries_multiple = resp->tqm_entries_multiple;
- if (!ctx->tqm_entries_multiple)
- ctx->tqm_entries_multiple = 1;
- ctx->mrav_max_entries =
- rte_le_to_cpu_32(resp->mrav_max_entries);
- ctx->mrav_entry_size = rte_le_to_cpu_16(resp->mrav_entry_size);
- ctx->tim_entry_size = rte_le_to_cpu_16(resp->tim_entry_size);
- ctx->tim_max_entries = rte_le_to_cpu_32(resp->tim_max_entries);
- } else {
- rc = 0;
- }
ctx_err:
HWRM_UNLOCK();
--
2.21.0
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code
2019-10-01 13:03 ` [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code Kevin Traynor
@ 2019-10-02 1:28 ` Ajit Khaparde
2019-10-30 7:43 ` David Marchand
0 siblings, 1 reply; 50+ messages in thread
From: Ajit Khaparde @ 2019-10-02 1:28 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, Lance Richardson, dpdk stable
On Tue, Oct 1, 2019 at 6:04 AM Kevin Traynor <ktraynor@redhat.com> wrote:
> If rc contains a non-zero return code from bnxt_hwrm_send_message(),
> HWRM_CHECK_RESULT_SILENT() will return.
>
> Just after that code, there is an 'if (!rc) {...} else {...}'.
> Coverity is complaining that this if else statement is dead code as
> rc will always be 0 if that code is reached.
>
> 4309 rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),
> BNXT_USE_CHIMP_MB);
> cond_const: Condition rc, taking false branch.
> Now the value of rc is equal to 0.
> 4310 HWRM_CHECK_RESULT_SILENT();
> 4311
> const: At condition rc, the value of rc must be equal to 0.
> dead_error_condition: The condition !rc must be true.
> 4312 if (!rc) {
>
> [snip]
>
> 4373 } else {
> CID 343450 (#1 of 1): Logically dead code
> (DEADCODE)dead_error_line: Execution cannot
> reach this statement: rc = 0;.
> 4374 rc = 0;
> 4375 }
>
> Coverity issue: 343450
> Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
> Cc: lance.richardson@broadcom.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> drivers/net/bnxt/bnxt_hwrm.c | 118 +++++++++++++++++------------------
> 1 file changed, 56 insertions(+), 62 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
> index 9883fb506..5378e3e9c 100644
> --- a/drivers/net/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/bnxt/bnxt_hwrm.c
> @@ -4298,5 +4298,7 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt
> *bp)
> struct hwrm_func_backing_store_qcaps_output *resp =
> bp->hwrm_cmd_resp_addr;
> - int rc;
> + struct bnxt_ctx_pg_info *ctx_pg;
> + struct bnxt_ctx_mem_info *ctx;
> + int rc, total_alloc_len, i;
>
> if (!BNXT_CHIP_THOR(bp) ||
> @@ -4310,68 +4312,60 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt
> *bp)
> HWRM_CHECK_RESULT_SILENT();
>
> - if (!rc) {
> - struct bnxt_ctx_pg_info *ctx_pg;
> - struct bnxt_ctx_mem_info *ctx;
> - int total_alloc_len;
> - int i;
> + total_alloc_len = sizeof(*ctx);
> + ctx = rte_malloc("bnxt_ctx_mem", total_alloc_len,
> + RTE_CACHE_LINE_SIZE);
> + if (!ctx) {
> + rc = -ENOMEM;
> + goto ctx_err;
> + }
> + memset(ctx, 0, total_alloc_len);
>
> - total_alloc_len = sizeof(*ctx);
> - ctx = rte_malloc("bnxt_ctx_mem", total_alloc_len,
> - RTE_CACHE_LINE_SIZE);
> - if (!ctx) {
> - rc = -ENOMEM;
> - goto ctx_err;
> - }
> - memset(ctx, 0, total_alloc_len);
> + ctx_pg = rte_malloc("bnxt_ctx_pg_mem",
> + sizeof(*ctx_pg) * BNXT_MAX_Q,
> + RTE_CACHE_LINE_SIZE);
> + if (!ctx_pg) {
> + rc = -ENOMEM;
> + goto ctx_err;
> + }
> + for (i = 0; i < BNXT_MAX_Q; i++, ctx_pg++)
> + ctx->tqm_mem[i] = ctx_pg;
>
> - ctx_pg = rte_malloc("bnxt_ctx_pg_mem",
> - sizeof(*ctx_pg) * BNXT_MAX_Q,
> - RTE_CACHE_LINE_SIZE);
> - if (!ctx_pg) {
> - rc = -ENOMEM;
> - goto ctx_err;
> - }
> - for (i = 0; i < BNXT_MAX_Q; i++, ctx_pg++)
> - ctx->tqm_mem[i] = ctx_pg;
> + bp->ctx = ctx;
> + ctx->qp_max_entries = rte_le_to_cpu_32(resp->qp_max_entries);
> + ctx->qp_min_qp1_entries =
> + rte_le_to_cpu_16(resp->qp_min_qp1_entries);
> + ctx->qp_max_l2_entries =
> + rte_le_to_cpu_16(resp->qp_max_l2_entries);
> + ctx->qp_entry_size = rte_le_to_cpu_16(resp->qp_entry_size);
> + ctx->srq_max_l2_entries =
> + rte_le_to_cpu_16(resp->srq_max_l2_entries);
> + ctx->srq_max_entries = rte_le_to_cpu_32(resp->srq_max_entries);
> + ctx->srq_entry_size = rte_le_to_cpu_16(resp->srq_entry_size);
> + ctx->cq_max_l2_entries =
> + rte_le_to_cpu_16(resp->cq_max_l2_entries);
> + ctx->cq_max_entries = rte_le_to_cpu_32(resp->cq_max_entries);
> + ctx->cq_entry_size = rte_le_to_cpu_16(resp->cq_entry_size);
> + ctx->vnic_max_vnic_entries =
> + rte_le_to_cpu_16(resp->vnic_max_vnic_entries);
> + ctx->vnic_max_ring_table_entries =
> + rte_le_to_cpu_16(resp->vnic_max_ring_table_entries);
> + ctx->vnic_entry_size = rte_le_to_cpu_16(resp->vnic_entry_size);
> + ctx->stat_max_entries =
> + rte_le_to_cpu_32(resp->stat_max_entries);
> + ctx->stat_entry_size = rte_le_to_cpu_16(resp->stat_entry_size);
> + ctx->tqm_entry_size = rte_le_to_cpu_16(resp->tqm_entry_size);
> + ctx->tqm_min_entries_per_ring =
> + rte_le_to_cpu_32(resp->tqm_min_entries_per_ring);
> + ctx->tqm_max_entries_per_ring =
> + rte_le_to_cpu_32(resp->tqm_max_entries_per_ring);
> + ctx->tqm_entries_multiple = resp->tqm_entries_multiple;
> + if (!ctx->tqm_entries_multiple)
> + ctx->tqm_entries_multiple = 1;
> + ctx->mrav_max_entries =
> + rte_le_to_cpu_32(resp->mrav_max_entries);
> + ctx->mrav_entry_size = rte_le_to_cpu_16(resp->mrav_entry_size);
> + ctx->tim_entry_size = rte_le_to_cpu_16(resp->tim_entry_size);
> + ctx->tim_max_entries = rte_le_to_cpu_32(resp->tim_max_entries);
>
> - bp->ctx = ctx;
> - ctx->qp_max_entries =
> rte_le_to_cpu_32(resp->qp_max_entries);
> - ctx->qp_min_qp1_entries =
> - rte_le_to_cpu_16(resp->qp_min_qp1_entries);
> - ctx->qp_max_l2_entries =
> - rte_le_to_cpu_16(resp->qp_max_l2_entries);
> - ctx->qp_entry_size = rte_le_to_cpu_16(resp->qp_entry_size);
> - ctx->srq_max_l2_entries =
> - rte_le_to_cpu_16(resp->srq_max_l2_entries);
> - ctx->srq_max_entries =
> rte_le_to_cpu_32(resp->srq_max_entries);
> - ctx->srq_entry_size =
> rte_le_to_cpu_16(resp->srq_entry_size);
> - ctx->cq_max_l2_entries =
> - rte_le_to_cpu_16(resp->cq_max_l2_entries);
> - ctx->cq_max_entries =
> rte_le_to_cpu_32(resp->cq_max_entries);
> - ctx->cq_entry_size = rte_le_to_cpu_16(resp->cq_entry_size);
> - ctx->vnic_max_vnic_entries =
> - rte_le_to_cpu_16(resp->vnic_max_vnic_entries);
> - ctx->vnic_max_ring_table_entries =
> -
> rte_le_to_cpu_16(resp->vnic_max_ring_table_entries);
> - ctx->vnic_entry_size =
> rte_le_to_cpu_16(resp->vnic_entry_size);
> - ctx->stat_max_entries =
> - rte_le_to_cpu_32(resp->stat_max_entries);
> - ctx->stat_entry_size =
> rte_le_to_cpu_16(resp->stat_entry_size);
> - ctx->tqm_entry_size =
> rte_le_to_cpu_16(resp->tqm_entry_size);
> - ctx->tqm_min_entries_per_ring =
> - rte_le_to_cpu_32(resp->tqm_min_entries_per_ring);
> - ctx->tqm_max_entries_per_ring =
> - rte_le_to_cpu_32(resp->tqm_max_entries_per_ring);
> - ctx->tqm_entries_multiple = resp->tqm_entries_multiple;
> - if (!ctx->tqm_entries_multiple)
> - ctx->tqm_entries_multiple = 1;
> - ctx->mrav_max_entries =
> - rte_le_to_cpu_32(resp->mrav_max_entries);
> - ctx->mrav_entry_size =
> rte_le_to_cpu_16(resp->mrav_entry_size);
> - ctx->tim_entry_size =
> rte_le_to_cpu_16(resp->tim_entry_size);
> - ctx->tim_max_entries =
> rte_le_to_cpu_32(resp->tim_max_entries);
> - } else {
> - rc = 0;
> - }
> ctx_err:
> HWRM_UNLOCK();
> --
> 2.21.0
>
>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code
2019-10-02 1:28 ` Ajit Khaparde
@ 2019-10-30 7:43 ` David Marchand
2019-10-30 16:27 ` Ajit Khaparde
0 siblings, 1 reply; 50+ messages in thread
From: David Marchand @ 2019-10-30 7:43 UTC (permalink / raw)
To: Ajit Khaparde, Kevin Traynor; +Cc: dev, Lance Richardson, dpdk stable
Hello Ajit, Kevin,
On Wed, Oct 2, 2019 at 3:29 AM Ajit Khaparde <ajit.khaparde@broadcom.com> wrote:
>
> On Tue, Oct 1, 2019 at 6:04 AM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> > If rc contains a non-zero return code from bnxt_hwrm_send_message(),
> > HWRM_CHECK_RESULT_SILENT() will return.
> >
> > Just after that code, there is an 'if (!rc) {...} else {...}'.
> > Coverity is complaining that this if else statement is dead code as
> > rc will always be 0 if that code is reached.
> >
> > 4309 rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),
> > BNXT_USE_CHIMP_MB);
> > cond_const: Condition rc, taking false branch.
> > Now the value of rc is equal to 0.
> > 4310 HWRM_CHECK_RESULT_SILENT();
> > 4311
> > const: At condition rc, the value of rc must be equal to 0.
> > dead_error_condition: The condition !rc must be true.
> > 4312 if (!rc) {
> >
> > [snip]
> >
> > 4373 } else {
> > CID 343450 (#1 of 1): Logically dead code
> > (DEADCODE)dead_error_line: Execution cannot
> > reach this statement: rc = 0;.
> > 4374 rc = 0;
> > 4375 }
> >
> > Coverity issue: 343450
> > Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
> > Cc: lance.richardson@broadcom.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> >
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
I can see a *really* close patch has been submitted the day after.
http://patchwork.dpdk.org/patch/58352/
And merged after a v3:
https://git.dpdk.org/dpdk/commit/?id=b4f74051165560aa81814433dea7e6eb0bdb32b9
So I suppose this patch can be dropped.
--
David Marchand
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code
2019-10-30 7:43 ` David Marchand
@ 2019-10-30 16:27 ` Ajit Khaparde
2019-11-05 15:39 ` Kevin Traynor
0 siblings, 1 reply; 50+ messages in thread
From: Ajit Khaparde @ 2019-10-30 16:27 UTC (permalink / raw)
To: David Marchand; +Cc: Kevin Traynor, dev, Lance Richardson, dpdk stable
On Wed, Oct 30, 2019 at 12:43 AM David Marchand <david.marchand@redhat.com>
wrote:
> Hello Ajit, Kevin,
>
> On Wed, Oct 2, 2019 at 3:29 AM Ajit Khaparde <ajit.khaparde@broadcom.com>
> wrote:
> >
> > On Tue, Oct 1, 2019 at 6:04 AM Kevin Traynor <ktraynor@redhat.com>
> wrote:
> >
> > > If rc contains a non-zero return code from bnxt_hwrm_send_message(),
> > > HWRM_CHECK_RESULT_SILENT() will return.
> > >
> > > Just after that code, there is an 'if (!rc) {...} else {...}'.
> > > Coverity is complaining that this if else statement is dead code as
> > > rc will always be 0 if that code is reached.
> > >
> > > 4309 rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),
> > > BNXT_USE_CHIMP_MB);
> > > cond_const: Condition rc, taking false branch.
> > > Now the value of rc is equal to 0.
> > > 4310 HWRM_CHECK_RESULT_SILENT();
> > > 4311
> > > const: At condition rc, the value of rc must be equal to 0.
> > > dead_error_condition: The condition !rc must be true.
> > > 4312 if (!rc) {
> > >
> > > [snip]
> > >
> > > 4373 } else {
> > > CID 343450 (#1 of 1): Logically dead code
> > > (DEADCODE)dead_error_line: Execution cannot
> > > reach this statement: rc = 0;.
> > > 4374 rc = 0;
> > > 4375 }
> > >
> > > Coverity issue: 343450
> > > Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
> > > Cc: lance.richardson@broadcom.com
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> > >
> > Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
> I can see a *really* close patch has been submitted the day after.
> http://patchwork.dpdk.org/patch/58352/
>
> And merged after a v3:
>
> https://git.dpdk.org/dpdk/commit/?id=b4f74051165560aa81814433dea7e6eb0bdb32b9
>
> So I suppose this patch can be dropped.
>
> Yes. That makes sense.
Thanks for checking.
Thanks
Ajit
>
> --
> David Marchand
>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code
2019-10-30 16:27 ` Ajit Khaparde
@ 2019-11-05 15:39 ` Kevin Traynor
0 siblings, 0 replies; 50+ messages in thread
From: Kevin Traynor @ 2019-11-05 15:39 UTC (permalink / raw)
To: Ajit Khaparde, David Marchand; +Cc: dev, Lance Richardson, dpdk stable
On 30/10/2019 16:27, Ajit Khaparde wrote:
> On Wed, Oct 30, 2019 at 12:43 AM David Marchand <david.marchand@redhat.com>
> wrote:
>
>> Hello Ajit, Kevin,
>>
>> On Wed, Oct 2, 2019 at 3:29 AM Ajit Khaparde <ajit.khaparde@broadcom.com>
>> wrote:
>>>
>>> On Tue, Oct 1, 2019 at 6:04 AM Kevin Traynor <ktraynor@redhat.com>
>> wrote:
>>>
>>>> If rc contains a non-zero return code from bnxt_hwrm_send_message(),
>>>> HWRM_CHECK_RESULT_SILENT() will return.
>>>>
>>>> Just after that code, there is an 'if (!rc) {...} else {...}'.
>>>> Coverity is complaining that this if else statement is dead code as
>>>> rc will always be 0 if that code is reached.
>>>>
>>>> 4309 rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),
>>>> BNXT_USE_CHIMP_MB);
>>>> cond_const: Condition rc, taking false branch.
>>>> Now the value of rc is equal to 0.
>>>> 4310 HWRM_CHECK_RESULT_SILENT();
>>>> 4311
>>>> const: At condition rc, the value of rc must be equal to 0.
>>>> dead_error_condition: The condition !rc must be true.
>>>> 4312 if (!rc) {
>>>>
>>>> [snip]
>>>>
>>>> 4373 } else {
>>>> CID 343450 (#1 of 1): Logically dead code
>>>> (DEADCODE)dead_error_line: Execution cannot
>>>> reach this statement: rc = 0;.
>>>> 4374 rc = 0;
>>>> 4375 }
>>>>
>>>> Coverity issue: 343450
>>>> Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
>>>> Cc: lance.richardson@broadcom.com
>>>> Cc: stable@dpdk.org
>>>>
>>>> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>>>>
>>> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>>
>> I can see a *really* close patch has been submitted the day after.
>> http://patchwork.dpdk.org/patch/58352/
>>
>> And merged after a v3:
>>
>> https://git.dpdk.org/dpdk/commit/?id=b4f74051165560aa81814433dea7e6eb0bdb32b9
>>
>> So I suppose this patch can be dropped.
>>
>> Yes. That makes sense.
> Thanks for checking.
>
> Thanks
> Ajit
>
Thanks for catching it David.
>>
>> --
>> David Marchand
>>
>
^ permalink raw reply [flat|nested] 50+ messages in thread
* [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
2019-10-01 13:03 ` [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code Kevin Traynor
@ 2019-10-01 13:04 ` Kevin Traynor
2019-10-30 7:59 ` David Marchand
2019-11-08 14:52 ` Xu, Rosen
2019-10-01 13:04 ` [dpdk-dev] [PATCH 5/9] net/ipn3ke: remove useless if statement Kevin Traynor
` (5 subsequent siblings)
7 siblings, 2 replies; 50+ messages in thread
From: Kevin Traynor @ 2019-10-01 13:04 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, rosen.xu, stable
Coverity is complaining about identical code regardless of which branch
of the if else is taken. Functionally it means an error will always be
returned if this if else is hit. Remove the else branch.
CID 337928 (#1 of 1): Identical code for different branches
(IDENTICAL_BRANCHES)identical_branches: The same code is executed
regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
n->n_children != 0U is true, because the 'then' and 'else' branches
are identical. Should one of the branches be modified, or the entire
'if' statement replaced?
1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
1507 n->n_children != 0) {
1508 return -rte_tm_error_set(error,
1509 EINVAL,
1510 RTE_TM_ERROR_TYPE_UNSPECIFIED,
1511 NULL,
1512 rte_strerror(EINVAL));
else_branch: The else branch, identical to the then branch.
1513 } else {
1514 return -rte_tm_error_set(error,
1515 EINVAL,
1516 RTE_TM_ERROR_TYPE_UNSPECIFIED,
1517 NULL,
1518 rte_strerror(EINVAL));
1519 }
Coverity issue: 337928
Fixes: c820468ac99c ("net/ipn3ke: support TM")
Cc: rosen.xu@intel.com
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index adf02c157..a93145d59 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev,
NULL,
rte_strerror(EINVAL));
- } else {
- return -rte_tm_error_set(error,
- EINVAL,
- RTE_TM_ERROR_TYPE_UNSPECIFIED,
- NULL,
- rte_strerror(EINVAL));
}
}
--
2.21.0
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
2019-10-01 13:04 ` [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic Kevin Traynor
@ 2019-10-30 7:59 ` David Marchand
2019-11-05 15:41 ` Kevin Traynor
2019-11-08 14:35 ` Xu, Rosen
2019-11-08 14:52 ` Xu, Rosen
1 sibling, 2 replies; 50+ messages in thread
From: David Marchand @ 2019-10-30 7:59 UTC (permalink / raw)
To: Rosen Xu; +Cc: dev, Kevin Traynor, dpdk stable, Xiaolong Ye
Hello Rosen,
Review please.
On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> Coverity is complaining about identical code regardless of which branch
> of the if else is taken. Functionally it means an error will always be
> returned if this if else is hit. Remove the else branch.
>
> CID 337928 (#1 of 1): Identical code for different branches
> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> n->n_children != 0U is true, because the 'then' and 'else' branches
> are identical. Should one of the branches be modified, or the entire
> 'if' statement replaced?
> 1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> 1507 n->n_children != 0) {
> 1508 return -rte_tm_error_set(error,
> 1509 EINVAL,
> 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> 1511 NULL,
> 1512 rte_strerror(EINVAL));
> else_branch: The else branch, identical to the then branch.
> 1513 } else {
> 1514 return -rte_tm_error_set(error,
> 1515 EINVAL,
> 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> 1517 NULL,
> 1518 rte_strerror(EINVAL));
> 1519 }
>
> Coverity issue: 337928
> Fixes: c820468ac99c ("net/ipn3ke: support TM")
> Cc: rosen.xu@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
> index adf02c157..a93145d59 100644
> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev,
> NULL,
> rte_strerror(EINVAL));
> - } else {
> - return -rte_tm_error_set(error,
> - EINVAL,
> - RTE_TM_ERROR_TYPE_UNSPECIFIED,
> - NULL,
> - rte_strerror(EINVAL));
> }
> }
> --
> 2.21.0
>
--
David Marchand
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
2019-10-30 7:59 ` David Marchand
@ 2019-11-05 15:41 ` Kevin Traynor
2019-11-08 14:45 ` Xu, Rosen
2019-11-08 14:35 ` Xu, Rosen
1 sibling, 1 reply; 50+ messages in thread
From: Kevin Traynor @ 2019-11-05 15:41 UTC (permalink / raw)
To: David Marchand, Rosen Xu; +Cc: dev, dpdk stable, Xiaolong Ye
On 30/10/2019 07:59, David Marchand wrote:
> Hello Rosen,
>
> Review please.
>
Ping Rosen.
> On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>>
>> Coverity is complaining about identical code regardless of which branch
>> of the if else is taken. Functionally it means an error will always be
>> returned if this if else is hit. Remove the else branch.
>>
>> CID 337928 (#1 of 1): Identical code for different branches
>> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
>> regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
>> n->n_children != 0U is true, because the 'then' and 'else' branches
>> are identical. Should one of the branches be modified, or the entire
>> 'if' statement replaced?
>> 1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
>> 1507 n->n_children != 0) {
>> 1508 return -rte_tm_error_set(error,
>> 1509 EINVAL,
>> 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED,
>> 1511 NULL,
>> 1512 rte_strerror(EINVAL));
>> else_branch: The else branch, identical to the then branch.
>> 1513 } else {
>> 1514 return -rte_tm_error_set(error,
>> 1515 EINVAL,
>> 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED,
>> 1517 NULL,
>> 1518 rte_strerror(EINVAL));
>> 1519 }
>>
>> Coverity issue: 337928
>> Fixes: c820468ac99c ("net/ipn3ke: support TM")
>> Cc: rosen.xu@intel.com
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>> ---
>> drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
>> 1 file changed, 6 deletions(-)
>>
>> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
>> index adf02c157..a93145d59 100644
>> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
>> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
>> @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev,
>> NULL,
>> rte_strerror(EINVAL));
>> - } else {
>> - return -rte_tm_error_set(error,
>> - EINVAL,
>> - RTE_TM_ERROR_TYPE_UNSPECIFIED,
>> - NULL,
>> - rte_strerror(EINVAL));
>> }
>> }
>> --
>> 2.21.0
>>
>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
2019-11-05 15:41 ` Kevin Traynor
@ 2019-11-08 14:45 ` Xu, Rosen
2019-11-08 14:47 ` Kevin Traynor
0 siblings, 1 reply; 50+ messages in thread
From: Xu, Rosen @ 2019-11-08 14:45 UTC (permalink / raw)
To: Kevin Traynor, David Marchand; +Cc: dev, dpdk stable, Ye, Xiaolong
Hi Kevin,
Too many things in these days, sorry for late reply.
> -----Original Message-----
> From: Kevin Traynor [mailto:ktraynor@redhat.com]
> Sent: Tuesday, November 05, 2019 23:42
> To: David Marchand <david.marchand@redhat.com>; Xu, Rosen
> <rosen.xu@intel.com>
> Cc: dev <dev@dpdk.org>; dpdk stable <stable@dpdk.org>; Ye, Xiaolong
> <xiaolong.ye@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check
> logic
>
> On 30/10/2019 07:59, David Marchand wrote:
> > Hello Rosen,
> >
> > Review please.
> >
>
> Ping Rosen.
>
> > On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com>
> wrote:
> >>
> >> Coverity is complaining about identical code regardless of which
> >> branch of the if else is taken. Functionally it means an error will
> >> always be returned if this if else is hit. Remove the else branch.
> >>
> >> CID 337928 (#1 of 1): Identical code for different branches
> >> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> >> regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> >> n->n_children != 0U is true, because the 'then' and 'else' branches
> >> are identical. Should one of the branches be modified, or the entire
> >> 'if' statement replaced?
Yes, you are right.
> >> 1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> >> 1507 n->n_children != 0) {
> >> 1508 return -rte_tm_error_set(error,
> >> 1509 EINVAL,
> >> 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> >> 1511 NULL,
> >> 1512 rte_strerror(EINVAL));
> >> else_branch: The else branch, identical to the then branch.
> >> 1513 } else {
> >> 1514 return -rte_tm_error_set(error,
> >> 1515 EINVAL,
> >> 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> >> 1517 NULL,
> >> 1518 rte_strerror(EINVAL));
> >> 1519 }
> >>
> >> Coverity issue: 337928
> >> Fixes: c820468ac99c ("net/ipn3ke: support TM")
> >> Cc: rosen.xu@intel.com
> >> Cc: stable@dpdk.org
> >>
> >> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> >> ---
> >> drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
> >> 1 file changed, 6 deletions(-)
> >>
> >> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c
> >> b/drivers/net/ipn3ke/ipn3ke_tm.c index adf02c157..a93145d59 100644
> >> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> >> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> >> @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct
> rte_eth_dev *dev,
> >> NULL,
> >> rte_strerror(EINVAL));
> >> - } else {
> >> - return -rte_tm_error_set(error,
> >> - EINVAL,
> >> - RTE_TM_ERROR_TYPE_UNSPECIFIED,
> >> - NULL,
> >> - rte_strerror(EINVAL));
> >> }
> >> }
> >> --
> >> 2.21.0
> >>
> >
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
2019-11-08 14:45 ` Xu, Rosen
@ 2019-11-08 14:47 ` Kevin Traynor
0 siblings, 0 replies; 50+ messages in thread
From: Kevin Traynor @ 2019-11-08 14:47 UTC (permalink / raw)
To: Xu, Rosen, David Marchand; +Cc: dev, dpdk stable, Ye, Xiaolong
On 08/11/2019 14:45, Xu, Rosen wrote:
> Hi Kevin,
>
> Too many things in these days, sorry for late reply.
>
Hi Rosen, no problem, thanks for the Ack.
Kevin.
>> -----Original Message-----
>> From: Kevin Traynor [mailto:ktraynor@redhat.com]
>> Sent: Tuesday, November 05, 2019 23:42
>> To: David Marchand <david.marchand@redhat.com>; Xu, Rosen
>> <rosen.xu@intel.com>
>> Cc: dev <dev@dpdk.org>; dpdk stable <stable@dpdk.org>; Ye, Xiaolong
>> <xiaolong.ye@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check
>> logic
>>
>> On 30/10/2019 07:59, David Marchand wrote:
>>> Hello Rosen,
>>>
>>> Review please.
>>>
>>
>> Ping Rosen.
>>
>>> On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com>
>> wrote:
>>>>
>>>> Coverity is complaining about identical code regardless of which
>>>> branch of the if else is taken. Functionally it means an error will
>>>> always be returned if this if else is hit. Remove the else branch.
>>>>
>>>> CID 337928 (#1 of 1): Identical code for different branches
>>>> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
>>>> regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
>>>> n->n_children != 0U is true, because the 'then' and 'else' branches
>>>> are identical. Should one of the branches be modified, or the entire
>>>> 'if' statement replaced?
>
> Yes, you are right.
>
>>>> 1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
>>>> 1507 n->n_children != 0) {
>>>> 1508 return -rte_tm_error_set(error,
>>>> 1509 EINVAL,
>>>> 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED,
>>>> 1511 NULL,
>>>> 1512 rte_strerror(EINVAL));
>>>> else_branch: The else branch, identical to the then branch.
>>>> 1513 } else {
>>>> 1514 return -rte_tm_error_set(error,
>>>> 1515 EINVAL,
>>>> 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED,
>>>> 1517 NULL,
>>>> 1518 rte_strerror(EINVAL));
>>>> 1519 }
>>>>
>>>> Coverity issue: 337928
>>>> Fixes: c820468ac99c ("net/ipn3ke: support TM")
>>>> Cc: rosen.xu@intel.com
>>>> Cc: stable@dpdk.org
>>>>
>>>> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>>>> ---
>>>> drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
>>>> 1 file changed, 6 deletions(-)
>>>>
>>>> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c
>>>> b/drivers/net/ipn3ke/ipn3ke_tm.c index adf02c157..a93145d59 100644
>>>> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
>>>> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
>>>> @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct
>> rte_eth_dev *dev,
>>>> NULL,
>>>> rte_strerror(EINVAL));
>>>> - } else {
>>>> - return -rte_tm_error_set(error,
>>>> - EINVAL,
>>>> - RTE_TM_ERROR_TYPE_UNSPECIFIED,
>>>> - NULL,
>>>> - rte_strerror(EINVAL));
>>>> }
>>>> }
>>>> --
>>>> 2.21.0
>>>>
>>>
>
> Reviewed-by: Rosen Xu <rosen.xu@intel.com>
>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
2019-10-30 7:59 ` David Marchand
2019-11-05 15:41 ` Kevin Traynor
@ 2019-11-08 14:35 ` Xu, Rosen
1 sibling, 0 replies; 50+ messages in thread
From: Xu, Rosen @ 2019-11-08 14:35 UTC (permalink / raw)
To: David Marchand; +Cc: dev, Kevin Traynor, dpdk stable, Ye, Xiaolong
Hi David,
Too many things in these days. I have reviewed it. Thanks a lot.
> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Wednesday, October 30, 2019 16:00
> To: Xu, Rosen <rosen.xu@intel.com>
> Cc: dev <dev@dpdk.org>; Kevin Traynor <ktraynor@redhat.com>; dpdk
> stable <stable@dpdk.org>; Ye, Xiaolong <xiaolong.ye@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check
> logic
>
> Hello Rosen,
>
> Review please.
>
> On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > Coverity is complaining about identical code regardless of which
> > branch of the if else is taken. Functionally it means an error will
> > always be returned if this if else is hit. Remove the else branch.
> >
> > CID 337928 (#1 of 1): Identical code for different branches
> > (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> > regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> > n->n_children != 0U is true, because the 'then' and 'else' branches
> > are identical. Should one of the branches be modified, or the entire
> > 'if' statement replaced?
> > 1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> > 1507 n->n_children != 0) {
> > 1508 return -rte_tm_error_set(error,
> > 1509 EINVAL,
> > 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> > 1511 NULL,
> > 1512 rte_strerror(EINVAL));
> > else_branch: The else branch, identical to the then branch.
> > 1513 } else {
> > 1514 return -rte_tm_error_set(error,
> > 1515 EINVAL,
> > 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> > 1517 NULL,
> > 1518 rte_strerror(EINVAL));
> > 1519 }
> >
> > Coverity issue: 337928
> > Fixes: c820468ac99c ("net/ipn3ke: support TM")
> > Cc: rosen.xu@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> > ---
> > drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
> > 1 file changed, 6 deletions(-)
> >
> > diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c
> > b/drivers/net/ipn3ke/ipn3ke_tm.c index adf02c157..a93145d59 100644
> > --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> > +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> > @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct
> rte_eth_dev *dev,
> > NULL,
> > rte_strerror(EINVAL));
> > - } else {
> > - return -rte_tm_error_set(error,
> > - EINVAL,
> > - RTE_TM_ERROR_TYPE_UNSPECIFIED,
> > - NULL,
> > - rte_strerror(EINVAL));
> > }
> > }
> > --
> > 2.21.0
> >
>
> --
> David Marchand
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
2019-10-01 13:04 ` [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic Kevin Traynor
2019-10-30 7:59 ` David Marchand
@ 2019-11-08 14:52 ` Xu, Rosen
1 sibling, 0 replies; 50+ messages in thread
From: Xu, Rosen @ 2019-11-08 14:52 UTC (permalink / raw)
To: Kevin Traynor, dev; +Cc: stable
Hi,
> -----Original Message-----
> From: Kevin Traynor [mailto:ktraynor@redhat.com]
> Sent: Tuesday, October 01, 2019 21:04
> To: dev@dpdk.org
> Cc: Kevin Traynor <ktraynor@redhat.com>; Xu, Rosen
> <rosen.xu@intel.com>; stable@dpdk.org
> Subject: [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
>
> Coverity is complaining about identical code regardless of which branch of
> the if else is taken. Functionally it means an error will always be returned if
> this if else is hit. Remove the else branch.
>
> CID 337928 (#1 of 1): Identical code for different branches
> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> n->n_children != 0U is true, because the 'then' and 'else' branches
> are identical. Should one of the branches be modified, or the entire
> 'if' statement replaced?
Okay
> 1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
> 1507 n->n_children != 0) {
> 1508 return -rte_tm_error_set(error,
> 1509 EINVAL,
> 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> 1511 NULL,
> 1512 rte_strerror(EINVAL));
> else_branch: The else branch, identical to the then branch.
> 1513 } else {
> 1514 return -rte_tm_error_set(error,
> 1515 EINVAL,
> 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED,
> 1517 NULL,
> 1518 rte_strerror(EINVAL));
> 1519 }
>
> Coverity issue: 337928
> Fixes: c820468ac99c ("net/ipn3ke: support TM")
> Cc: rosen.xu@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c
> b/drivers/net/ipn3ke/ipn3ke_tm.c index adf02c157..a93145d59 100644
> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct
> rte_eth_dev *dev,
> NULL,
> rte_strerror(EINVAL));
> - } else {
> - return -rte_tm_error_set(error,
> - EINVAL,
> -
> RTE_TM_ERROR_TYPE_UNSPECIFIED,
> - NULL,
> - rte_strerror(EINVAL));
> }
> }
> --
> 2.21.0
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* [dpdk-dev] [PATCH 5/9] net/ipn3ke: remove useless if statement
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
2019-10-01 13:03 ` [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code Kevin Traynor
2019-10-01 13:04 ` [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic Kevin Traynor
@ 2019-10-01 13:04 ` Kevin Traynor
2019-10-30 8:01 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-11-08 14:52 ` [dpdk-dev] " Xu, Rosen
2019-10-01 13:04 ` [dpdk-dev] [PATCH 6/9] net/ipn3ke: remove commented out code Kevin Traynor
` (4 subsequent siblings)
7 siblings, 2 replies; 50+ messages in thread
From: Kevin Traynor @ 2019-10-01 13:04 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, rosen.xu, stable
Coverity complains that this statement is not needed as the goto
label is on the next line anyway. Remove the if statement.
653 ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
CID 337930 (#1 of 1): Identical code for different branches
(IDENTICAL_BRANCHES)identical_branches: The same code is executed
when the condition ret is true or false, because the code in the
if-then branch and after the if statement is identical. Should
the if statement be removed?
654 if (ret)
655 goto end;
implicit_else: The code from the above if-then branch is identical
to the code after the if statement.
656end:
Coverity issue: 337930
Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
Cc: rosen.xu@intel.com
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/net/ipn3ke/ipn3ke_ethdev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c
index c226d6313..282295f49 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
@@ -652,6 +652,5 @@ ipn3ke_cfg_probe(struct rte_vdev_device *dev)
ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
- if (ret)
- goto end;
+
end:
if (kvlist)
--
2.21.0
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH 5/9] net/ipn3ke: remove useless if statement
2019-10-01 13:04 ` [dpdk-dev] [PATCH 5/9] net/ipn3ke: remove useless if statement Kevin Traynor
@ 2019-10-30 8:01 ` David Marchand
2019-11-08 14:35 ` Xu, Rosen
2019-11-08 14:52 ` [dpdk-dev] " Xu, Rosen
1 sibling, 1 reply; 50+ messages in thread
From: David Marchand @ 2019-10-30 8:01 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, Rosen Xu, dpdk stable
On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> Coverity complains that this statement is not needed as the goto
> label is on the next line anyway. Remove the if statement.
>
> 653 ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> CID 337930 (#1 of 1): Identical code for different branches
> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> when the condition ret is true or false, because the code in the
> if-then branch and after the if statement is identical. Should
> the if statement be removed?
> 654 if (ret)
> 655 goto end;
> implicit_else: The code from the above if-then branch is identical
> to the code after the if statement.
> 656end:
>
> Coverity issue: 337930
> Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
> Cc: rosen.xu@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/net/ipn3ke/ipn3ke_ethdev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> index c226d6313..282295f49 100644
> --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
> +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> @@ -652,6 +652,5 @@ ipn3ke_cfg_probe(struct rte_vdev_device *dev)
>
> ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> - if (ret)
> - goto end;
> +
> end:
> if (kvlist)
> --
> 2.21.0
>
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH 5/9] net/ipn3ke: remove useless if statement
2019-10-30 8:01 ` [dpdk-dev] [dpdk-stable] " David Marchand
@ 2019-11-08 14:35 ` Xu, Rosen
0 siblings, 0 replies; 50+ messages in thread
From: Xu, Rosen @ 2019-11-08 14:35 UTC (permalink / raw)
To: David Marchand, Kevin Traynor; +Cc: dev, dpdk stable
> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Wednesday, October 30, 2019 16:01
> To: Kevin Traynor <ktraynor@redhat.com>
> Cc: dev <dev@dpdk.org>; Xu, Rosen <rosen.xu@intel.com>; dpdk stable
> <stable@dpdk.org>
> Subject: Re: [dpdk-stable] [PATCH 5/9] net/ipn3ke: remove useless if
> statement
>
> On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > Coverity complains that this statement is not needed as the goto label
> > is on the next line anyway. Remove the if statement.
> >
> > 653 ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> > CID 337930 (#1 of 1): Identical code for different branches
> > (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> > when the condition ret is true or false, because the code in the
> > if-then branch and after the if statement is identical. Should
> > the if statement be removed?
> > 654 if (ret)
> > 655 goto end;
> > implicit_else: The code from the above if-then branch is identical
> > to the code after the if statement.
> > 656end:
> >
> > Coverity issue: 337930
> > Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
> > Cc: rosen.xu@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> > ---
> > drivers/net/ipn3ke/ipn3ke_ethdev.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c
> > b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> > index c226d6313..282295f49 100644
> > --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
> > +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> > @@ -652,6 +652,5 @@ ipn3ke_cfg_probe(struct rte_vdev_device *dev)
> >
> > ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> > - if (ret)
> > - goto end;
> > +
> > end:
> > if (kvlist)
> > --
> > 2.21.0
> >
>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
>
> --
> David Marchand
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 5/9] net/ipn3ke: remove useless if statement
2019-10-01 13:04 ` [dpdk-dev] [PATCH 5/9] net/ipn3ke: remove useless if statement Kevin Traynor
2019-10-30 8:01 ` [dpdk-dev] [dpdk-stable] " David Marchand
@ 2019-11-08 14:52 ` Xu, Rosen
1 sibling, 0 replies; 50+ messages in thread
From: Xu, Rosen @ 2019-11-08 14:52 UTC (permalink / raw)
To: Kevin Traynor, dev; +Cc: stable
Hi,
> -----Original Message-----
> From: Kevin Traynor [mailto:ktraynor@redhat.com]
> Sent: Tuesday, October 01, 2019 21:04
> To: dev@dpdk.org
> Cc: Kevin Traynor <ktraynor@redhat.com>; Xu, Rosen
> <rosen.xu@intel.com>; stable@dpdk.org
> Subject: [PATCH 5/9] net/ipn3ke: remove useless if statement
>
> Coverity complains that this statement is not needed as the goto label is on
> the next line anyway. Remove the if statement.
>
> 653 ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> CID 337930 (#1 of 1): Identical code for different branches
> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> when the condition ret is true or false, because the code in the
> if-then branch and after the if statement is identical. Should
> the if statement be removed?
> 654 if (ret)
> 655 goto end;
> implicit_else: The code from the above if-then branch is identical
> to the code after the if statement.
> 656end:
>
> Coverity issue: 337930
> Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
> Cc: rosen.xu@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/net/ipn3ke/ipn3ke_ethdev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c
> b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> index c226d6313..282295f49 100644
> --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
> +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> @@ -652,6 +652,5 @@ ipn3ke_cfg_probe(struct rte_vdev_device *dev)
>
> ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> - if (ret)
> - goto end;
> +
> end:
> if (kvlist)
> --
> 2.21.0
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* [dpdk-dev] [PATCH 6/9] net/ipn3ke: remove commented out code
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
` (2 preceding siblings ...)
2019-10-01 13:04 ` [dpdk-dev] [PATCH 5/9] net/ipn3ke: remove useless if statement Kevin Traynor
@ 2019-10-01 13:04 ` Kevin Traynor
2019-10-30 8:04 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-11-08 14:51 ` [dpdk-dev] " Xu, Rosen
2019-10-01 13:04 ` [dpdk-dev] [PATCH 7/9] compress/octeontx: " Kevin Traynor
` (3 subsequent siblings)
7 siblings, 2 replies; 50+ messages in thread
From: Kevin Traynor @ 2019-10-01 13:04 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, rosen.xu, stable
These struct members and variable were commented out. Remove them.
Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
Fixes: c820468ac99c ("net/ipn3ke: support TM")
Cc: rosen.xu@intel.com
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/net/ipn3ke/ipn3ke_ethdev.h | 7 -------
drivers/net/ipn3ke/ipn3ke_tm.c | 1 -
2 files changed, 8 deletions(-)
diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h b/drivers/net/ipn3ke/ipn3ke_ethdev.h
index c7b336bbd..0d71dcd64 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.h
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h
@@ -97,18 +97,11 @@ struct ipn3ke_tm_node {
struct ipn3ke_tm_hierarchy {
struct ipn3ke_tm_node *port_node;
- /*struct ipn3ke_tm_node_list vt_node_list;*/
- /*struct ipn3ke_tm_node_list cos_node_list;*/
-
uint32_t n_shaper_profiles;
- /*uint32_t n_shared_shapers;*/
uint32_t n_tdrop_profiles;
uint32_t n_vt_nodes;
uint32_t n_cos_nodes;
-
struct ipn3ke_tm_node *port_commit_node;
struct ipn3ke_tm_node_list vt_commit_node_list;
struct ipn3ke_tm_node_list cos_commit_node_list;
-
- /*uint32_t n_tm_nodes[IPN3KE_TM_NODE_LEVEL_MAX];*/
};
diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index a93145d59..5a16c5f96 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -1088,5 +1088,4 @@ ipn3ke_tm_node_add_check_mount(uint32_t tm_id,
struct rte_tm_error *error)
{
- /*struct ipn3ke_tm_internals *tm = IPN3KE_DEV_PRIVATE_TO_TM(dev);*/
uint32_t node_index;
uint32_t parent_index;
--
2.21.0
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH 6/9] net/ipn3ke: remove commented out code
2019-10-01 13:04 ` [dpdk-dev] [PATCH 6/9] net/ipn3ke: remove commented out code Kevin Traynor
@ 2019-10-30 8:04 ` David Marchand
2019-11-08 14:40 ` Xu, Rosen
2019-11-08 14:51 ` [dpdk-dev] " Xu, Rosen
1 sibling, 1 reply; 50+ messages in thread
From: David Marchand @ 2019-10-30 8:04 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, Rosen Xu, dpdk stable
On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> These struct members and variable were commented out. Remove them.
>
> Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
> Fixes: c820468ac99c ("net/ipn3ke: support TM")
> Cc: rosen.xu@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/net/ipn3ke/ipn3ke_ethdev.h | 7 -------
> drivers/net/ipn3ke/ipn3ke_tm.c | 1 -
> 2 files changed, 8 deletions(-)
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> index c7b336bbd..0d71dcd64 100644
> --- a/drivers/net/ipn3ke/ipn3ke_ethdev.h
> +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> @@ -97,18 +97,11 @@ struct ipn3ke_tm_node {
> struct ipn3ke_tm_hierarchy {
> struct ipn3ke_tm_node *port_node;
> - /*struct ipn3ke_tm_node_list vt_node_list;*/
> - /*struct ipn3ke_tm_node_list cos_node_list;*/
> -
> uint32_t n_shaper_profiles;
> - /*uint32_t n_shared_shapers;*/
> uint32_t n_tdrop_profiles;
> uint32_t n_vt_nodes;
> uint32_t n_cos_nodes;
> -
> struct ipn3ke_tm_node *port_commit_node;
> struct ipn3ke_tm_node_list vt_commit_node_list;
> struct ipn3ke_tm_node_list cos_commit_node_list;
> -
> - /*uint32_t n_tm_nodes[IPN3KE_TM_NODE_LEVEL_MAX];*/
> };
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
> index a93145d59..5a16c5f96 100644
> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> @@ -1088,5 +1088,4 @@ ipn3ke_tm_node_add_check_mount(uint32_t tm_id,
> struct rte_tm_error *error)
> {
> - /*struct ipn3ke_tm_internals *tm = IPN3KE_DEV_PRIVATE_TO_TM(dev);*/
> uint32_t node_index;
> uint32_t parent_index;
> --
> 2.21.0
>
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH 6/9] net/ipn3ke: remove commented out code
2019-10-30 8:04 ` [dpdk-dev] [dpdk-stable] " David Marchand
@ 2019-11-08 14:40 ` Xu, Rosen
0 siblings, 0 replies; 50+ messages in thread
From: Xu, Rosen @ 2019-11-08 14:40 UTC (permalink / raw)
To: David Marchand, Kevin Traynor; +Cc: dev, dpdk stable
Hi,
Too busy these days, sorry for late reply.
> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Wednesday, October 30, 2019 16:04
> To: Kevin Traynor <ktraynor@redhat.com>
> Cc: dev <dev@dpdk.org>; Xu, Rosen <rosen.xu@intel.com>; dpdk stable
> <stable@dpdk.org>
> Subject: Re: [dpdk-stable] [PATCH 6/9] net/ipn3ke: remove commented out
> code
>
> On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > These struct members and variable were commented out. Remove them.
> >
> > Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
> > Fixes: c820468ac99c ("net/ipn3ke: support TM")
> > Cc: rosen.xu@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> > ---
> > drivers/net/ipn3ke/ipn3ke_ethdev.h | 7 -------
> > drivers/net/ipn3ke/ipn3ke_tm.c | 1 -
> > 2 files changed, 8 deletions(-)
> >
> > diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h
> > b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> > index c7b336bbd..0d71dcd64 100644
> > --- a/drivers/net/ipn3ke/ipn3ke_ethdev.h
> > +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> > @@ -97,18 +97,11 @@ struct ipn3ke_tm_node { struct
> > ipn3ke_tm_hierarchy {
> > struct ipn3ke_tm_node *port_node;
> > - /*struct ipn3ke_tm_node_list vt_node_list;*/
> > - /*struct ipn3ke_tm_node_list cos_node_list;*/
> > -
> > uint32_t n_shaper_profiles;
> > - /*uint32_t n_shared_shapers;*/
> > uint32_t n_tdrop_profiles;
> > uint32_t n_vt_nodes;
> > uint32_t n_cos_nodes;
> > -
> > struct ipn3ke_tm_node *port_commit_node;
> > struct ipn3ke_tm_node_list vt_commit_node_list;
> > struct ipn3ke_tm_node_list cos_commit_node_list;
> > -
> > - /*uint32_t n_tm_nodes[IPN3KE_TM_NODE_LEVEL_MAX];*/
> > };
> >
> > diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c
> > b/drivers/net/ipn3ke/ipn3ke_tm.c index a93145d59..5a16c5f96 100644
> > --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> > +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> > @@ -1088,5 +1088,4 @@ ipn3ke_tm_node_add_check_mount(uint32_t
> tm_id,
> > struct rte_tm_error *error)
> > {
> > - /*struct ipn3ke_tm_internals *tm =
> IPN3KE_DEV_PRIVATE_TO_TM(dev);*/
> > uint32_t node_index;
> > uint32_t parent_index;
> > --
> > 2.21.0
> >
>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
>
>
> --
> David Marchand
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 6/9] net/ipn3ke: remove commented out code
2019-10-01 13:04 ` [dpdk-dev] [PATCH 6/9] net/ipn3ke: remove commented out code Kevin Traynor
2019-10-30 8:04 ` [dpdk-dev] [dpdk-stable] " David Marchand
@ 2019-11-08 14:51 ` Xu, Rosen
1 sibling, 0 replies; 50+ messages in thread
From: Xu, Rosen @ 2019-11-08 14:51 UTC (permalink / raw)
To: Kevin Traynor, dev; +Cc: stable
Hi,
> -----Original Message-----
> From: Kevin Traynor [mailto:ktraynor@redhat.com]
> Sent: Tuesday, October 01, 2019 21:04
> To: dev@dpdk.org
> Cc: Kevin Traynor <ktraynor@redhat.com>; Xu, Rosen
> <rosen.xu@intel.com>; stable@dpdk.org
> Subject: [PATCH 6/9] net/ipn3ke: remove commented out code
>
> These struct members and variable were commented out. Remove them.
>
> Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
> Fixes: c820468ac99c ("net/ipn3ke: support TM")
> Cc: rosen.xu@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/net/ipn3ke/ipn3ke_ethdev.h | 7 -------
> drivers/net/ipn3ke/ipn3ke_tm.c | 1 -
> 2 files changed, 8 deletions(-)
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h
> b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> index c7b336bbd..0d71dcd64 100644
> --- a/drivers/net/ipn3ke/ipn3ke_ethdev.h
> +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> @@ -97,18 +97,11 @@ struct ipn3ke_tm_node { struct ipn3ke_tm_hierarchy
> {
> struct ipn3ke_tm_node *port_node;
> - /*struct ipn3ke_tm_node_list vt_node_list;*/
> - /*struct ipn3ke_tm_node_list cos_node_list;*/
> -
> uint32_t n_shaper_profiles;
> - /*uint32_t n_shared_shapers;*/
> uint32_t n_tdrop_profiles;
> uint32_t n_vt_nodes;
> uint32_t n_cos_nodes;
> -
> struct ipn3ke_tm_node *port_commit_node;
> struct ipn3ke_tm_node_list vt_commit_node_list;
> struct ipn3ke_tm_node_list cos_commit_node_list;
> -
> - /*uint32_t n_tm_nodes[IPN3KE_TM_NODE_LEVEL_MAX];*/
> };
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c
> b/drivers/net/ipn3ke/ipn3ke_tm.c index a93145d59..5a16c5f96 100644
> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> @@ -1088,5 +1088,4 @@ ipn3ke_tm_node_add_check_mount(uint32_t
> tm_id,
> struct rte_tm_error *error)
> {
> - /*struct ipn3ke_tm_internals *tm =
> IPN3KE_DEV_PRIVATE_TO_TM(dev);*/
> uint32_t node_index;
> uint32_t parent_index;
> --
> 2.21.0
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* [dpdk-dev] [PATCH 7/9] compress/octeontx: remove commented out code
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
` (3 preceding siblings ...)
2019-10-01 13:04 ` [dpdk-dev] [PATCH 6/9] net/ipn3ke: remove commented out code Kevin Traynor
@ 2019-10-01 13:04 ` Kevin Traynor
2019-10-30 8:06 ` David Marchand
2019-10-01 13:04 ` [dpdk-dev] [PATCH 8/9] event/opdl: " Kevin Traynor
` (2 subsequent siblings)
7 siblings, 1 reply; 50+ messages in thread
From: Kevin Traynor @ 2019-10-01 13:04 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, ssahu, stable
This code is commented out. Remove it.
Fixes: 43e610bb8565 ("compress/octeontx: introduce octeontx zip PMD")
Cc: ssahu@marvell.com
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/compress/octeontx/include/zip_regs.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/compress/octeontx/include/zip_regs.h b/drivers/compress/octeontx/include/zip_regs.h
index 04c3d75e9..96e538bb7 100644
--- a/drivers/compress/octeontx/include/zip_regs.h
+++ b/drivers/compress/octeontx/include/zip_regs.h
@@ -37,5 +37,4 @@ typedef union {
#endif /* Word 0 - End */
} s;
- /* struct zip_vqx_ena_s cn; */
} zip_vqx_ena_t;
@@ -65,5 +64,4 @@ typedef union {
#endif /* Word 0 - End */
} s;
- /* struct zip_vqx_sbuf_addr_s cn; */
} zip_vqx_sbuf_addr_t;
@@ -85,5 +83,4 @@ typedef union {
#endif /* Word 0 - End */
} s;
- /* struct zip_quex_doorbell_s cn; */
} zip_quex_doorbell_t;
@@ -105,5 +102,4 @@ union zip_nptr_s {
#endif /* Word 0 - End */
} s;
- /* struct zip_nptr_s_s cn83xx; */
};
@@ -198,5 +194,4 @@ union zip_inst_s {
/** Beginning of file */
uint64_t bf : 1;
- // uint64_t reserved_3_4 : 2;
/** Comp/decomp operation */
uint64_t op : 2;
@@ -211,5 +206,4 @@ union zip_inst_s {
uint64_t dg : 1;
uint64_t ds : 1;
- //uint64_t reserved_3_4 : 2;
uint64_t op : 2;
uint64_t bf : 1;
@@ -616,6 +610,4 @@ union zip_zres_s {
#endif /* Word 7 - End */
} /** ZIP Result Structure */s;
-
- /* struct zip_zres_s_s cn83xx; */
};
--
2.21.0
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 7/9] compress/octeontx: remove commented out code
2019-10-01 13:04 ` [dpdk-dev] [PATCH 7/9] compress/octeontx: " Kevin Traynor
@ 2019-10-30 8:06 ` David Marchand
0 siblings, 0 replies; 50+ messages in thread
From: David Marchand @ 2019-10-30 8:06 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, ssahu, dpdk stable, Ashish Gupta
On Tue, Oct 1, 2019 at 3:05 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> This code is commented out. Remove it.
>
> Fixes: 43e610bb8565 ("compress/octeontx: introduce octeontx zip PMD")
> Cc: ssahu@marvell.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/compress/octeontx/include/zip_regs.h | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/drivers/compress/octeontx/include/zip_regs.h b/drivers/compress/octeontx/include/zip_regs.h
> index 04c3d75e9..96e538bb7 100644
> --- a/drivers/compress/octeontx/include/zip_regs.h
> +++ b/drivers/compress/octeontx/include/zip_regs.h
> @@ -37,5 +37,4 @@ typedef union {
> #endif /* Word 0 - End */
> } s;
> - /* struct zip_vqx_ena_s cn; */
> } zip_vqx_ena_t;
>
> @@ -65,5 +64,4 @@ typedef union {
> #endif /* Word 0 - End */
> } s;
> - /* struct zip_vqx_sbuf_addr_s cn; */
> } zip_vqx_sbuf_addr_t;
>
> @@ -85,5 +83,4 @@ typedef union {
> #endif /* Word 0 - End */
> } s;
> - /* struct zip_quex_doorbell_s cn; */
> } zip_quex_doorbell_t;
>
> @@ -105,5 +102,4 @@ union zip_nptr_s {
> #endif /* Word 0 - End */
> } s;
> - /* struct zip_nptr_s_s cn83xx; */
> };
>
> @@ -198,5 +194,4 @@ union zip_inst_s {
> /** Beginning of file */
> uint64_t bf : 1;
> - // uint64_t reserved_3_4 : 2;
> /** Comp/decomp operation */
> uint64_t op : 2;
> @@ -211,5 +206,4 @@ union zip_inst_s {
> uint64_t dg : 1;
> uint64_t ds : 1;
> - //uint64_t reserved_3_4 : 2;
> uint64_t op : 2;
> uint64_t bf : 1;
> @@ -616,6 +610,4 @@ union zip_zres_s {
> #endif /* Word 7 - End */
> } /** ZIP Result Structure */s;
> -
> - /* struct zip_zres_s_s cn83xx; */
> };
>
> --
> 2.21.0
>
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 50+ messages in thread
* [dpdk-dev] [PATCH 8/9] event/opdl: remove commented out code
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
` (4 preceding siblings ...)
2019-10-01 13:04 ` [dpdk-dev] [PATCH 7/9] compress/octeontx: " Kevin Traynor
@ 2019-10-01 13:04 ` Kevin Traynor
2019-10-03 10:50 ` Liang, Ma
2019-10-01 13:04 ` [dpdk-dev] [PATCH 9/9] net/bnxt: " Kevin Traynor
2019-10-30 7:56 ` [dpdk-dev] [dpdk-stable] [PATCH 2/9] crypto/octeontx: fix possible NULL deference David Marchand
7 siblings, 1 reply; 50+ messages in thread
From: Kevin Traynor @ 2019-10-01 13:04 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, liang.j.ma, stable
Some variables are commented out. Remove them.
Fixes: d548ef513cd7 ("event/opdl: add unit tests")
Cc: liang.j.ma@intel.com
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/event/opdl/opdl_test.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/event/opdl/opdl_test.c b/drivers/event/opdl/opdl_test.c
index 5868ec1be..e7a32fbd3 100644
--- a/drivers/event/opdl/opdl_test.c
+++ b/drivers/event/opdl/opdl_test.c
@@ -696,7 +696,4 @@ static int
single_link(struct test *t)
{
- /* const uint8_t rx_port = 0; */
- /* const uint8_t w1_port = 1; */
- /* const uint8_t w3_port = 3; */
const uint8_t tx_port = 2;
int err;
--
2.21.0
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 8/9] event/opdl: remove commented out code
2019-10-01 13:04 ` [dpdk-dev] [PATCH 8/9] event/opdl: " Kevin Traynor
@ 2019-10-03 10:50 ` Liang, Ma
0 siblings, 0 replies; 50+ messages in thread
From: Liang, Ma @ 2019-10-03 10:50 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, stable
On 01 Oct 14:04, Kevin Traynor wrote:
> Some variables are commented out. Remove them.
>
> Fixes: d548ef513cd7 ("event/opdl: add unit tests")
> Cc: liang.j.ma@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> drivers/event/opdl/opdl_test.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/event/opdl/opdl_test.c b/drivers/event/opdl/opdl_test.c
> index 5868ec1be..e7a32fbd3 100644
> --- a/drivers/event/opdl/opdl_test.c
> +++ b/drivers/event/opdl/opdl_test.c
> @@ -696,7 +696,4 @@ static int
> single_link(struct test *t)
> {
> - /* const uint8_t rx_port = 0; */
> - /* const uint8_t w1_port = 1; */
> - /* const uint8_t w3_port = 3; */
> const uint8_t tx_port = 2;
> int err;
> --
> 2.21.0
>
Acked-by: Liang Ma <liang.j.ma@intel.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* [dpdk-dev] [PATCH 9/9] net/bnxt: remove commented out code
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
` (5 preceding siblings ...)
2019-10-01 13:04 ` [dpdk-dev] [PATCH 8/9] event/opdl: " Kevin Traynor
@ 2019-10-01 13:04 ` Kevin Traynor
2019-10-01 15:42 ` Ajit Khaparde
2019-10-30 7:56 ` [dpdk-dev] [dpdk-stable] [PATCH 2/9] crypto/octeontx: fix possible NULL deference David Marchand
7 siblings, 1 reply; 50+ messages in thread
From: Kevin Traynor @ 2019-10-01 13:04 UTC (permalink / raw)
To: dev; +Cc: Kevin Traynor, ajit.khaparde, stable
This commented out todo and code is old. Remove it.
Fixes: b7435d660a8c ("net/bnxt: add ntuple filtering support")
Cc: ajit.khaparde@broadcom.com
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..318d49857 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2239,7 +2239,4 @@ parse_ntuple_filter(struct bnxt *bp,
}
- //TODO Priority
- //nfilter->priority = (uint8_t)filter->priority;
-
bfilter->enables = en;
return 0;
--
2.21.0
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [PATCH 9/9] net/bnxt: remove commented out code
2019-10-01 13:04 ` [dpdk-dev] [PATCH 9/9] net/bnxt: " Kevin Traynor
@ 2019-10-01 15:42 ` Ajit Khaparde
0 siblings, 0 replies; 50+ messages in thread
From: Ajit Khaparde @ 2019-10-01 15:42 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, dpdk stable
On Tue, Oct 1, 2019 at 6:04 AM Kevin Traynor <ktraynor@redhat.com> wrote:
> This commented out todo and code is old. Remove it.
>
> Fixes: b7435d660a8c ("net/bnxt: add ntuple filtering support")
> Cc: ajit.khaparde@broadcom.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
> drivers/net/bnxt/bnxt_ethdev.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> b/drivers/net/bnxt/bnxt_ethdev.c
> index 6685ee7d9..318d49857 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -2239,7 +2239,4 @@ parse_ntuple_filter(struct bnxt *bp,
> }
>
> - //TODO Priority
> - //nfilter->priority = (uint8_t)filter->priority;
> -
> bfilter->enables = en;
> return 0;
> --
> 2.21.0
>
>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH 2/9] crypto/octeontx: fix possible NULL deference
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
` (6 preceding siblings ...)
2019-10-01 13:04 ` [dpdk-dev] [PATCH 9/9] net/bnxt: " Kevin Traynor
@ 2019-10-30 7:56 ` David Marchand
7 siblings, 0 replies; 50+ messages in thread
From: David Marchand @ 2019-10-30 7:56 UTC (permalink / raw)
To: Kevin Traynor; +Cc: dev, Nithin Dabilpuram, dpdk stable, anoobj
On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> Coverity complains that ctrl_flags is set to NULL at the start
> of the function and it may not have been set before there is a
> jump to fc_success and it is dereferenced.
>
> Check for NULL before dereference.
>
> 312fc_success:
> CID 344983 (#1 of 1): Explicit null dereferenced
> (FORWARD_NULL)7. var_deref_op: Dereferencing null pointer ctrl_flags.
> 313 *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
>
> Coverity issue: 344983
> Fixes: 6cc54096520d ("crypto/octeontx: add supported sessions")
> Cc: ndabilpuram@marvell.com
> Cc: stable@dpdk.org
Cc: maintainer
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>
> ---
>
> There may be further rework needed to set it to the correct value,
> but for now at least prevent the NULL dereference.
> ---
> drivers/common/cpt/cpt_ucode.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h
> index 7d9c31e17..fad978c6e 100644
> --- a/drivers/common/cpt/cpt_ucode.h
> +++ b/drivers/common/cpt/cpt_ucode.h
> @@ -311,5 +311,6 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,
>
> fc_success:
> - *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
> + if (ctrl_flags != NULL)
> + *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
>
> success:
> --
> 2.21.0
>
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 50+ messages in thread