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 43FFBA04B3; Mon, 3 Feb 2020 06:14:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31E9D1BF76; Mon, 3 Feb 2020 06:14:10 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id EE9D01BE90; Mon, 3 Feb 2020 06:14:07 +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 0135AXip022930; Sun, 2 Feb 2020 21:14:07 -0800 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=lqraNLUzNgbTCqqDkMgtivwCy4kbG7TnLIfvfrxRqRU=; b=gbJF0LMkqxinTIbDZRw0vqLoId92o8UUjGdRUysI2LFD7clWxzoAdY8NTkduTr4cbWpa EFwzmmaT+9rDrkpb0IdG2ReAzbC2zpqfNrsULOP8eYLLIWTjd8bhlMEREckZkKLwyzwE UqhupsZqx7sRI8awENUCkWdufJVkLsfU43OlnTf1GGOV4QEwTAQbrwj6cf9AGv6CnQRj xB3V3550+lu+BdDb0wQ0ObBLOsxDlQ5EXJt5n/leXNYpC/npYINxeXwwHGz7b/yJJXG+ bbEE0diDcJPRfUnl+AXb+usAUVjBTAM/ngghwM/nSM8HtEwVyWyQjYTtuT0gcVRZdw1y Jw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2xw7jvdr26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 02 Feb 2020 21:14:06 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 2 Feb 2020 21:14:05 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 2 Feb 2020 21:14:05 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.107) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sun, 2 Feb 2020 21:14:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DPVkci4Q6XY/s4es/0IWpfdb8KOeg5rqV5L30JB6nNczINCC2be4gJ8LbRZzmKIHVtNx3kzIU/XQYRk0iHeZG0du4mD9PP5knniEciuwPUo7lcp0cWG95Qn3CH8aBuXKwkpCLMJVFLd4rwvZYpnsSZKjyi29fmZlZUicHPNhDxbDDWkUp6MVC0FUT1JgMylybasK65J+o4JentOHtwvNtTAyGX9kRRMLwNuTbxuh1/6r6uTymPN2PpDcWnrl8Nea0qd26M3YMkEK41mZTm/AP9BVpNUjcUKof4THdIsProMubBQSQbgE8AfvlYAijY/ebBvI8V9AY3PLKn42rZe9KA== 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=lqraNLUzNgbTCqqDkMgtivwCy4kbG7TnLIfvfrxRqRU=; b=ORVfNdObF7YHapNRgLQtvoBzwyxLwMOYyc3LCx7B9KlojOHsZoCdzNvx8JKJ3zNxRMQbCxKQ60NSIMdvRfsfwguxTKqfVxgjM+orMGJ/63kPN16y5Jnirz2FD4dm8ayeqs0EycmQDkXa0rEW/iqX4Az6H/P3lKuSS6AN7Q2pZT9Onum547kPHy+6Llmt9hViIpjxqNtoEpKEKNVNM4X2zNDdq74lsyS8QyDDjDgb28lMt9yL3lpKAT8bowvv/h9MqZj0F8wMHGkztJtcWpfUmRSMeQmwndfKG9ogNmijZs0GzRhHdLLTL4pxEkdLtxhd04Hag1i/5AbIdVH5hCq5kg== 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=lqraNLUzNgbTCqqDkMgtivwCy4kbG7TnLIfvfrxRqRU=; b=SQgthkcDnqhTl75KBLufpWMe5KJL7zZqYmQi5XsU3FeiUEmy1DRnBNjUZpQnRTDBJyGhM37OE7HLqP/xo2S/qs1qrXjg2srPajDfXiAZX2gi/SR34G9bKDCn+xWvGu9XH3MphOAjdRLL7UbpIR7n0bHpQzVNL4ApAXPu0jsD0Wo= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.160) by CY4PR1801MB1989.namprd18.prod.outlook.com (10.171.255.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.30; Mon, 3 Feb 2020 05:14:03 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::edb0:c18d:7455:f60b]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::edb0:c18d:7455:f60b%4]) with mapi id 15.20.2686.031; Mon, 3 Feb 2020 05:14:02 +0000 From: Pavan Nikhilesh Bhagavatula To: Sunil Kumar Kori , Marko Kovacevic , Ori Kam , Bruce Richardson , Radu Nicolau , "Akhil Goyal" , Tomasz Kantecki , Sunil Kumar Kori CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] examples/l2fwd-event: fix return value handling from API Thread-Index: AQHV10X8xcxhhBXwOUGNtgXdHhgx1qgI8sng Date: Mon, 3 Feb 2020 05:14:02 +0000 Message-ID: References: <20200130081912.18642-1-skori@marvell.com> In-Reply-To: <20200130081912.18642-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: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0e756827-61db-4a33-5bcc-08d7a867e25b x-ms-traffictypediagnostic: CY4PR1801MB1989: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-forefront-prvs: 0302D4F392 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(376002)(346002)(396003)(39850400004)(189003)(199004)(81166006)(4326008)(76116006)(66946007)(33656002)(81156014)(8676002)(71200400001)(6636002)(7696005)(478600001)(2906002)(66476007)(66446008)(64756008)(66556008)(9686003)(26005)(55016002)(55236004)(6506007)(5660300002)(52536014)(8936002)(86362001)(186003)(110136005)(316002)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1989; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: b9c917kqY+a/YfaNw0nUIM2sZcM81V8Q/eCmm88qFkEoVYqJRoihvzLIdf5gGl2EEwf4z7wLBEdoTR9f5mhESxDNvGceqZytjWsnh/+0xLWkEi3bTt88qp3qVv60DuyJphugyvfCIKcro8GlbjS4n/VQKfQzqC+3ix4n7SFyGUdE6bwrh4yM3bar0VE6PCvCGu3r6ifeZL6Pi7LlNpGSJbuktU6IS1D7nQy1xzNTTfpTaAjx+xg6zTtO6Xhph4GFGRY0OrLC5JJP4QKxGS+jMtzs2zG1U1qXVeQPIRdEiJfaaVjPtoWw3/AflX4OMaUKlvtypdqQ0JZ1ZWRbrgBohRhxkbIA+7qZpMTbIt4YLbMdHoQhNHRPCvzwDvNF6H3cBTgq/BEl3h4VRhV5jr/atMqPB9LsthN1qocGkXdK3YONjLJvDufhdZVleMOVmWx2 x-ms-exchange-antispam-messagedata: L9001szwxxnuIOEGFsFnnz3GvkZSQOrRCbMYq0SoFlkQ2aoknPame9P9Qyi9uo5znaPMq9zgTqVL9Mcy+8+E4XFInSmWAkUaUKbeM0OfQ7DRRCNPp3EENo0eW57DFLeKCeJsUJCL0IWfHmHSUIuvLw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0e756827-61db-4a33-5bcc-08d7a867e25b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2020 05:14:02.7451 (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: Nz7OA/9CLGV4MiMrl8DVzPzb+mhhxW5P1uiHYo4yNV9DrY3YVLD2VYjoJGISg7RWXy8LRB8GRdtg10LGri4iEjl/6HnK+DmYj6dhsCJZKRM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1989 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-02_09:2020-02-02, 2020-02-02 signatures=0 Subject: Re: [dpdk-dev] [PATCH] examples/l2fwd-event: fix return value handling from API 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/l2fwd-event: fix return value handling from >API > >Patch fixes coverity issues which handles return values from API >calling. > >Coverity issue: 350588 >Coverity issue: 350594 >Coverity issue: 350598 >Coverity issue: 350599 > >Fixes: 3b5476db4823 ("examples/l2fwd-event: setup event queue and >port") > >Signed-off-by: Sunil Kumar Kori Acked-by: Pavan Nikhilesh >--- > examples/l2fwd-event/l2fwd_event_generic.c | 9 +++++++-- > examples/l2fwd-event/l2fwd_event_internal_port.c | 10 ++++++++-- > 2 files changed, 15 insertions(+), 4 deletions(-) > >diff --git a/examples/l2fwd-event/l2fwd_event_generic.c >b/examples/l2fwd-event/l2fwd_event_generic.c >index b07306a17..2dc95e5f7 100644 >--- a/examples/l2fwd-event/l2fwd_event_generic.c >+++ b/examples/l2fwd-event/l2fwd_event_generic.c >@@ -112,7 +112,9 @@ l2fwd_event_port_setup_generic(struct >l2fwd_resources *rsrc) > 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 >@@ -173,7 +175,10 @@ l2fwd_event_queue_setup_generic(struct >l2fwd_resources *rsrc, > 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/l2fwd-event/l2fwd_event_internal_port.c >b/examples/l2fwd-event/l2fwd_event_internal_port.c >index 5e6e8598a..63d57b46c 100644 >--- a/examples/l2fwd-event/l2fwd_event_internal_port.c >+++ b/examples/l2fwd-event/l2fwd_event_internal_port.c >@@ -109,7 +109,10 @@ l2fwd_event_port_setup_internal_port(struct >l2fwd_resources *rsrc) > 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; >@@ -161,7 +164,10 @@ >l2fwd_event_queue_setup_internal_port(struct l2fwd_resources >*rsrc, > 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