From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5C72F201 for ; Mon, 6 Mar 2017 19:18:03 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 06 Mar 2017 10:18:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,254,1484035200"; d="scan'208";a="232899114" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga004.fm.intel.com with ESMTP; 06 Mar 2017 10:17:58 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX152.ger.corp.intel.com ([169.254.6.125]) with mapi id 14.03.0248.002; Mon, 6 Mar 2017 18:17:58 +0000 From: "Dumitrescu, Cristian" To: Stephen Hemminger CC: "dev@dpdk.org" , "thomas.monjalon@6wind.com" , "jerin.jacob@caviumnetworks.com" , "balasubramanian.manoharan@cavium.com" , "hemant.agrawal@nxp.com" , "shreyansh.jain@nxp.com" Thread-Topic: [dpdk-dev] [PATCH v3 2/2] ethdev: add hierarchical scheduler API Thread-Index: AQHSlIRG9jGtjOuubkyYnO2qZkICcaGIAKKAgAAfOyA= Date: Mon, 6 Mar 2017 18:17:57 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891265275B1E3@IRSMSX108.ger.corp.intel.com> References: <1488589820-206947-1-git-send-email-cristian.dumitrescu@intel.com> <1488589820-206947-3-git-send-email-cristian.dumitrescu@intel.com> <20170306081513.50e46da8@xeon-e3> In-Reply-To: <20170306081513.50e46da8@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2M0NjA0ZGEtMDQ2YS00MmFhLTg4ODgtZTA1ZDMwOWMzYjk1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiJJQXFQblh0WUJNWnNQUnJBcnEyaTJabGpiRVwvXC92NUF4ZlJSejhkYzNYZW89In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 2/2] ethdev: add hierarchical scheduler 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: , X-List-Received-Date: Mon, 06 Mar 2017 18:18:03 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Monday, March 6, 2017 4:15 PM > To: Dumitrescu, Cristian > Cc: dev@dpdk.org; thomas.monjalon@6wind.com; > jerin.jacob@caviumnetworks.com; > balasubramanian.manoharan@cavium.com; hemant.agrawal@nxp.com; > shreyansh.jain@nxp.com > Subject: Re: [dpdk-dev] [PATCH v3 2/2] ethdev: add hierarchical scheduler > API >=20 > On Sat, 4 Mar 2017 01:10:20 +0000 > Cristian Dumitrescu wrote: >=20 > > +/* Get generic traffic manager operations structure from a port. */ > > +const struct rte_tm_ops * > > +rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) > > +{ > > + struct rte_eth_dev *dev =3D &rte_eth_devices[port_id]; > > + const struct rte_tm_ops *ops; > > + > > + if (!rte_eth_dev_is_valid_port(port_id)) { > > + rte_tm_error_set(error, > > + ENODEV, > > + RTE_TM_ERROR_TYPE_UNSPECIFIED, > > + NULL, > > + rte_strerror(ENODEV)); > > + return NULL; > > + } > > + > > + if ((dev->dev_ops->cap_ops_get =3D=3D NULL) || > > + (dev->dev_ops->cap_ops_get(dev, > RTE_ETH_CAPABILITY_TM, > > + &ops) !=3D 0) || (ops =3D=3D NULL)) { > > + rte_tm_error_set(error, > > + ENOSYS, > > + RTE_TM_ERROR_TYPE_UNSPECIFIED, > > + NULL, > > + rte_strerror(ENOSYS)); > > + return NULL; > > + } > > + > > + return ops; > > +} >=20 > Why are you introducing yet another version of errno? There already is > rte_errno for RTE specific errors. Have you looked at rte_flow? It is already doing this, and people asked me = to follow the same approach here for domain specific error codes. Look at Jerin's feedback on RFC here: http://www.dpdk.org/ml/archives/dev/2= 017-January/054484.html "IMO, We need an explicit error number to differentiate the configuration e= rror due do Ethernet port has been started. The recent rte_flow spec has own error codes to get more visibility on the = failure, so that application can choose better attributes for configuring." I agreed it is a good idea, as it gives you a precise indication on what ex= actly went wrong. A generic error code of EBUSY needs to be complemented by= a second level of library-specific error details. Note that we are also se= tting rte_errno.