Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/60337/?format=api
https://patches.dpdk.org/api/patches/60337/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191001130405.7076-2-ktraynor@redhat.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20191001130405.7076-2-ktraynor@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191001130405.7076-2-ktraynor@redhat.com", "date": "2019-10-01T13:03:59", "name": "[3/9] net/bnxt: remove logically dead code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "dd3b553718dd8ef16b9b796786361b818a2c0ff5", "submitter": { "id": 598, "url": "https://patches.dpdk.org/api/people/598/?format=api", "name": "Kevin Traynor", "email": "ktraynor@redhat.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191001130405.7076-2-ktraynor@redhat.com/mbox/", "series": [ { "id": 6650, "url": "https://patches.dpdk.org/api/series/6650/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6650", "date": "2019-10-01T12:53:06", "name": "Coverity fixes and other cleanups", "version": 1, "mbox": "https://patches.dpdk.org/series/6650/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/60337/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/60337/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 712A94C8D;\n\tTue, 1 Oct 2019 15:04:22 +0200 (CEST)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id E92B61B94A;\n\tTue, 1 Oct 2019 15:04:19 +0200 (CEST)", "from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 5155980F6D;\n\tTue, 1 Oct 2019 13:04:19 +0000 (UTC)", "from rh.redhat.com (unknown [10.36.118.72])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id CEEE55C1D4;\n\tTue, 1 Oct 2019 13:04:16 +0000 (UTC)" ], "From": "Kevin Traynor <ktraynor@redhat.com>", "To": "dev@dpdk.org", "Cc": "Kevin Traynor <ktraynor@redhat.com>, lance.richardson@broadcom.com,\n\tstable@dpdk.org", "Date": "Tue, 1 Oct 2019 14:03:59 +0100", "Message-Id": "<20191001130405.7076-2-ktraynor@redhat.com>", "In-Reply-To": "<20191001130405.7076-1-ktraynor@redhat.com>", "References": "<20191001125315.6191-1-ktraynor@redhat.com>\n\t<20191001130405.7076-1-ktraynor@redhat.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]); Tue, 01 Oct 2019 13:04:19 +0000 (UTC)", "Subject": "[dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "If rc contains a non-zero return code from bnxt_hwrm_send_message(),\nHWRM_CHECK_RESULT_SILENT() will return.\n\nJust after that code, there is an 'if (!rc) {...} else {...}'.\nCoverity is complaining that this if else statement is dead code as\nrc will always be 0 if that code is reached.\n\n4309 rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),\n BNXT_USE_CHIMP_MB);\n cond_const: Condition rc, taking false branch.\n Now the value of rc is equal to 0.\n4310 HWRM_CHECK_RESULT_SILENT();\n4311\n const: At condition rc, the value of rc must be equal to 0.\n dead_error_condition: The condition !rc must be true.\n4312 if (!rc) {\n\n[snip]\n\n4373 } else {\n CID 343450 (#1 of 1): Logically dead code\n (DEADCODE)dead_error_line: Execution cannot\n reach this statement: rc = 0;.\n4374 rc = 0;\n4375 }\n\nCoverity issue: 343450\nFixes: f8168ca0e690 (\"net/bnxt: support thor controller\")\nCc: lance.richardson@broadcom.com\nCc: stable@dpdk.org\n\nSigned-off-by: Kevin Traynor <ktraynor@redhat.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c | 118 +++++++++++++++++------------------\n 1 file changed, 56 insertions(+), 62 deletions(-)", "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 9883fb506..5378e3e9c 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -4298,5 +4298,7 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp)\n \tstruct hwrm_func_backing_store_qcaps_output *resp =\n \t\tbp->hwrm_cmd_resp_addr;\n-\tint rc;\n+\tstruct bnxt_ctx_pg_info *ctx_pg;\n+\tstruct bnxt_ctx_mem_info *ctx;\n+\tint rc, total_alloc_len, i;\n \n \tif (!BNXT_CHIP_THOR(bp) ||\n@@ -4310,68 +4312,60 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp)\n \tHWRM_CHECK_RESULT_SILENT();\n \n-\tif (!rc) {\n-\t\tstruct bnxt_ctx_pg_info *ctx_pg;\n-\t\tstruct bnxt_ctx_mem_info *ctx;\n-\t\tint total_alloc_len;\n-\t\tint i;\n+\ttotal_alloc_len = sizeof(*ctx);\n+\tctx = rte_malloc(\"bnxt_ctx_mem\", total_alloc_len,\n+\t\t\t RTE_CACHE_LINE_SIZE);\n+\tif (!ctx) {\n+\t\trc = -ENOMEM;\n+\t\tgoto ctx_err;\n+\t}\n+\tmemset(ctx, 0, total_alloc_len);\n \n-\t\ttotal_alloc_len = sizeof(*ctx);\n-\t\tctx = rte_malloc(\"bnxt_ctx_mem\", total_alloc_len,\n-\t\t\t\t RTE_CACHE_LINE_SIZE);\n-\t\tif (!ctx) {\n-\t\t\trc = -ENOMEM;\n-\t\t\tgoto ctx_err;\n-\t\t}\n-\t\tmemset(ctx, 0, total_alloc_len);\n+\tctx_pg = rte_malloc(\"bnxt_ctx_pg_mem\",\n+\t\t\t sizeof(*ctx_pg) * BNXT_MAX_Q,\n+\t\t\t RTE_CACHE_LINE_SIZE);\n+\tif (!ctx_pg) {\n+\t\trc = -ENOMEM;\n+\t\tgoto ctx_err;\n+\t}\n+\tfor (i = 0; i < BNXT_MAX_Q; i++, ctx_pg++)\n+\t\tctx->tqm_mem[i] = ctx_pg;\n \n-\t\tctx_pg = rte_malloc(\"bnxt_ctx_pg_mem\",\n-\t\t\t\t sizeof(*ctx_pg) * BNXT_MAX_Q,\n-\t\t\t\t RTE_CACHE_LINE_SIZE);\n-\t\tif (!ctx_pg) {\n-\t\t\trc = -ENOMEM;\n-\t\t\tgoto ctx_err;\n-\t\t}\n-\t\tfor (i = 0; i < BNXT_MAX_Q; i++, ctx_pg++)\n-\t\t\tctx->tqm_mem[i] = ctx_pg;\n+\tbp->ctx = ctx;\n+\tctx->qp_max_entries = rte_le_to_cpu_32(resp->qp_max_entries);\n+\tctx->qp_min_qp1_entries =\n+\t\trte_le_to_cpu_16(resp->qp_min_qp1_entries);\n+\tctx->qp_max_l2_entries =\n+\t\trte_le_to_cpu_16(resp->qp_max_l2_entries);\n+\tctx->qp_entry_size = rte_le_to_cpu_16(resp->qp_entry_size);\n+\tctx->srq_max_l2_entries =\n+\t\trte_le_to_cpu_16(resp->srq_max_l2_entries);\n+\tctx->srq_max_entries = rte_le_to_cpu_32(resp->srq_max_entries);\n+\tctx->srq_entry_size = rte_le_to_cpu_16(resp->srq_entry_size);\n+\tctx->cq_max_l2_entries =\n+\t\trte_le_to_cpu_16(resp->cq_max_l2_entries);\n+\tctx->cq_max_entries = rte_le_to_cpu_32(resp->cq_max_entries);\n+\tctx->cq_entry_size = rte_le_to_cpu_16(resp->cq_entry_size);\n+\tctx->vnic_max_vnic_entries =\n+\t\trte_le_to_cpu_16(resp->vnic_max_vnic_entries);\n+\tctx->vnic_max_ring_table_entries =\n+\t\trte_le_to_cpu_16(resp->vnic_max_ring_table_entries);\n+\tctx->vnic_entry_size = rte_le_to_cpu_16(resp->vnic_entry_size);\n+\tctx->stat_max_entries =\n+\t\trte_le_to_cpu_32(resp->stat_max_entries);\n+\tctx->stat_entry_size = rte_le_to_cpu_16(resp->stat_entry_size);\n+\tctx->tqm_entry_size = rte_le_to_cpu_16(resp->tqm_entry_size);\n+\tctx->tqm_min_entries_per_ring =\n+\t\trte_le_to_cpu_32(resp->tqm_min_entries_per_ring);\n+\tctx->tqm_max_entries_per_ring =\n+\t\trte_le_to_cpu_32(resp->tqm_max_entries_per_ring);\n+\tctx->tqm_entries_multiple = resp->tqm_entries_multiple;\n+\tif (!ctx->tqm_entries_multiple)\n+\t\tctx->tqm_entries_multiple = 1;\n+\tctx->mrav_max_entries =\n+\t\trte_le_to_cpu_32(resp->mrav_max_entries);\n+\tctx->mrav_entry_size = rte_le_to_cpu_16(resp->mrav_entry_size);\n+\tctx->tim_entry_size = rte_le_to_cpu_16(resp->tim_entry_size);\n+\tctx->tim_max_entries = rte_le_to_cpu_32(resp->tim_max_entries);\n \n-\t\tbp->ctx = ctx;\n-\t\tctx->qp_max_entries = rte_le_to_cpu_32(resp->qp_max_entries);\n-\t\tctx->qp_min_qp1_entries =\n-\t\t\trte_le_to_cpu_16(resp->qp_min_qp1_entries);\n-\t\tctx->qp_max_l2_entries =\n-\t\t\trte_le_to_cpu_16(resp->qp_max_l2_entries);\n-\t\tctx->qp_entry_size = rte_le_to_cpu_16(resp->qp_entry_size);\n-\t\tctx->srq_max_l2_entries =\n-\t\t\trte_le_to_cpu_16(resp->srq_max_l2_entries);\n-\t\tctx->srq_max_entries = rte_le_to_cpu_32(resp->srq_max_entries);\n-\t\tctx->srq_entry_size = rte_le_to_cpu_16(resp->srq_entry_size);\n-\t\tctx->cq_max_l2_entries =\n-\t\t\trte_le_to_cpu_16(resp->cq_max_l2_entries);\n-\t\tctx->cq_max_entries = rte_le_to_cpu_32(resp->cq_max_entries);\n-\t\tctx->cq_entry_size = rte_le_to_cpu_16(resp->cq_entry_size);\n-\t\tctx->vnic_max_vnic_entries =\n-\t\t\trte_le_to_cpu_16(resp->vnic_max_vnic_entries);\n-\t\tctx->vnic_max_ring_table_entries =\n-\t\t\trte_le_to_cpu_16(resp->vnic_max_ring_table_entries);\n-\t\tctx->vnic_entry_size = rte_le_to_cpu_16(resp->vnic_entry_size);\n-\t\tctx->stat_max_entries =\n-\t\t\trte_le_to_cpu_32(resp->stat_max_entries);\n-\t\tctx->stat_entry_size = rte_le_to_cpu_16(resp->stat_entry_size);\n-\t\tctx->tqm_entry_size = rte_le_to_cpu_16(resp->tqm_entry_size);\n-\t\tctx->tqm_min_entries_per_ring =\n-\t\t\trte_le_to_cpu_32(resp->tqm_min_entries_per_ring);\n-\t\tctx->tqm_max_entries_per_ring =\n-\t\t\trte_le_to_cpu_32(resp->tqm_max_entries_per_ring);\n-\t\tctx->tqm_entries_multiple = resp->tqm_entries_multiple;\n-\t\tif (!ctx->tqm_entries_multiple)\n-\t\t\tctx->tqm_entries_multiple = 1;\n-\t\tctx->mrav_max_entries =\n-\t\t\trte_le_to_cpu_32(resp->mrav_max_entries);\n-\t\tctx->mrav_entry_size = rte_le_to_cpu_16(resp->mrav_entry_size);\n-\t\tctx->tim_entry_size = rte_le_to_cpu_16(resp->tim_entry_size);\n-\t\tctx->tim_max_entries = rte_le_to_cpu_32(resp->tim_max_entries);\n-\t} else {\n-\t\trc = 0;\n-\t}\n ctx_err:\n \tHWRM_UNLOCK();\n", "prefixes": [ "3/9" ] }{ "id": 60337, "url": "