From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 16 10:53:07 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7679951E for ; Mon, 16 Mar 2015 10:53:07 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17D8FAEC for ; Mon, 16 Mar 2015 10:53:06 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2GAr1lH066089 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Mar 2015 12:53:01 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2GAr1lH066089 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2GAr1TO066088; Mon, 16 Mar 2015 12:53:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Mar 2015 12:53:01 +0200 From: Konstantin Belousov To: Michael Fuckner Subject: Re: Server with 3TB Crashing at boot Message-ID: <20150316105301.GB2379@kib.kiev.ua> References: <20150314153941.GL2379@kib.kiev.ua> <5505160A.1020703@fuckner.net> <5505827D.6060404@fuckner.net> <5505982E.9060201@fuckner.net> <20150315193202.GS2379@kib.kiev.ua> <2138577776.537937.1426455964006.JavaMail.open-xchange@ptangptang.store> <20150316091758.GY2379@kib.kiev.ua> <5506ADA4.8020207@fuckner.net> <20150316103140.GA2379@kib.kiev.ua> <5506B23F.20400@fuckner.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5506B23F.20400@fuckner.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "freebsd-hackers@freebsd.org" , Ryan Stone , Steven Hartland X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2015 10:53:07 -0000 On Mon, Mar 16, 2015 at 11:36:47AM +0100, Michael Fuckner wrote: > On 03/16/2015 11:31 AM, Konstantin Belousov wrote: > > On Mon, Mar 16, 2015 at 11:17:08AM +0100, Michael Fuckner wrote: > >> Just generated, anything I should test in debugger? > >> Else I'll do the same with STABLE next. > > With stable, it is only interesting if 'fault' lines are gone. > > > >> > >> http://dedi3.fuckner.net/~molli123/temp/head.txt > >> > >> doing minimal network traffic causes the kernel to panic. > > Please do the following: > > gdb kernel.debug (your kernel should be build with makeoptions DEBUG=-g) > > in gdb do > > (gdb) list *dmar_bus_dmamap_load_buffer+0x53 > > > > http://dedi3.fuckner.net/~molli123/temp/gdb.txt <- is this what you need? No. gdb must be run on the live system, at the shell prompt. You did it from the ddb. Anyway, as a guess from reading ixgbe source and from my experience with the em/igb, you could try the following. diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index db202fd..b34a72b 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -3765,7 +3765,6 @@ ixgbe_txeof(struct tx_ring *txr) buf->map); m_freem(buf->m_head); buf->m_head = NULL; - buf->map = NULL; } buf->eop = NULL; ++txr->tx_avail; @@ -3791,7 +3790,6 @@ ixgbe_txeof(struct tx_ring *txr) buf->map); m_freem(buf->m_head); buf->m_head = NULL; - buf->map = NULL; } ++txr->tx_avail; buf->eop = NULL; @@ -3954,8 +3952,7 @@ ixgbe_allocate_receive_buffers(struct rx_ring *rxr) for (i = 0; i < rxr->num_desc; i++, rxbuf++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->ptag, - BUS_DMA_NOWAIT, &rxbuf->pmap); + error = bus_dmamap_create(rxr->ptag, 0, &rxbuf->pmap); if (error) { device_printf(dev, "Unable to create RX dma map\n"); goto fail; There seems to be an unload leak as well, but lets fix the panic first. I.e. try the patch below only after you confirm that the patch above helps. diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index db202fd..b34a72b 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c m_free(rbuf->buf); rbuf->buf = NULL; } + bus_dmamap_unload(rxr->ptag, rbuf->pmap); rbuf->flags = 0; @@ -4732,6 +4730,7 @@ ixgbe_rxeof(struct ix_queue *que) sendmp->m_flags |= M_PKTHDR; sendmp->m_pkthdr.len = mp->m_len; } + bus_dmamap_unload(rxr->ptag, rbuf->pmap); ++processed; /* Pass the head pointer on */