From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B0E1530D for ; Wed, 28 May 2014 11:28:39 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 28 May 2014 02:28:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,927,1392192000"; d="scan'208";a="546060195" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga002.fm.intel.com with ESMTP; 28 May 2014 02:28:49 -0700 Received: from irsmsx152.ger.corp.intel.com (163.33.192.66) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 28 May 2014 10:28:48 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.239]) by IRSMSX152.ger.corp.intel.com ([169.254.6.197]) with mapi id 14.03.0123.003; Wed, 28 May 2014 10:28:48 +0100 From: "Ananyev, Konstantin" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] fix for 2 consecutive rte_eth_dev_start() can cause a SIGSEGV Thread-Index: AQHPeQFSXqktLBLpx0at9N56ljs7DZtVu57g Date: Wed, 28 May 2014 09:28:48 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580EFB3547@IRSMSX105.ger.corp.intel.com> References: <1400843331-24944-1-git-send-email-konstantin.ananyev@intel.com> <1435991.TQ24Xc1T6G@xps13> In-Reply-To: <1435991.TQ24Xc1T6G@xps13> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] fix for 2 consecutive rte_eth_dev_start() can cause a SIGSEGV 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: Wed, 28 May 2014 09:28:40 -0000 Hi Thomas, >> 1)If igb_alloc_rx_queue_mbufs() would fail to allocate an mbuf for RX qu= eue, >> it calls igb_rx_queue_release(rxq). >> That causes rxq to be silently freed, without updating=20 >> dev->data->rx_queues[]. So any firther 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 ca= ller >> and let upper layer to deal with the probem. >> That's what ixgbe PMD doing right now. >> 2)In tx_queue_setup (for all 3 PMDs: ixgbe, igb, em) we call >> tx_queue_release(dev->data->tx_queues[queue_idx]) >> without setting dev->data->tx_queues[queue_idx] =3D NULL >> afterwards. >> 3)Prevent rte_eth_dev_start/stop to call underneath dev_start/dev_stop >> for already started/stopped device. >> 4) fix compiler warning on PMD_DEBUG_TRACE() formats. >Please, only 1 fix per patch. >This way, we'll hopefully have a nice title for each fix. >It's simpler for changelog. It is all fix for the same problem (except #4 of course). I just put 1,2,3 to make it clear from what sub-parts fix consists. Konstantin=20