From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pm2Pq0YxfOtaC0f5u3rHJCbA4SoN6iVor6H8wkrxaxU=; b=EnvJis9jhPQAC3T8vYi7zrS/Y602gSATSqVMKBkXvTFo/ymKLWAG2jmNYZFTQV7+C2 7i1/5e0HPdu1tKYIdMRr1Md9pQ9AA+yZ7ZtOjNU5s/krA8756O3MMR6y0+McYOOFEqNG 2sWs4DAGrl91t85pV+znrg9PiKBaCm/R60zxBs9RQ2FKloTd1K2dVVTC/qDuO61TbQFk vV9IKX0WqiscWeK8X3P0IXkfOM0ONsUfvTqsj4NK+T8V5Oynjb2RZtaXRoPbWDiSDeP6 pblNnDT7kYF7U6AQG9PNF/kYoe4s92jDGJgaZukL2LbeZrCBnL0DdUwfNNmKGuNGCKha +7Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pm2Pq0YxfOtaC0f5u3rHJCbA4SoN6iVor6H8wkrxaxU=; b=dygb0tiwOAVeb5VUqEuNQN6JmnS/KYkWJOz7IRGUrRDti1pH/9JhoL5g9cGObhdK5R XV0MItx0f2rDTV3OczjHDqSmDtQRasSaVhvEFHV4+Bhd0Rcgnd2Y7tcbXQOGvvKrXkXq LpE/7AMXFqRnF9LYw+5nAvYVvjsldzaA0A0oQyKQANfmcHlnkOY+rabJBJJDkoPEDQb1 C6+1R7e/ewZXoAa8yWQwOkS4/5bb0z/7bxaLGG5nGEP/Z/2PWRwbXAUkmlYnWl82+HgW Q40LHM8MQaGF85lVGtmtaDPjiVpkEKBqHjFyCLThXuHxFYB9vPMu6Un3f4SCVDwuK4Sp WufQ== X-Gm-Message-State: AMke39lKtpnHC7MFmDnIHGrcaVA/XC7hM7pbrmqBhER/vFK7pR/que8asMYJA320ZKYFPw== X-Received: by 10.84.236.70 with SMTP id h6mr27298737pln.173.1488816921830; Mon, 06 Mar 2017 08:15:21 -0800 (PST) Received: from xeon-e3 (204-195-18-65.wavecable.com. [204.195.18.65]) by smtp.gmail.com with ESMTPSA id k184sm40825377pgc.23.2017.03.06.08.15.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Mar 2017 08:15:21 -0800 (PST) Date: Mon, 6 Mar 2017 08:15:13 -0800 From: Stephen Hemminger To: Cristian Dumitrescu Cc: dev@dpdk.org, thomas.monjalon@6wind.com, jerin.jacob@caviumnetworks.com, balasubramanian.manoharan@cavium.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Message-ID: <20170306081513.50e46da8@xeon-e3> In-Reply-To: <1488589820-206947-3-git-send-email-cristian.dumitrescu@intel.com> 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 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 16:15:22 -0000 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.