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 47F4BA04AC; Fri, 1 May 2020 13:15:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 279BD1DA27; Fri, 1 May 2020 13:15:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C912E1DA26 for ; Fri, 1 May 2020 13:15:47 +0200 (CEST) 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 041BCtbO027474; Fri, 1 May 2020 04:15:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=s4UBUIVgkkyiMzzGC+xY/Fs6RdUJ8AmaHTpv9aZWqkk=; b=j2V5D35wY8RyZ+pHEz1ijnCW/6Mk8tO23vQq7WY9Yh9qqsC2/bqJphQtfWzMh2b/Ubzn zk38H5bW3Qh//8ELPaM8kNxRYcMjdSzPvaOF5nIcX5c9xitbsjKikszZSNXKbnglNbDW ygnbM47iTJgjg/pEpsWSZIkaLQ0Z+oX9dLRXJYwf4mLtGkUDG04cgGxoixDMm5vSVCSA peISm0CWaxHOGWNvdrl7DlmEBBC8+aoLSKE9qIETz9KVvIkdnOKGRF8i+BPXNyxwC0kN FhLHuJPqNzsG1pUbrEyIQKLGynhjjX2+pXPM8TFDZ9C0nGe6UOhzvfgOFsdovj4R23KG 0g== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 30r7em28sv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 01 May 2020 04:15:46 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 1 May 2020 04:15:45 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 1 May 2020 04:15:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MgIBUgI1+QJ8hEsxg1yvepsgFvGJ+8mqafO/GuTOhn1VRfwaNzOwqusd9FRnUCyr3hqiIxmFRNB9E9g17HyX6N5nNPf5Ug5RVsu6VQAmv074LyNxU4CFkr1AdFN053oyCQ3CqiufNCXjdSOkk8lQdBDUG95PqC1Zr4oBC+RIsdHSmVI7zVPnj7MvwOVOwv2eXXicgrRtgkLKhuy9mVpMljoR9MMuqGtgHsHzzhsQPbKrug8XdU9pKlkNJjkRCtPtgOujNUmuSfY5pz74FhulULzKn5Fr38RO3mtpJchwocS3373ti0VE+29zb4fGI3cxyOUj84jw90RWWEIAc+d9GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s4UBUIVgkkyiMzzGC+xY/Fs6RdUJ8AmaHTpv9aZWqkk=; b=a49/U57OODVILPDNFmTlbSRavif/ht/kjWQEg+hoWyFpq8ObSiPsaLq6n2nSVVBtu5IZuRnWm/CueqX1fRNKnH0rYw/jZFpP9HoXfZGZKbl048TaRB/44r6P1HRNXjhrR/gbwXeXCytcTwkPN5vNHuM8R+TJb2eu52ZgicYx6PA8741tbPNIDfgCCcGuAf04dAd3NMhkevypSkAQ/Ppt14YanQrKj81JcTR2qXKTDBBZAWpPFyW330bKSEfCD2Az54zS4d2A9CVcCLyaRKjmap5mP4daD26B7tXgJvIuWbk/Sfpql1nhHqM3YHYvs1Nx6VkYEXRQ1I3Re5RDZBpOEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s4UBUIVgkkyiMzzGC+xY/Fs6RdUJ8AmaHTpv9aZWqkk=; b=sHZA9bcRWwivC4/NyUndkMHMGWuQ6hlB1/KVPW8Lq+a80UEHw9cN2jLg/61PA3lRyujnQ89jfiG20EkMbQn02CMmF1LliB6S3Xd9Aufn5Yi3nMUeEFpjAW4Zfo7NdgT6AgeaKewS8bi7BHaKddhMUrGX5WKHFc7wbS5Q5PC9zCs= Received: from BYAPR18MB2518.namprd18.prod.outlook.com (2603:10b6:a03:13b::18) by BYAPR18MB2439.namprd18.prod.outlook.com (2603:10b6:a03:138::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Fri, 1 May 2020 11:15:43 +0000 Received: from BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289]) by BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289%3]) with mapi id 15.20.2937.028; Fri, 1 May 2020 11:15:43 +0000 From: Pavan Nikhilesh Bhagavatula To: Sunil Kumar Kori , Jerin Jacob Kollanukkaran , Marko Kovacevic , Ori Kam , Bruce Richardson , "Radu Nicolau" , Akhil Goyal , "Tomasz Kantecki" , Sunil Kumar Kori CC: "dev@dpdk.org" Thread-Topic: [PATCH] examples/l3fwd: fix error checking Thread-Index: AQHWFJHJfqsUi1QDaUSzYNM6U8HueqiTKl1A Date: Fri, 1 May 2020 11:15:43 +0000 Message-ID: References: <20200417082516.28803-1-skori@marvell.com> In-Reply-To: <20200417082516.28803-1-skori@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [223.226.86.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 77d94932-c8d5-4ec9-4ed6-08d7edc0fd6a x-ms-traffictypediagnostic: BYAPR18MB2439: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:411; x-forefront-prvs: 0390DB4BDA x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JA5zGn/Opcwy+rsHfhcxm8W6TfPL+y7VXtwLATLIOuRCPYawG566I13+Hpk8TLkU6jCpWlom1lDSQpFvfqDCQeatWadROesRXR1Dh4UIyWMD0pkzcfKx8837KrE4mBC2gBH4+KbnfbbGh8VVPvU8/lZiBizYFUcjBZlfAS8HdKPtAKAjF3bKID9MS9nbHlhfO6EcF2Yl/WRyoqicplvEP2vlYOgvUuUArbm85+WqyScoggL+WLgRwDxMCakIO5RDEg2WkX4PRAMtfGEX67OG15swyzp8XjunEwIMu+usUqNAGvg9j+CcO+1np+34S2Nl0F9PtrVuWphRi+aQovXdKYVvpNX4lkyeDkGr51464QVZqyH9dINHsOQIVd5a+JhXTmYYNjoR+Lumbx4ALxX/iRijzgbmcCIlpNHN2Afg7f2FO/tyPPg20SknNgkPDrLC x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2518.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39850400004)(396003)(366004)(136003)(346002)(376002)(33656002)(86362001)(8676002)(5660300002)(8936002)(55016002)(9686003)(110136005)(478600001)(4326008)(26005)(55236004)(186003)(7696005)(6506007)(2906002)(71200400001)(66476007)(66556008)(64756008)(66946007)(66446008)(6636002)(76116006)(316002)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 7GLQtAK740TGFCUV6M4TrkSndn5opKBUQznEM9RCtDIAYfGftrtd/A1j54hf282EWX9Et1Mg7Er3fL79CphYKGQEKnkjxye4cpifFYOb93KL7fKJiofGY7ycCRlPklwXyGrhkvDgzdHOVwRlaCEuzS5EUo95xBE0A+N7qPD47yv+nwHO8Dc1BCcTuPS9xybhdEzjbPuvY6PnhcTDX8krdM5qQfl+xfS8dhAg56mE5jQTLhXd+Do2bVLk8ON5iBY3ZoVMsxDxMPW5/MnoBM60IgA8uC5u3pIdh1EVTZ+sEGZqrY2brD4FE68ZIVt+dcPLlFCF+2beI3iZE//PWIvGiPABTB++bw5SKAGkUr6yxh8R9rVMZgwrKqm5/D2fmrJf3VT9+rI/UgJvliX4nD9V/sJk/kIZDFCAIdFJ3nILiQD0i/ZQUrWgOshUna1VOY25DH0ht+XDJqMfo+mhjuWvvo7TnRXgmzqp1Nmj+Ra0lOAZzM7h0BgUgLGef3XlrdPMHiqgaPh0fK67j338pKABNj7fz1WkIIQJ9JeCccK3z5c8/jCnjpL8D2qSgGdvxQY6lqDCeBfdMIsvjtUHlgkYZTWdQlnsVvqit7J00Q2frvK6J7ylWnvm6KIXUEvrwNXb1z13ua0rRLfxcnCuykaVuQ4PUhD+GT+uDZ/mGCrF8yG3jIlmRMyHKJO/JmsgGEizXzC2yVcJ03OEDkEvdqdNOUPhuUISEA30Knj+wfbfqZJgrj2llazw1O8enh3fH65CkHkLNNmnOr2Y+5A6bG0BTFOt2LasCM0qYiBS72NC1Rk= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 77d94932-c8d5-4ec9-4ed6-08d7edc0fd6a X-MS-Exchange-CrossTenant-originalarrivaltime: 01 May 2020 11:15:43.6471 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uksFlIjvC5+Dwec3pq7GaRIJESXuvRCvIEXkB36xNkdNwPWf4LpeOnX5WLZvsqeqWSIYCX3fjimThvcUNrLYQTCO6BAOLp/p9eR0yRpehEs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2439 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-01_04:2020-04-30, 2020-05-01 signatures=0 Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: fix error checking 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" >Subject: [PATCH] examples/l3fwd: fix error checking > >Patch fixes coverity issues which handle return values from AP >calling. > >Coverity issue: 354227, 354232, 354238, 354239, 354240 > >Fixes: aaf58cb85b62 ("examples/l3fwd: add event port and queue >setup") > >Signed-off-by: Sunil Kumar Kori Acked-by: Pavan Nikhilesh >--- > examples/l3fwd/l3fwd_event.c | 6 +++++- > examples/l3fwd/l3fwd_event_generic.c | 9 +++++++-- > examples/l3fwd/l3fwd_event_internal_port.c | 10 ++++++++-- > 3 files changed, 20 insertions(+), 5 deletions(-) > >diff --git a/examples/l3fwd/l3fwd_event.c >b/examples/l3fwd/l3fwd_event.c >index 43c47eade..4d31593a0 100644 >--- a/examples/l3fwd/l3fwd_event.c >+++ b/examples/l3fwd/l3fwd_event.c >@@ -70,7 +70,11 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf >*port_conf) > printf("Creating queues: nb_rxq=3D%d nb_txq=3D1...\n", > evt_rsrc->eth_rx_queues); > >- rte_eth_dev_info_get(port_id, &dev_info); >+ ret =3D rte_eth_dev_info_get(port_id, &dev_info); >+ if (ret !=3D 0) >+ rte_panic("Error during getting device (port %u) >info:" >+ "%s\n", port_id, strerror(-ret)); >+ > if (dev_info.tx_offload_capa & >DEV_TX_OFFLOAD_MBUF_FAST_FREE) > local_port_conf.txmode.offloads |=3D > > DEV_TX_OFFLOAD_MBUF_FAST_FREE; >diff --git a/examples/l3fwd/l3fwd_event_generic.c >b/examples/l3fwd/l3fwd_event_generic.c >index c69c611dd..f8c98435d 100644 >--- a/examples/l3fwd/l3fwd_event_generic.c >+++ b/examples/l3fwd/l3fwd_event_generic.c >@@ -101,7 +101,9 @@ l3fwd_event_port_setup_generic(void) > rte_panic("No space is available\n"); > > memset(&def_p_conf, 0, sizeof(struct rte_event_port_conf)); >- rte_event_port_default_conf_get(event_d_id, 0, >&def_p_conf); >+ ret =3D rte_event_port_default_conf_get(event_d_id, 0, >&def_p_conf); >+ if (ret < 0) >+ rte_panic("Error to get default configuration of event >port\n"); > > if (def_p_conf.new_event_threshold < >event_p_conf.new_event_threshold) > event_p_conf.new_event_threshold =3D >@@ -161,7 +163,10 @@ l3fwd_event_queue_setup_generic(uint32_t >event_queue_cfg) > if (!evt_rsrc->evq.event_q_id) > rte_panic("Memory allocation failure\n"); > >- rte_event_queue_default_conf_get(event_d_id, 0, >&def_q_conf); >+ ret =3D rte_event_queue_default_conf_get(event_d_id, 0, >&def_q_conf); >+ if (ret < 0) >+ rte_panic("Error to get default config of event >queue\n"); >+ > if (def_q_conf.nb_atomic_flows < >event_q_conf.nb_atomic_flows) > event_q_conf.nb_atomic_flows =3D >def_q_conf.nb_atomic_flows; > >diff --git a/examples/l3fwd/l3fwd_event_internal_port.c >b/examples/l3fwd/l3fwd_event_internal_port.c >index 993e26f13..03ac581d6 100644 >--- a/examples/l3fwd/l3fwd_event_internal_port.c >+++ b/examples/l3fwd/l3fwd_event_internal_port.c >@@ -99,7 +99,10 @@ l3fwd_event_port_setup_internal_port(void) > if (!evt_rsrc->evp.event_p_id) > rte_panic("Failed to allocate memory for Event >Ports\n"); > >- rte_event_port_default_conf_get(event_d_id, 0, >&def_p_conf); >+ ret =3D rte_event_port_default_conf_get(event_d_id, 0, >&def_p_conf); >+ if (ret < 0) >+ rte_panic("Error to get default configuration of event >port\n"); >+ > if (def_p_conf.new_event_threshold < >event_p_conf.new_event_threshold) > event_p_conf.new_event_threshold =3D > > def_p_conf.new_event_threshold; >@@ -150,7 +153,10 @@ >l3fwd_event_queue_setup_internal_port(uint32_t event_queue_cfg) > uint8_t event_q_id =3D 0; > int32_t ret; > >- rte_event_queue_default_conf_get(event_d_id, event_q_id, >&def_q_conf); >+ ret =3D rte_event_queue_default_conf_get(event_d_id, >event_q_id, >+ &def_q_conf); >+ if (ret < 0) >+ rte_panic("Error to get default config of event >queue\n"); > > if (def_q_conf.nb_atomic_flows < >event_q_conf.nb_atomic_flows) > event_q_conf.nb_atomic_flows =3D >def_q_conf.nb_atomic_flows; >-- >2.17.1