From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AD3C2A04C1; Thu, 21 Nov 2019 20:22:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 149DB2BE2; Thu, 21 Nov 2019 20:22:50 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C3AD8237; Thu, 21 Nov 2019 20:22:47 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xALJKbmP019966; Thu, 21 Nov 2019 11:22:47 -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=pfpt0818; bh=rV+AZaONdAAdYJgIMmHixWVSC69wyKihsOzzJVnpiog=; b=lY2tD6LvGFcW1ZU3ezjDt9ZsBhzEmMdPXLeU27MoKjUIrWpPwspf8sQ14r+AD1Xw11zL UbuIQxDbUOusBjPTZa2yYzDTEC14MQnScFjsG3QbT3mseYq9FOw4asaGsnsA8xYEA41K 8K23WHAP8IsB9cWyJgFTut0jG25ooL3FYP1Xir0rQLFRne1BfaFTzYrkVFWZ4Z5fINEp yebxrSB+esAm3Vbgpof4XTq3xq8i37laWHkm9ovHkOqnGK4+ndnUOVb4C4lO2+eM0DGb pewNop7OJaq4CLqW4mXinUi8m9bY7G9RbPSx+YprD6YaifGjPer05Wxrqzbo7DAMo9lr Lg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2wc842fbhv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 21 Nov 2019 11:22:46 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 21 Nov 2019 11:22:45 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 21 Nov 2019 11:22:45 -0800 Received: from BG-LT7430.marvell.com (unknown [10.28.17.72]) by maili.marvell.com (Postfix) with ESMTP id 5E9703F703F; Thu, 21 Nov 2019 11:22:44 -0800 (PST) From: To: CC: , Pavan Nikhilesh , Date: Fri, 22 Nov 2019 00:52:39 +0530 Message-ID: <20191121192240.12326-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191121192240.12326-1-pbhagavatula@marvell.com> References: <20191121192240.12326-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-21_05:2019-11-21,2019-11-21 signatures=0 Subject: [dpdk-dev] [PATCH 2/2] app/test-evnetdev: fix unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Fix unchecked return values reported by coverity. Coverity Issue: 336861 Coverity Issue: 349906 Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_pipeline_common.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index 160461fb2..fa91bf229 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -196,7 +196,12 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) struct rte_eth_conf local_port_conf = port_conf; uint32_t caps = 0; - rte_event_eth_tx_adapter_caps_get(opt->dev_id, i, &caps); + ret = rte_event_eth_tx_adapter_caps_get(opt->dev_id, i, &caps); + if (ret != 0) { + evt_err("failed to get event tx adapter[%d] caps", i); + return ret; + } + if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) t->internal_port = 0; @@ -424,7 +429,7 @@ int pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt) { struct test_pipeline *t = evt_test_priv(test); - int i; + int i, ret; if (!opt->mbuf_sz) opt->mbuf_sz = RTE_MBUF_DEFAULT_BUF_SIZE; @@ -437,7 +442,13 @@ pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt) uint16_t data_size = 0; memset(&dev_info, 0, sizeof(dev_info)); - rte_eth_dev_info_get(i, &dev_info); + ret = rte_eth_dev_info_get(i, &dev_info); + if (ret != 0) { + evt_err("Error during getting device (port %u) info: %s\n", + i, strerror(-ret)); + return ret; + } + if (dev_info.rx_desc_lim.nb_mtu_seg_max != UINT16_MAX && dev_info.rx_desc_lim.nb_mtu_seg_max != 0) { data_size = opt->max_pkt_sz / -- 2.17.1