From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3 2/2] ethdev: add hierarchical scheduler API Date: Mon, 6 Mar 2017 08:15:13 -0800 Message-ID: <20170306081513.50e46da8@xeon-e3> References: <1488589820-206947-1-git-send-email-cristian.dumitrescu@intel.com> <1488589820-206947-3-git-send-email-cristian.dumitrescu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, thomas.monjalon@6wind.com, jerin.jacob@caviumnetworks.com, balasubramanian.manoharan@cavium.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com To: Cristian Dumitrescu Return-path: Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by dpdk.org (Postfix) with ESMTP id 81372567C for ; Mon, 6 Mar 2017 17:15:22 +0100 (CET) Received: by mail-pg0-f50.google.com with SMTP id 25so67921639pgy.0 for ; Mon, 06 Mar 2017 08:15:22 -0800 (PST) In-Reply-To: <1488589820-206947-3-git-send-email-cristian.dumitrescu@intel.com> 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 Sat, 4 Mar 2017 01:10:20 +0000 Cristian Dumitrescu wrote: > +/* 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 = &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 == NULL) || > + (dev->dev_ops->cap_ops_get(dev, RTE_ETH_CAPABILITY_TM, > + &ops) != 0) || (ops == NULL)) { > + rte_tm_error_set(error, > + ENOSYS, > + RTE_TM_ERROR_TYPE_UNSPECIFIED, > + NULL, > + rte_strerror(ENOSYS)); > + return NULL; > + } > + > + return ops; > +} Why are you introducing yet another version of errno? There already is rte_errno for RTE specific errors.