From owner-freebsd-current@FreeBSD.ORG Tue Aug 23 18:33:12 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 930AE16A41F for ; Tue, 23 Aug 2005 18:33:12 +0000 (GMT) (envelope-from maksim.yevmenkin@gmail.com) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B40443D49 for ; Tue, 23 Aug 2005 18:33:11 +0000 (GMT) (envelope-from maksim.yevmenkin@gmail.com) Received: by rproxy.gmail.com with SMTP id i8so1208857rne for ; Tue, 23 Aug 2005 11:33:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=VAwAlZs1whsl/GPlnZilCWpiWEP1zoGu2sVe+zfJ6DvCnaDqdgURY3VHex/bsIHpQhNb4SEVo7fNpiaP3q7JLB/JDqPn4e9JCart0spYfqBTBjX4BW9ZhHRRcNgbxnY2mKsn8eHSTeyReHz1kVelwwcuDedImowwchAxGKAH4rs= Received: by 10.38.88.28 with SMTP id l28mr533909rnb; Tue, 23 Aug 2005 11:33:10 -0700 (PDT) Received: by 10.38.208.5 with HTTP; Tue, 23 Aug 2005 11:33:10 -0700 (PDT) Message-ID: Date: Tue, 23 Aug 2005 11:33:10 -0700 From: Maksim Yevmenkin To: Brooks Davis In-Reply-To: <20050823173622.GB6926@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1088_19999326.1124821990561" References: <430B57A7.1050402@savvis.net> <20050823173622.GB6926@odin.ac.hmc.edu> X-Mailman-Approved-At: Wed, 24 Aug 2005 11:37:25 +0000 Cc: "Evgueni V. Gavrilov" , freebsd-current@freebsd.org, glebius@freebsd.org, freebsd-net@freebsd.org Subject: Re: [Fwd: assigning an address to ng_fec(4) iface causes panic] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 23 Aug 2005 18:33:12 -0000 ------=_Part_1088_19999326.1124821990561 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 8/23/05, Brooks Davis wrote: > On Tue, Aug 23, 2005 at 10:09:06AM -0700, Maksim Yevmenkin wrote: > > Hello, > > > > please try the attached patch. > > > > > >Description: > > > assigning an address to ng_fec(4) iface causes panic > > > during dumping to dumpdev another panic occurs preventing to = identify the source of the first panic and having the crash dump > > > > > > ng_iface creation sequence: > > > mkpeer fec dummy fec > > > msg fec0: add_iface "em0" > > > msg fec0: add_iface "em1" > > > msg fec0: set_mode_mac > > > >=20 > > --- ng_fec.c.orig Mon Aug 22 11:42:51 2005 > > +++ ng_fec.c Tue Aug 23 10:05:23 2005 > > @@ -544,8 +544,8 @@ > > struct ifnet *ifp, *bifp; > > struct ng_fec_portlist *p; > > > > - ifp =3D arg; > > - priv =3D ifp->if_softc; > > + priv =3D arg; > > + ifp =3D priv->ifp; > > b =3D &priv->fec_bundle; > > > > if (b->fec_ifcnt =3D=3D 1 || b->fec_ifcnt =3D=3D 3) { >=20 > This isn't quite sufficent. You also should change the ng_fec_init(ifp) > call on line 718 to ng_fec_init(ifp->if_softc). If that work's I'll > commit it. oops... i missed this. thanks for catching this! i do not have hardware to test it :) i have attached updated path. if anyone could please test it and confirm that it works then feel free to commit it (or let me know and i can commit it myself :) > I've got to say this calling convention is really stupid. I'm > really tempted to change ifp->if_init() to take a struct ifnet * even > though it means an API change and a tree sweep. sounds good to me. thanks, max ------=_Part_1088_19999326.1124821990561 Content-Type: text/plain; name="ng_fec.c.diff.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ng_fec.c.diff.txt" LS0tIG5nX2ZlYy5jLm9yaWcJTW9uIEF1ZyAyMiAxMTo0Mjo1MSAyMDA1CisrKyBuZ19mZWMuYwlU dWUgQXVnIDIzIDExOjI4OjM2IDIwMDUKQEAgLTU0NCw4ICs1NDQsOCBAQAogCXN0cnVjdCBpZm5l dAkJKmlmcCwgKmJpZnA7CiAJc3RydWN0IG5nX2ZlY19wb3J0bGlzdAkqcDsKIAotCWlmcCA9IGFy ZzsKLQlwcml2ID0gaWZwLT5pZl9zb2Z0YzsKKwlwcml2ID0gYXJnOworCWlmcCA9IHByaXYtPmlm cDsKIAliID0gJnByaXYtPmZlY19idW5kbGU7CiAKIAlpZiAoYi0+ZmVjX2lmY250ID09IDEgfHwg Yi0+ZmVjX2lmY250ID09IDMpIHsKQEAgLTcxNSw3ICs3MTUsNyBAQAogCQkJCX0KIAkJCQlpZnAt PmlmX2Rydl9mbGFncyAmPSB+KElGRl9EUlZfT0FDVElWRSk7CiAJCQkJaWZwLT5pZl9kcnZfZmxh Z3MgfD0gSUZGX0RSVl9SVU5OSU5HOwotCQkJCW5nX2ZlY19pbml0KGlmcCk7CisJCQkJbmdfZmVj X2luaXQocHJpdik7CiAJCQl9CiAJCQkvKgogCQkJICogQnViYmxlIGRvd24gY2hhbmdlcyBpbiBw cm9taXNjIG1vZGUgdG8K ------=_Part_1088_19999326.1124821990561--