From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CD6BA053B; Fri, 17 Jul 2020 15:49:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DC7F11C127; Fri, 17 Jul 2020 15:49:10 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4CB851C126 for ; Fri, 17 Jul 2020 15:49:09 +0200 (CEST) IronPort-SDR: M2pttwrS78q+E51XMVJjKA4UzsOs7VS9p1ATCHZH4X38CvWRRYpAYqEwAOHDmt9ulbw6jzEa3j de/2R525jabQ== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="167720034" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="167720034" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 06:49:08 -0700 IronPort-SDR: qFHdm6s2GlaUv0ISSqgMm5qBRrOTxt2uO/dQfYgeoEANc2352v0uwSDg1NczyZ5omiDUc/Pv8I rFZ53SFCg3oA== X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="460851529" Received: from bricha3-mobl.ger.corp.intel.com ([10.213.193.115]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 17 Jul 2020 06:49:06 -0700 Date: Fri, 17 Jul 2020 14:49:03 +0100 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= Cc: "Zhao1, Wei" , "Guo, Jia" , dev@dpdk.org, Thomas Monjalon , "Yigit, Ferruh" , Andrew Rybchenko Message-ID: <20200717134903.GG708@bricha3-MOBL.ger.corp.intel.com> References: <98CBD80474FA8B44BF855DF32C47DC35C61127@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35C61128@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35C61128@smartserver.smartshare.dk> Subject: Re: [dpdk-dev] ixgbe vector rx does not conform torte_eth_rx_burst() API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jul 16, 2020 at 11:08:49AM +0200, Morten Brørup wrote: > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhao1, Wei > > Sent: Thursday, July 16, 2020 10:50 AM > > > > Hi, > > > > > -----Original Message----- > > > From: Morten Brørup > > > Sent: Thursday, July 16, 2020 12:03 AM > > > To: Zhao1, Wei ; Guo, Jia > > > Cc: dev@dpdk.org; Thomas Monjalon ; Yigit, > > Ferruh > > > ; Andrew Rybchenko > > > > > Subject: ixgbe vector rx does not conform to rte_eth_rx_burst() API > > > > > > Wei, Jeff, > > > > > > For the ixgbe driver using vector functions, i.e. > > ixgbe_recv_pkts_vec(), calling > > > rte_eth_rx_burst() with nb_pkts > RTE_IXGBE_MAX_RX_BURST only returns > > > RTE_IXGBE_MAX_RX_BURST packets. E.g. calling rte_eth_rx_burst() with > > > nb_pkts=64 only returns 32 packets. > > > > > > > > > The API description of rte_eth_rx_burst() says: > > > > > > > > > The rte_eth_rx_burst() function returns the number of packets > > actually > > > retrieved, which is the number of rte_mbuf data structures > > effectively supplied > > > into the rx_pkts array. A return value equal to nb_pkts indicates > > that the RX > > > queue contained at least rx_pkts packets, and this is likely to > > signify that other > > > received packets remain in the input queue. Applications implementing > > a > > > "retrieve as much received packets as possible" policy can check this > > specific > > > case and keep invoking the rte_eth_rx_burst() function until a value > > less than > > > nb_pkts is returned. > > > > > > > > > The driver implementation does not conform to the documented behavior > > for > > > "retrieve as much received packets as possible" applications. > > > > It seems not an issue, this function has comment bellow, it is design > > work in that way. > > > > > > /* > > * vPMD receive routine, only accept(nb_pkts >= > > RTE_IXGBE_DESCS_PER_LOOP) > > * > > * Notice: > > * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet > > * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan RTE_IXGBE_MAX_RX_BURST > > * numbers of DD bit > > * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two > > */ > > > > I noticed this already. And yes, ixgbe_recv_pkts_vec() does what its comments says. > > However, when ixgbe_recv_pkts_vec() is used as the driver's implementation of the rte_eth_rx_burst() function call, the rte_eth_rx_burst() function does not do what is expected of the rte_eth_rx_burst() function. > > The implementation must conform to the API that it implements. > > If you don't want to update the ixgbe_recv_pkts_vec() function, I propose that you add a wrapper function that calls ixgbe_recv_pkts_vec() repeatedly, and use the wrapper function as the implementation of the rte_eth_rx_burst() function. > I agree it does not conform to the API as documented. Looking at the i40e AVX2 vector code paths, the regular (no-fragmented packets) path does not seem to put a limit on the size of burst received, while the scattered receive path uses the latter scheme of a wrapper function. Therefore, either approach should work for ixgbe driver, I think. /Bruce