From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 592FC7F24 for ; Mon, 27 Oct 2014 16:54:54 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 27 Oct 2014 09:02:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,796,1406617200"; d="scan'208";a="596994881" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga001.jf.intel.com with ESMTP; 27 Oct 2014 09:03:33 -0700 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 27 Oct 2014 16:03:30 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.56]) by IRSMSX151.ger.corp.intel.com ([169.254.4.227]) with mapi id 14.03.0195.001; Mon, 27 Oct 2014 16:03:30 +0000 From: "Ananyev, Konstantin" To: "Liang, Cunming" , "dev@dpdk.org" Thread-Topic: [PATCH v6 3/3] ethdev: fix wrong error return refere to API definition Thread-Index: AQHP8YQ18lRXUQOpfki2BEUZyQehxpxEG79g Date: Mon, 27 Oct 2014 16:03:30 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258213A0A14@IRSMSX105.ger.corp.intel.com> References: <1414130282-17981-1-git-send-email-cunming.liang@intel.com> <1414372809-14044-1-git-send-email-cunming.liang@intel.com> <1414372809-14044-4-git-send-email-cunming.liang@intel.com> In-Reply-To: <1414372809-14044-4-git-send-email-cunming.liang@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v6 3/3] 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: , X-List-Received-Date: Mon, 27 Oct 2014 15:54:55 -0000 > From: Liang, Cunming > Sent: Monday, October 27, 2014 1:20 AM > To: dev@dpdk.org > Cc: nhorman@tuxdriver.com; Ananyev, Konstantin; Richardson, Bruce; De Lar= a Guarch, Pablo; Liang, Cunming > Subject: [PATCH v6 3/3] ethdev: fix wrong error return refere to API defi= nition >=20 > 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. >=20 > Signed-off-by: Cunming Liang > --- > lib/librte_ether/rte_ethdev.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index 50f10d9..922a0c6 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2530,7 +2530,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id= , > return 0; > } > dev =3D &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 >=3D dev->data->nb_rx_queues) { > PMD_DEBUG_TRACE("Invalid RX queue_id=3D%d\n", queue_id); > return 0; > @@ -2551,7 +2551,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id= , > } > dev =3D &rte_eth_devices[port_id]; >=20 > - FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, -ENOTSUP); > + FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0); > if (queue_id >=3D dev->data->nb_tx_queues) { > PMD_DEBUG_TRACE("Invalid TX queue_id=3D%d\n", queue_id); > return 0; > @@ -2570,7 +2570,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t qu= eue_id) > return 0; > } > dev =3D &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); > } >=20 > -- > 1.7.4.1 Acked-by: Konstantin Ananyev