From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C3A3714EC for ; Wed, 8 Feb 2017 19:02:54 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 08 Feb 2017 10:02:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,348,1484035200"; d="scan'208";a="818570151" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.137]) ([10.237.220.137]) by FMSMGA003.fm.intel.com with ESMTP; 08 Feb 2017 10:02:52 -0800 To: "Ananyev, Konstantin" , Jianbo Liu , "dev@dpdk.org" , "Zhang, Helin" , "jerin.jacob@caviumnetworks.com" References: <1482127758-4904-1-git-send-email-jianbo.liu@linaro.org> <1486201024-32656-1-git-send-email-jianbo.liu@linaro.org> <2601191342CEEE43887BDE71AB9772583F110DC7@irsmsx105.ger.corp.intel.com> From: Ferruh Yigit Message-ID: <1de7e1b9-cdf9-d53e-132b-30be97883af8@intel.com> Date: Wed, 8 Feb 2017 18:02:51 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB9772583F110DC7@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 1/2] net/ixgbe: calculate the correct number of received packets in bulk alloc function 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: , X-List-Received-Date: Wed, 08 Feb 2017 18:02:55 -0000 On 2/4/2017 1:26 PM, Ananyev, Konstantin wrote: >> >> To get better performance, Rx bulk alloc recv function will scan 8 descs >> in one time, but the statuses are not consistent on ARM platform because >> the memory allocated for Rx descriptors is cacheable hugepages. >> This patch is to calculate the number of received packets by scan DD bit >> sequentially, and stops when meeting the first packet with DD bit unset. >> >> Signed-off-by: Jianbo Liu >> --- >> drivers/net/ixgbe/ixgbe_rxtx.c | 16 +++++++++------- >> 1 file changed, 9 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c >> index 36f1c02..613890e 100644 >> --- a/drivers/net/ixgbe/ixgbe_rxtx.c >> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c >> @@ -1460,17 +1460,19 @@ static inline int __attribute__((always_inline)) >> for (i = 0; i < RTE_PMD_IXGBE_RX_MAX_BURST; >> i += LOOK_AHEAD, rxdp += LOOK_AHEAD, rxep += LOOK_AHEAD) { >> /* Read desc statuses backwards to avoid race condition */ >> - for (j = LOOK_AHEAD-1; j >= 0; --j) >> + for (j = 0; j < LOOK_AHEAD; j++) >> s[j] = rte_le_to_cpu_32(rxdp[j].wb.upper.status_error); >> >> - for (j = LOOK_AHEAD - 1; j >= 0; --j) >> - pkt_info[j] = rte_le_to_cpu_32(rxdp[j].wb.lower. >> - lo_dword.data); >> + rte_smp_rmb(); >> >> /* Compute how many status bits were set */ >> - nb_dd = 0; >> - for (j = 0; j < LOOK_AHEAD; ++j) >> - nb_dd += s[j] & IXGBE_RXDADV_STAT_DD; >> + for (nb_dd = 0; nb_dd < LOOK_AHEAD && >> + (s[nb_dd] & IXGBE_RXDADV_STAT_DD); nb_dd++) >> + ; >> + >> + for (j = 0; j < nb_dd; j++) >> + pkt_info[j] = rte_le_to_cpu_32(rxdp[j].wb.lower. >> + lo_dword.data); >> >> nb_rx += nb_dd; >> >> -- > > Acked-by: Konstantin Ananyev Hi Konstantin, Is the ack valid for v3 and both patches? Thanks, ferruh > >> 1.8.3.1 >