From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 50873423AC; Wed, 11 Jan 2023 10:39:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3E4F42D26; Wed, 11 Jan 2023 10:39:34 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4525E40687 for ; Tue, 10 Jan 2023 17:36:23 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AECUON003867; Tue, 10 Jan 2023 08:36:22 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Ifbtq1BqTJBb6Dejyt4WuWu4UeD+nsskplsnnkUKsZQ=; b=J5IgVViTlc8UC+/8PBwQJhY8hpQZ9Sq/rh7U6Ic9QTKkE+kE5xjQTEnBdq/NXAAYetFT +rJfMxeUGdIjgsC1dJ78HNMp1NxP0UeJktIgXXmc2F/B0P88Ta/MNmFm0FZRlDY17cwM 81+0hoL+7NISzy7SPCvSQjt/WTLrZBgilfWqd/3yK7lO4wHqd/PwZlQBcJFvQg0j0zOp AoxnCyxo+BpOHBApxdKHA975RqwQDfydX6N64CS1DaZWapeQdCsPosLRv6V5cKrDPMkx OOc843Jw3CfSFsawBjhc8agjH8a1PLNFLMLsXnxRmwu573O25HuvlGtW4+miz2AXmSgb bQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3my94tv59x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 08:36:22 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 10 Jan 2023 08:36:20 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 10 Jan 2023 08:36:20 -0800 Received: from localhost.localdomain (unknown [10.28.34.23]) by maili.marvell.com (Postfix) with ESMTP id AC7EF3F7062; Tue, 10 Jan 2023 08:36:14 -0800 (PST) From: Mohammad Iqbal Ahmad To: , Vladimir Medvedkin , Konstantin Ananyev , Conor Walsh CC: , , , , , , , , , , , Mohammad Iqbal Ahmad Subject: [PATCH v1] examples/l3fwd: fix for coverity scan Date: Tue, 10 Jan 2023 20:26:13 +0530 Message-ID: <20230110163442.1157560-1-mahmad@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216073958.1645736-1-mahmad@marvell.com> References: <20221216073958.1645736-1-mahmad@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: OBkqZqMvYwu1s2mJSzYx8q7-LOaKRwTJ X-Proofpoint-GUID: OBkqZqMvYwu1s2mJSzYx8q7-LOaKRwTJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-10_06,2023-01-10_03,2022-06-22_01 X-Mailman-Approved-At: Wed, 11 Jan 2023 10:39:30 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch fixes (Logically dead code) coverity issue. This patch also fixes (Uninitialized scalar variable) coverity issue. Coverity issue: 381687 Coverity issue: 381686 Fixes: 6a094e328598 ("examples/l3fwd: implement FIB lookup method") Signed-off-by: Mohammad Iqbal Ahmad --- examples/l3fwd/l3fwd_fib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index edc0dd69b9..18398492ae 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -359,10 +359,10 @@ fib_event_loop(struct l3fwd_event_resources *evt_rsrc, nh = (uint16_t)hopsv4[ipv4_arr_assem++]; else nh = (uint16_t)hopsv6[ipv6_arr_assem++]; - if (nh != FIB_DEFAULT_HOP) - hops[i] = nh != FIB_DEFAULT_HOP ? - nh : - events[i].mbuf->port; + + hops[i] = nh != FIB_DEFAULT_HOP ? + nh : + events[i].mbuf->port; process_packet(events[i].mbuf, &hops[i]); events[i].mbuf->port = hops[i] != BAD_PORT ? hops[i] : -- 2.25.1