From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 87D102C6D for ; Tue, 29 Aug 2017 18:10:37 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 29 Aug 2017 09:10:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,445,1498546800"; d="scan'208";a="123702498" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga004.jf.intel.com with ESMTP; 29 Aug 2017 09:10:35 -0700 To: Ajit Khaparde , dev@dpdk.org References: <20170824162956.62761-1-ajit.khaparde@broadcom.com> <20170824162956.62761-4-ajit.khaparde@broadcom.com> From: Ferruh Yigit Message-ID: Date: Tue, 29 Aug 2017 17:10:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170824162956.62761-4-ajit.khaparde@broadcom.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/8] net/bnxt: add support for rx_queue_count 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: Tue, 29 Aug 2017 16:10:37 -0000 On 8/24/2017 5:29 PM, Ajit Khaparde wrote: > add support for rx_queue_count dev_op > Signed-off-by: Ajit Khaparde <...> > +static uint32_t > +bnxt_rx_queue_count_op(struct rte_eth_dev *dev, uint16_t rx_queue_id) > +{ > + uint32_t desc = 0, raw_cons = 0, cons; > + struct bnxt_cp_ring_info *cpr; > + struct bnxt_rx_queue *rxq; > + struct rx_pkt_cmpl *rxcmp; > + > + rxq = dev->data->rx_queues[rx_queue_id]; > + cpr = rxq->cp_ring; > + > + while (raw_cons < rxq->nb_rx_desc) { > + cons = RING_CMP(cpr->cp_ring_struct, raw_cons++); > + rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; > + > + if (CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct)) "raw_cons" increased above, the "raw_cons" here and the one used to get "cons" are different. Is this an issue for cmp_valid ? > + desc++; > + } > + > + return desc; > +} <...>