From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 04 Nov 2015 06:15:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,243,1444719600"; d="scan'208";a="842950924" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.62]) by fmsmga002.fm.intel.com with SMTP; 04 Nov 2015 06:15:44 -0800 Received: by (sSMTP sendmail emulation); Wed, 04 Nov 2015 14:15:43 +0025 Date: Wed, 4 Nov 2015 14:15:43 +0000 From: Bruce Richardson To: Stephen Hemminger 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 Content-Disposition: inline In-Reply-To: <20151103140029.27c876ef@xeon-e3> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3 4/4] ethdev: check driver support for functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2015 14:15:47 -0000 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