From: Cunming Liang Date: Wed, 12 Nov 2014 06:24:36 +0000 (+0800) Subject: ethdev: fix Rx/Tx return in debug mode X-Git-Tag: spdx-start~10162 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5e8ae7fc919321bd681b3c532ba08d277a34fcb7;p=dpdk.git ethdev: fix Rx/Tx return in debug mode 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 Acked-by: Konstantin Ananyev --- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 5e9d576e66..8c65d72aa7 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); }