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 86409A04B1; Fri, 1 May 2020 19:44:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D1C51DA37; Fri, 1 May 2020 19:44:09 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id C7D5E1BFDC for ; Fri, 1 May 2020 19:44:07 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id k18so5614593ion.0 for ; Fri, 01 May 2020 10:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u4XPc2HgyVagXtg+xIUEew2G6H24kH9hfF8LM3NX2ew=; b=aRPWM5nYwSqaQ9SjlU80MB6FxTsqGPL6v96pDw8jYMjey0C9/IfxlGzQKg6NHdYGvd /bzcwT2gvb2ZBhv+KL8OMZeLAmIWDQih+wGpE0iEBOFmfKPnRU80+nLliqAq6JYPNgG3 4qcfiqnVbQU2yvbVX/ly4xWyMDAJsSZN/EvJWa36FVXYvo5DeO9UYD45YVO0WCFW+dD3 AR791+YHNp/qTziYoAegA83arSSrOSy5uIxtTOhBgt2MmHHL/0cFaR7LlWDLqGtOIxJP 41HkkunaUpmHe9tqxPeDuhTr9xwoazyv6RgTOr62K/nj51aqF3399lHAxbuzUfqGWsmu TYfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u4XPc2HgyVagXtg+xIUEew2G6H24kH9hfF8LM3NX2ew=; b=U1GueneRHBMd/Z0J9MqxODB3p9+SL5oYmsgliFrMhZyItjxONkNsLwDpWTqJOYLcdN cd1VoyAXCO0Ivjmd9cNIlPODNnVQQQaJGhziKtKvn4CE5LonRs/A9b/0qVPeb1MxmPsW duqD3zWoNNPipLOSLEl2SHYqFLhWtWYJNkqm2OGdc/BjplMHRMFuYaT9Zk9pLre051Uq llDjcVGkYC0fXmbr5v4pS1Me5SOh6XqxFH22TlzokrEgT1X4GNtLatPVp+2A6vH5SUvo dakkBcJdpbQVpOZLxrjfOujPe4Emw8oQHHMsD24Up4ujywVNKvR4KnZw4anE4vJa3jox w1zA== X-Gm-Message-State: AGi0PubNXTZPZEegAJzF18lhxkH8wEpcfg86niCQumI2f4xRGWLEbfyp bhgdvgGaG3yNX3HGxz81Ay83EI35DAx6g//QTl8= X-Google-Smtp-Source: APiQypKegYdu/zL9gU2WaiigdQJVXRbmDCFS0xwwJPJfSNnu0vxV8UhLaAyNfsH6CcViLatnYXl4PGK0KtukfOrN5qI= X-Received: by 2002:a5d:8c89:: with SMTP id g9mr4834111ion.1.1588355046995; Fri, 01 May 2020 10:44:06 -0700 (PDT) MIME-Version: 1.0 References: <20200417082516.28803-1-skori@marvell.com> In-Reply-To: From: Jerin Jacob Date: Fri, 1 May 2020 23:13:51 +0530 Message-ID: To: Pavan Nikhilesh Bhagavatula Cc: Sunil Kumar Kori , Jerin Jacob Kollanukkaran , Marko Kovacevic , Ori Kam , Bruce Richardson , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" 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" On Fri, May 1, 2020 at 4:45 PM Pavan Nikhilesh Bhagavatula wrote: > > >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 Cc: stable@dpdk.org Applied to dpdk-next-eventdev/master. Thanks. > > >--- > > 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=%d nb_txq=1...\n", > > evt_rsrc->eth_rx_queues); > > > >- rte_eth_dev_info_get(port_id, &dev_info); > >+ ret = rte_eth_dev_info_get(port_id, &dev_info); > >+ if (ret != 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 |= > > > > 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 = 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 = > >@@ -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 = 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 = > >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 = 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 = > > > > 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 = 0; > > int32_t ret; > > > >- rte_event_queue_default_conf_get(event_d_id, event_q_id, > >&def_q_conf); > >+ ret = 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 = > >def_q_conf.nb_atomic_flows; > >-- > >2.17.1 >