From patchwork Wed Nov 12 06:24:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cunming Liang X-Patchwork-Id: 1259 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 0330E7F79; Wed, 12 Nov 2014 07:15:31 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B15A97FA4 for ; Wed, 12 Nov 2014 07:15:24 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 11 Nov 2014 22:22:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,367,1413270000"; d="scan'208";a="606393475" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 11 Nov 2014 22:25:15 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id sAC6PDH8020486; Wed, 12 Nov 2014 14:25:13 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id sAC6PBeW031233; Wed, 12 Nov 2014 14:25:13 +0800 Received: (from cliang18@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sAC6PBE4031229; Wed, 12 Nov 2014 14:25:11 +0800 From: Cunming Liang To: dev@dpdk.org Date: Wed, 12 Nov 2014 14:24:36 +0800 Message-Id: <1415773476-31004-8-git-send-email-cunming.liang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1415773476-31004-1-git-send-email-cunming.liang@intel.com> References: <1414372809-14044-1-git-send-email-cunming.liang@intel.com> <1415773476-31004-1-git-send-email-cunming.liang@intel.com> Subject: [dpdk-dev] [PATCH v7 7/7] ethdev: fix wrong error return refere to API definition 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Per definition, rte_eth_rx_burst/rte_eth_tx_burst/rte_eth_rx_queue_count returns the packet number When RTE_LIBRTE_ETHDEV_DEBUG turns on, retval of FUNC_PTR_OR_ERR_RTE was set to -ENOTSUP. It makes confusing. The patch always return 0 no matter no packet or there's error. Signed-off-by: Cunming Liang --- lib/librte_ether/rte_ethdev.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 5e9d576..8c65d72 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2586,7 +2586,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, return 0; } dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, -ENOTSUP); + FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0); if (queue_id >= dev->data->nb_rx_queues) { PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id); return 0; @@ -2607,7 +2607,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, } dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, -ENOTSUP); + FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0); if (queue_id >= dev->data->nb_tx_queues) { PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id); return 0; @@ -2626,7 +2626,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) return 0; } dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP); + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, 0); return (*dev->dev_ops->rx_queue_count)(dev, queue_id); }