From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3 4/4] ethdev: check driver support for functions Date: Tue, 3 Nov 2015 14:00:29 -0800 Message-ID: <20151103140029.27c876ef@xeon-e3> References: <1441811374-28984-1-git-send-email-bruce.richardson@intel.com> <1446552059-5446-1-git-send-email-bruce.richardson@intel.com> <1446552059-5446-5-git-send-email-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Bruce Richardson Return-path: Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by dpdk.org (Postfix) with ESMTP id 5B2F58E80 for ; Tue, 3 Nov 2015 23:00:18 +0100 (CET) Received: by padhx2 with SMTP id hx2so22170793pad.1 for ; Tue, 03 Nov 2015 14:00:17 -0800 (PST) In-Reply-To: <1446552059-5446-5-git-send-email-bruce.richardson@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 3 Nov 2015 12:00:59 +0000 Bruce Richardson wrote: > * @return > - * The number of used descriptors in the specific queue. > + * The number of used descriptors in the specific queue, or: > + * (-EINVAL) if *port_id* is invalid > + * (-ENOTSUP) if the device does not support this function > */ > -static inline uint32_t > +static inline int > rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > #ifdef RTE_LIBRTE_ETHDEV_DEBUG > - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0); > - RTE_ETH_FPTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, 0); > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); > #endif I think it should always check validity of portid/queueid the check is very brief.