From owner-cvs-src-old@FreeBSD.ORG Wed May 27 02:49:23 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13A2A106564A for ; Wed, 27 May 2009 02:49:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 00B5F8FC1E for ; Wed, 27 May 2009 02:49:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n4R2nMrP091175 for ; Wed, 27 May 2009 02:49:22 GMT (envelope-from adrian@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n4R2nMTI091174 for cvs-src-old@freebsd.org; Wed, 27 May 2009 02:49:22 GMT (envelope-from adrian@repoman.freebsd.org) Message-Id: <200905270249.n4R2nMTI091174@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to adrian@repoman.freebsd.org using -f From: Adrian Chadd Date: Wed, 27 May 2009 02:49:08 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/xen/netfront netfront.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2009 02:49:23 -0000 adrian 2009-05-27 02:49:08 UTC FreeBSD src repository Modified files: sys/dev/xen/netfront netfront.c Log: SVN rev 192871 on 2009-05-27 02:49:08Z by adrian Ensure that there are enough TX mbuf ring slots available before beginning to dequeue a packet. The tx path was trying to ensure that enough Xenbus TX ring slots existed but it didn't check to see whether the mbuf TX ring slots were also available. They get freed in xn_txeof() which occurs after transmission, rather than earlier on in the process. (The same happens under Linux too.) Due to whatever reason (CPU use, scheduling, memory constraints, whatever) the mbuf TX ring may not have enough slots free and would allocate slot 0. This is used as the freelist head pointer to represent "free" mbuf TX ring slots; setting this to an actual mbuf value rather than an id crashes the code. This commit introduces some basic code to track the TX mbuf ring use and then (hopefully!) ensures that enough slots are free in said TX mbuf ring before it enters the actual work loop. A few notes: * Similar logic needs to be introduced to check there are enough actual slots available in the xenbuf TX ring. There's some logic which is invoked earlier but it doesn't hard-check against the number of available ring slots. Its trivial to do; I'll do it in a subsequent commit. * As I've now commented in the source, it is likely possible to deadlock the driver under certain conditions where the rings aren't receiving any changes (which I should enumerate) and thus Xen doesn't send any further software interrupts. I need to make sure that the timer(s) are running right and the queues are periodically kicked. PR: 134926 Revision Changes Path 1.18 +44 -1 src/sys/dev/xen/netfront/netfront.c