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 46168A046B for ; Thu, 25 Jul 2019 06:35:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B1BF1C267; Thu, 25 Jul 2019 06:35:58 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id CCB911C24A; Thu, 25 Jul 2019 06:35:55 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2019 21:35:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,305,1559545200"; d="scan'208";a="171698134" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga007.fm.intel.com with ESMTP; 24 Jul 2019 21:35:53 -0700 From: Qi Zhang To: wenzhuo.lu@intel.com, jingjing.wu@intel.com Cc: lei.yao@intel.com, dev@dpdk.org, Qi Zhang , stable@dpdk.org Date: Thu, 25 Jul 2019 12:38:29 +0800 Message-Id: <20190725043829.19440-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH v2] net/iavf: fix endless loop 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" Change loop index from uint16_t to uint32_t since max index 65535 could be exceeded when ring size is 2k+. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Reported-by: Lei Yao Signed-off-by: Qi Zhang --- v2: - add missing fix in reset_tx_queue. drivers/net/iavf/iavf_rxtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index d8eb6d296..22d7bb612 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -144,7 +144,8 @@ check_rx_bulk_allow(struct iavf_rx_queue *rxq) static inline void reset_rx_queue(struct iavf_rx_queue *rxq) { - uint16_t len, i; + uint16_t len; + uint32_t i; if (!rxq) return; @@ -174,7 +175,8 @@ static inline void reset_tx_queue(struct iavf_tx_queue *txq) { struct iavf_tx_entry *txe; - uint16_t i, prev, size; + uint32_t i, size; + uint16_t prev; if (!txq) { PMD_DRV_LOG(DEBUG, "Pointer to txq is NULL"); -- 2.13.6