From owner-svn-src-head@FreeBSD.ORG Sun Oct 6 15:15:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A87EB59E; Sun, 6 Oct 2013 15:15:55 +0000 (UTC) (envelope-from mr.kodiak@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FE702F6B; Sun, 6 Oct 2013 15:15:55 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id x13so13495189ief.31 for ; Sun, 06 Oct 2013 08:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=a8YmKFFnIccU2PR/jep+jKDv42ZOQXYzghURZYysDMo=; b=pFMezmpu5k6VN2E7fCE+yPsBEyQw2SPH87qYPCtr/eoD5V1pxok9LVkoaDb7t8fj8G gveVi6deAla5VNC+hFec4jyQvtreia2fqxVMUxsjkT4mak5T9HNeawmAHksc7EknoxPt AcEnbszTRTY9XWqUN5k3sOOwGEeOHDJtCLIRwYT8OTptt/0NCJDz/dphce/1Wjhk6t4T LeBPfqGkcfnVWY4Wt0V1kVIPYrP1Efd/J/4CLx4x3Ijp7wRS2s8q+uNwz3K2s+vTR5sM HJZc6VpcYoHCOpdlWOz36tS7HDxaakLP4rfPj+f0upiMEhP7UdGAOnU5kDvJpZkQFKbX 39GA== X-Received: by 10.42.92.84 with SMTP id s20mr21326icm.63.1381072554700; Sun, 06 Oct 2013 08:15:54 -0700 (PDT) MIME-Version: 1.0 Sender: mr.kodiak@gmail.com Received: by 10.64.6.134 with HTTP; Sun, 6 Oct 2013 08:15:24 -0700 (PDT) In-Reply-To: <525080A6.6020505@FreeBSD.org> References: <201310051807.r95I7P0M048589@svn.freebsd.org> <525080A6.6020505@FreeBSD.org> From: Bryan Venteicher Date: Sun, 6 Oct 2013 10:15:24 -0500 X-Google-Sender-Auth: FSYQdzc1aW_ujHezm8C-5hsKdvw Message-ID: Subject: Re: svn commit: r256066 - head/sys/dev/virtio/network To: "Alexander V. Chernikov" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, Bryan Venteicher , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Oct 2013 15:15:55 -0000 On Sat, Oct 5, 2013 at 4:12 PM, Alexander V. Chernikov wrote: > On 05.10.2013 22:07, Bryan Venteicher wrote: > > Author: bryanv > > Date: Sat Oct 5 18:07:24 2013 > > New Revision: 256066 > > URL: http://svnweb.freebsd.org/changeset/base/256066 > > > > Log: > > Do not hold the vtnet Rx queue lock when calling up into the stack > Do you measure performance penalty for this? > > I wasn't able to measure anything, but I don't have the most update hardware either. There should hardly ever be any contention and it should be in its own cacheline, so it is about as cheap as a mutex acquire can get. > > This matches other similar drivers and avoids various LOR warnings. > We're currently trying to eliminate such things in other drivers like > ixgbe, maybe there can be some other way to eliminate possible LORs? > > > Agreed - I'd prefer not to do this and that's why I originally had it commented out. I don't think witness was just reporting a false positives either. vtnet's locking scheme is very similar to ixgbe, so fixes ixgbe should translate to vtnet. > > Approved by: re (marius) > > > > Modified: > > head/sys/dev/virtio/network/if_vtnet.c > > > > Modified: head/sys/dev/virtio/network/if_vtnet.c > > > ============================================================================== > > --- head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 16:22:33 2013 > (r256065) > > +++ head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 18:07:24 2013 > (r256066) > > @@ -1700,9 +1700,9 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, s > > rxq->vtnrx_stats.vrxs_ipackets++; > > rxq->vtnrx_stats.vrxs_ibytes += m->m_pkthdr.len; > > > > - /* VTNET_RXQ_UNLOCK(rxq); */ > > + VTNET_RXQ_UNLOCK(rxq); > > (*ifp->if_input)(ifp, m); > > - /* VTNET_RXQ_LOCK(rxq); */ > > + VTNET_RXQ_LOCK(rxq); > > } > > > > static int > > @@ -1782,6 +1782,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > > m_adj(m, adjsz); > > > > vtnet_rxq_input(rxq, m, hdr); > > + > > + /* Must recheck after dropping the Rx lock. */ > > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > > + break; > > } > > > > if (deq > 0) > > > > >