From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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-type:content-transfer-encoding; bh=i76GmY1HdFsa1fbOCGrDXi7sVtPU55V1uVjHyhG9pdo=; b=DNqvBgUNeSkerIbiJEWCqE/x9v6w/4rU0BpjFbObt9fvMpSjG7EkJPn65ZgYjD227W RSv7AbqrGtvln4b6Kh0NN03jjUmQ120Z0zsLbWO7yh7jjYFwNlkv4BoggaeweMOfG9TK nnXcdIoYGPGyQHffo187M7yclZMS018XZsdIdw5ubfzdyl8hbKFw/WaaZ2zDF0TfClQX fQe9YnKsdKYX9XEvevKPHK5ZkBSjpCkCXHbvjl2+/vqxvkpqW90+9050Mx0LZX6DV/MY Y1QuH5+GZfdaXS/2W3h1E6IOP+a9muUkcQVn4fmly1pet103+LS+WIDPriF7nHI2hLhE ZxXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=i76GmY1HdFsa1fbOCGrDXi7sVtPU55V1uVjHyhG9pdo=; b=aFhIc8VBgAi5HzrHIYfrQYc3wpEkeOLd02O7V2iAaMltCjZ3gFfo+XZw7OEkPXReqs dUsLuYWfUf/L88OXDhxHRC85Rh9NZZ/k6TlghWdf2y6h8hd/y1fT99Pn2ROj3XpraNuI tc3YcEiVdujWRLUQawXlh5p/3Kn7osPDcHOxbqVjLy3/RzWEdvGOJknyRpcFs+c+N6LA P88m3g5Gi+BA7El1DJxRVTvcVH1eE/mIa3uLcqp1cIjmf/WSt4hrObXLvkQ3QOa+iy5Z C8arCRN/dZIkA84vzGVkuMqfm8TeTkJn+l/UoE0W9bnfIgGsIg8lwPPKJaOjIE4yBX3h VHCw== X-Gm-Message-State: ALoCoQmNH+UYQoOeWPal63kn0lzpCKYDYAdMwW7CuG7g3x3z837KOTPx9/kE5t/a71xdCh/Ruuxc X-Received: by 10.68.139.65 with SMTP id qw1mr31654489pbb.34.1446588017651; Tue, 03 Nov 2015 14:00:17 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id oi3sm31269470pbb.53.2015.11.03.14.00.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 14:00:17 -0800 (PST) Date: Tue, 3 Nov 2015 14:00:29 -0800 From: Stephen Hemminger To: Bruce Richardson Message-ID: <20151103140029.27c876ef@xeon-e3> In-Reply-To: <1446552059-5446-5-git-send-email-bruce.richardson@intel.com> 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 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: Tue, 03 Nov 2015 22:00:18 -0000 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.