From owner-freebsd-current@FreeBSD.ORG Wed Oct 1 18:58:41 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B60EC95; Wed, 1 Oct 2014 18:58:41 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 789AC759; Wed, 1 Oct 2014 18:58:40 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id z12so1322867wgg.1 for ; Wed, 01 Oct 2014 11:58:38 -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:date:message-id:subject :from:to:cc:content-type; bh=/U62aYkrTqk60tqG6E04yDWbHSACN/l5NCZRVISflhU=; b=yH6hrcDMSxhzI8gbWUWBhBDY7S+Nm5HBvlq2mn3AuEi/vt/w7t0tVu9E6cr91mK7o5 Gt8r3A4qnnZeFMgLksiDm7llzuHQbN1OqIwO92KJVA4IqF4whijEdbW0l/pgrVQPtrfA Ikf+B2IBygsfgWZRY6xk/8K6/ZX8kDTXjVV9fiAAOxGQe9VNAaRxfdxOirnh6+/kr/gz 0Svh2F7Xyizqu4VHxp8qIlno/gFWX3PDNhvNPvIQolN2mgTmN7DPMeVDJsj7cOCcvYtq WQ4A4mwID9ZTWDQ2ns0Me8QAYVonpo+Pz4xEVk46QH4tNgGy5Namcf4joKEGSzosCDKs BEWg== MIME-Version: 1.0 X-Received: by 10.194.202.138 with SMTP id ki10mr40773096wjc.68.1412189918636; Wed, 01 Oct 2014 11:58:38 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Wed, 1 Oct 2014 11:58:38 -0700 (PDT) In-Reply-To: <2113392.UOaBFTpimf@ralph.baldwin.cx> References: <2113392.UOaBFTpimf@ralph.baldwin.cx> Date: Wed, 1 Oct 2014 11:58:38 -0700 X-Google-Sender-Auth: dt0eFRxLUoxzQQ5vl7kEKff9-1E Message-ID: Subject: Re: [PATCH] Fix OACTIVE for an(4) From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 18:58:41 -0000 Hi, On 1 October 2014 07:14, John Baldwin wrote: > This small patch correctly sets OACTIVE when an(4) gets backed up. Right now > I believe it will never set the flag. It is only an optimization, it should > not affect correctness. > > Index: an/if_an.c > =================================================================== > --- an/if_an.c (revision 270968) > +++ an/if_an.c (working copy) > @@ -2906,11 +2906,11 @@ > CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350)); > } > > - if (m0 != NULL) > + if (sc->an_rdata.an_tx_prod != idx) { > ifp->if_drv_flags |= IFF_DRV_OACTIVE; > + sc->an_rdata.an_tx_prod = idx; > + } > > - sc->an_rdata.an_tx_prod = idx; > - > return; > } I haven't looked at the rest of the driver; is everything else around OACTIVE locked correctly and consistently? There's no single-entry into if_start(). It can be called from multiple paths at the same time. -a