From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v3 4/4] ethdev: check driver support for functions Date: Wed, 4 Nov 2015 14:15:43 +0000 Message-ID: <20151104141542.GB19636@bricha3-MOBL3> 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> <20151103140029.27c876ef@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EAD518DAA for ; Wed, 4 Nov 2015 15:15:46 +0100 (CET) Content-Disposition: inline In-Reply-To: <20151103140029.27c876ef@xeon-e3> 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, Nov 03, 2015 at 02:00:29PM -0800, Stephen Hemminger wrote: > 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. I would tend to agree. I'll add in the checks for the rx_queue_count and descriptor done calls, if there are no objections. /Bruce