Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Feb 2015 23:02:57 +0300
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Roger Pau =?iso-8859-1?Q?Monn=E9?= <royger@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys
Message-ID:  <20150219200257.GK15484@FreeBSD.org>
In-Reply-To: <54E62FB6.6050800@FreeBSD.org>
References:  <201502190119.t1J1JhSI025601@svn.freebsd.org> <54E62FB6.6050800@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--fjEAjMKpll6GDq3U
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

On Thu, Feb 19, 2015 at 07:47:18PM +0100, Roger Pau Monné wrote:
R> El 19/02/15 a les 2.19, Gleb Smirnoff ha escrit:
R> > Author: glebius
R> > Date: Thu Feb 19 01:19:42 2015
R> > New Revision: 278977
R> > URL: https://svnweb.freebsd.org/changeset/base/278977
R> > 
R> > Log:
R> >   Provide a set of inline functions to manage simple mbuf(9) queues, based
R> >   on queue(3)'s STAILQ.  Utilize them in cxgb(4) and Xen, deleting home
R> >   grown implementations.
R> >   
R> >   Sponsored by:	Netflix
R> >   Sponsored by:	Nginx, Inc.
R> 
R> Have you tested this commit on Xen? I'm getting the following:
R> 
R> xn0: <Virtual Network Interface> at device/vif/0 on xenbusb_front0
R> xn0: Ethernet address: 00:16:3e:51:85:e3
R> xenbusb_back0: <Xen Backend Devices> on xenstore0
R> xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8.
R> xn0: backend features: feature-sg feature-gso-tcp4
R> panic: no mbufs processed
R> cpuid = 0
R> KDB: stack backtrace:
R> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe007adc3920
R> vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0
R> kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10
R> network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0xfffffe007adc3ac0
R> network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50
R> netfront_backend_changed() at netfront_backend_changed+0xed/frame 0xfffffe007adc3b90
R> xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0
R> fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0
R> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0
R> --- trap 0, rip = 0, rsp = 0xfffffe007adc3cb0, rbp = 0 ---
R> KDB: enter: panic
R> [ thread pid 15 tid 100038 ]
R> Stopped at      kdb_enter+0x3e: movq    $0,kdb_why

I guess the problem is that the queue limit isn't initialized. Please
try the attached patch.

The problem with older mbufq was that it doesn't have any sane limit
on it. So, converting to new, I simply put INT_MAX, which is ugly.

I'd appreciate if you fix mbufq_init()s in netfront.c to some appropriate
values.

-- 
Totus tuus, Glebius.

--fjEAjMKpll6GDq3U
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="netfront.c.diff"

Index: netfront.c
===================================================================
--- netfront.c	(revision 279017)
+++ netfront.c	(working copy)
@@ -2062,6 +2062,9 @@ create_netdev(device_t dev)
 		np->rx_mbufs[i] = NULL;
 		np->grant_rx_ref[i] = GRANT_REF_INVALID;
 	}
+
+	mbufq_init(&np->xn_rx_batch, INT_MAX);
+
 	/* A grant for every tx ring slot */
 	if (gnttab_alloc_grant_references(NET_TX_RING_SIZE,
 					  &np->gref_tx_head) != 0) {

--fjEAjMKpll6GDq3U--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150219200257.GK15484>