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 5034DA0531; Mon, 10 Feb 2020 06:04:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2B6BC1BE9C; Mon, 10 Feb 2020 06:04:49 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 234EE1BE94; Mon, 10 Feb 2020 06:04:46 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2020 21:04:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,424,1574150400"; d="scan'208";a="312639576" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 09 Feb 2020 21:04:45 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 9 Feb 2020 21:04:45 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 10 Feb 2020 13:04:43 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Mon, 10 Feb 2020 13:04:43 +0800 From: "Li, Xiaoyun" To: "Ye, Xiaolong" CC: "Kovacevic, Marko" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] examples/tep_term: fix return value check Thread-Index: AQHV379KEVGCqBkRJ0+cWKaLEYV/RKgTQP2AgACcpbA= Date: Mon, 10 Feb 2020 05:04:43 +0000 Message-ID: References: <20200210030757.11426-1-xiaoyun.li@intel.com> <20200210033637.GA79789@intel.com> In-Reply-To: <20200210033637.GA79789@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] examples/tep_term: fix return value check 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" Hi > -----Original Message----- > From: Ye, Xiaolong > Sent: Monday, February 10, 2020 11:37 > To: Li, Xiaoyun > Cc: Kovacevic, Marko ; dev@dpdk.org; > stable@dpdk.org > Subject: Re: [PATCH] examples/tep_term: fix return value check >=20 > On 02/10, Xiaoyun Li wrote: > >Added return value check for 'rte_eth_dev_info_get()'. > > > >Coverity issue: 349922 > >Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration") > >Cc: stable@dpdk.org > > > >Signed-off-by: Xiaoyun Li > >--- > > examples/tep_termination/vxlan_setup.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > >diff --git a/examples/tep_termination/vxlan_setup.c > b/examples/tep_termination/vxlan_setup.c > >index eca119a72..bd469f5f4 100644 > >--- a/examples/tep_termination/vxlan_setup.c > >+++ b/examples/tep_termination/vxlan_setup.c > >@@ -195,7 +195,9 @@ vxlan_port_init(uint16_t port, struct rte_mempool > *mbuf_pool) > > > > if (tso_segsz !=3D 0) { > > struct rte_eth_dev_info dev_info; > >- rte_eth_dev_info_get(port, &dev_info); > >+ retval =3D rte_eth_dev_info_get(port, &dev_info); > >+ if (retval !=3D 0) > >+ return -retval; >=20 > why return -retval not retval? The description of return value of rte_eth_dev_info_get() is like the follo= wing: @return * - (0) if successful. * - (-ENOTSUP) if support for dev_infos_get() does not exist for the dev= ice. * - (-ENODEV) if *port_id* invalid. So -retval is the real err code. But the check of this function (vxlan_port_init) is (overlay_options.port_c= onfigure(portid, mbuf_pool) !=3D 0) So return -retval or retval are both OK. >=20 > Thanks, > Xiaolong >=20 > > if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) > =3D=3D 0) > > RTE_LOG(WARNING, PORT, > > "hardware TSO offload is not supported\n"); > >-- > >2.17.1 > >