From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D67575677 for ; Thu, 19 Mar 2015 17:12:46 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 19 Mar 2015 09:11:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,430,1422950400"; d="scan'208";a="667607380" Received: from unknown (HELO Sent) ([10.217.248.233]) by orsmga001.jf.intel.com with SMTP; 19 Mar 2015 09:11:43 -0700 Received: by Sent (sSMTP sendmail emulation); Thu, 19 Mar 2015 17:09:33 +0100 From: Pawel Wodkowski To: dev@dpdk.org Date: Thu, 19 Mar 2015 17:09:16 +0100 Message-Id: <1426781356-13999-1-git-send-email-pawelx.wodkowski@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Pawel Wodkowski Subject: [dpdk-dev] [PATCH] ixgbe: fix buffer overrun bug in non-bulk alloc mode setup 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: Thu, 19 Mar 2015 16:12:47 -0000 From: Pawel Wodkowski When bulk alloc is enabled at compile time but preconditions for it are not met at runtime the ixgbe_reset_rx_queue() function overrides rxq->sw_ring not allocated elements. Fixes: 01fa1d6 ("ixgbe: unify Rx setup") Signed-off-by: Pawel Wodkowski --- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index 42f0aa5..dddc12f 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -2111,8 +2111,8 @@ ixgbe_reset_rx_queue(struct ixgbe_hw *hw, struct ixgbe_rx_queue *rxq) * entries is always allocated */ memset(&rxq->fake_mbuf, 0x0, sizeof(rxq->fake_mbuf)); - for (i = 0; i < RTE_PMD_IXGBE_RX_MAX_BURST; ++i) { - rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf; + for (i = rxq->nb_rx_desc; i < len; ++i) { + rxq->sw_ring[i].mbuf = &rxq->fake_mbuf; } rxq->rx_nb_avail = 0; -- 1.9.1