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 D996FAE25 for ; Mon, 9 Jun 2014 19:26:31 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 09 Jun 2014 10:21:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,1003,1392192000"; d="scan'208";a="545284500" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 09 Jun 2014 10:26:45 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s59HQix1020310; Mon, 9 Jun 2014 18:26:44 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s59HQimP027902; Mon, 9 Jun 2014 18:26:44 +0100 Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id s59HQiNF027898; Mon, 9 Jun 2014 18:26:44 +0100 From: Konstantin Ananyev To: dev@dpdk.org Date: Mon, 9 Jun 2014 18:26:14 +0100 Message-Id: <1402334777-27379-2-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1402334777-27379-1-git-send-email-konstantin.ananyev@intel.com> References: <1402334777-27379-1-git-send-email-konstantin.ananyev@intel.com> To: dev@dpdk.org Subject: [dpdk-dev] [PATCHv2 1/4] e1000: do not release queue on alloc error 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: Mon, 09 Jun 2014 17:26:32 -0000 If igb_alloc_rx_queue_mbufs() would fail to allocate an mbuf for RX queue, it calls igb_rx_queue_release(rxq). That causes rxq to be silently freed, without updating dev->data->rx_queues[]. So any further reference to it will trigger the SIGSEGV. Same thing in em PMD too. To fix: igb_alloc_rx_queue_mbufs() should just return an error to the caller and let upper layer to deal with the probem. That's what ixgbe PMD is doing right now. Signed-off-by: Konstantin Ananyev --- lib/librte_pmd_e1000/em_rxtx.c | 1 - lib/librte_pmd_e1000/igb_rxtx.c | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c index 4f98a3f..5ed4def 100644 --- a/lib/librte_pmd_e1000/em_rxtx.c +++ b/lib/librte_pmd_e1000/em_rxtx.c @@ -1580,7 +1580,6 @@ em_alloc_rx_queue_mbufs(struct em_rx_queue *rxq) if (mbuf == NULL) { PMD_INIT_LOG(ERR, "RX mbuf alloc failed " "queue_id=%hu\n", rxq->queue_id); - em_rx_queue_release(rxq); return (-ENOMEM); } diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index ae53428..e35649f 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -1818,7 +1818,6 @@ igb_alloc_rx_queue_mbufs(struct igb_rx_queue *rxq) if (mbuf == NULL) { PMD_INIT_LOG(ERR, "RX mbuf alloc failed " "queue_id=%hu\n", rxq->queue_id); - igb_rx_queue_release(rxq); return (-ENOMEM); } dma_addr = -- 1.8.3.1