From owner-freebsd-pf@FreeBSD.ORG Mon Feb 21 17:52:05 2005 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A454816A4CE for ; Mon, 21 Feb 2005 17:52:05 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id E298D43D6B for ; Mon, 21 Feb 2005 17:52:04 +0000 (GMT) (envelope-from max@love2party.net) Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1D3Hj2-00070D-00 for freebsd-pf@freebsd.org; Mon, 21 Feb 2005 18:52:04 +0100 Received: from [217.83.10.18] (helo=donor.laier.local) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1D3Hj1-00072R-00 for freebsd-pf@freebsd.org; Mon, 21 Feb 2005 18:52:04 +0100 From: Max Laier To: freebsd-pf@freebsd.org Date: Mon, 21 Feb 2005 18:51:49 +0100 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2325617.StZqZKbVle"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200502211852.01792.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:61c499deaeeba3ba5be80f48ecc83056 Subject: Please test: MPSAFE callouts X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical discussion and general questions about packet filter (pf) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Feb 2005 17:52:05 -0000 --nextPart2325617.StZqZKbVle Content-Type: multipart/mixed; boundary="Boundary-01=_1+hGCbzovbXwYE7" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_1+hGCbzovbXwYE7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline All, Pyun reminded me that we are still useing Giant to protect our callouts. We= =20 don't have to since we protect our code in there with our own mutex and the= =20 netstack is Giant-free as well now (provided that mpsafenet is enabled). If you have testing capabilities, please take the attached diffs for a ride= =20 (on SMP hardware) with debug.mpsafenet=3D1 and MPSAFE NICs. It'd be great = if=20 we could enable it for 5.4R, but we need proper testing to do so! NOTE: If you use user/group rules you still need to set debug.mpsafenet=3D0= , but=20 testing of this scenario is welcome as well. Thanks in advance for your feedback! =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-01=_1+hGCbzovbXwYE7 Content-Type: text/x-diff; charset="us-ascii"; name="callout_mpsafe.RELENG_5.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="callout_mpsafe.RELENG_5.diff" Index: if_pfsync.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/store/mlaier/fcvs/src/sys/contrib/pf/net/if_pfsync.c,v retrieving revision 1.11.2.1 diff -u -r1.11.2.1 if_pfsync.c =2D-- if_pfsync.c 20 Sep 2004 15:25:57 -0000 1.11.2.1 +++ if_pfsync.c 21 Feb 2005 17:39:18 -0000 @@ -196,14 +196,10 @@ ifp->if_baudrate =3D IF_Mbps(100); ifp->if_softc =3D sc; pfsync_setmtu(sc, MCLBYTES); =2D /* =2D * XXX =2D * The 2nd arg. 0 to callout_init(9) shoule be set to CALLOUT_MPSAFE =2D * if Gaint lock is removed from the network stack. =2D */ =2D callout_init(&sc->sc_tmo, 0); =2D callout_init(&sc->sc_bulk_tmo, 0); =2D callout_init(&sc->sc_bulkfail_tmo, 0); + callout_init(&sc->sc_tmo, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&sc->sc_bulk_tmo, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&sc->sc_bulkfail_tmo, + debug_mpsafenet ? CALLOUT_MPSAFE : 0); if_attach(&sc->sc_if); =20 LIST_INSERT_HEAD(&pfsync_list, sc, sc_next); Index: pf_ioctl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/store/mlaier/fcvs/src/sys/contrib/pf/net/pf_ioctl.c,v retrieving revision 1.12.2.5 diff -u -r1.12.2.5 pf_ioctl.c =2D-- pf_ioctl.c 21 Jan 2005 19:07:44 -0000 1.12.2.5 +++ pf_ioctl.c 21 Feb 2005 17:38:34 -0000 @@ -322,12 +322,7 @@ my_timeout[PFTM_FRAG] =3D 30; /* Fragment expire */ my_timeout[PFTM_INTERVAL] =3D 10; /* Expire interval */ =20 =2D /* =2D * XXX =2D * The 2nd arg. 0 to callout_init(9) shoule be set to CALLOUT_MPSAFE =2D * if Gaint lock is removed from the network stack. =2D */ =2D callout_init(&pf_expire_to, 0); + callout_init(&pf_expire_to, debug_mpsafenet ? CALLOUT_MPSAFE : 0); callout_reset(&pf_expire_to, my_timeout[PFTM_INTERVAL] * hz, pf_purge_timeout, &pf_expire_to); =20 --Boundary-01=_1+hGCbzovbXwYE7 Content-Type: text/x-diff; charset="us-ascii"; name="callout_mpsafe.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="callout_mpsafe.diff" Index: if_pfsync.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/store/mlaier/fcvs/src/sys/contrib/pf/net/if_pfsync.c,v retrieving revision 1.14 diff -u -r1.14 if_pfsync.c =2D-- if_pfsync.c 9 Feb 2005 19:29:13 -0000 1.14 +++ if_pfsync.c 21 Feb 2005 17:43:01 -0000 @@ -197,14 +197,10 @@ ifp->if_baudrate =3D IF_Mbps(100); ifp->if_softc =3D sc; pfsync_setmtu(sc, MCLBYTES); =2D /* =2D * XXX =2D * The 2nd arg. 0 to callout_init(9) shoule be set to CALLOUT_MPSAFE =2D * if Gaint lock is removed from the network stack. =2D */ =2D callout_init(&sc->sc_tmo, 0); =2D callout_init(&sc->sc_bulk_tmo, 0); =2D callout_init(&sc->sc_bulkfail_tmo, 0); + callout_init(&sc->sc_tmo, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&sc->sc_bulk_tmo, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&sc->sc_bulkfail_tmo, + debug_mpsafenet ? CALLOUT_MPSAFE : 0); if_attach(ifp); =20 LIST_INSERT_HEAD(&pfsync_list, sc, sc_next); Index: pf_ioctl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/store/mlaier/fcvs/src/sys/contrib/pf/net/pf_ioctl.c,v retrieving revision 1.18 diff -u -r1.18 pf_ioctl.c =2D-- pf_ioctl.c 9 Feb 2005 19:29:13 -0000 1.18 +++ pf_ioctl.c 21 Feb 2005 17:42:33 -0000 @@ -322,12 +322,7 @@ my_timeout[PFTM_FRAG] =3D 30; /* Fragment expire */ my_timeout[PFTM_INTERVAL] =3D 10; /* Expire interval */ =20 =2D /* =2D * XXX =2D * The 2nd arg. 0 to callout_init(9) shoule be set to CALLOUT_MPSAFE =2D * if Gaint lock is removed from the network stack. =2D */ =2D callout_init(&pf_expire_to, 0); + callout_init(&pf_expire_to, debug_mpsafenet ? CALLOUT_MPSAFE : 0); callout_reset(&pf_expire_to, my_timeout[PFTM_INTERVAL] * hz, pf_purge_timeout, &pf_expire_to); =20 --Boundary-01=_1+hGCbzovbXwYE7-- --nextPart2325617.StZqZKbVle Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQBCGh/BXyyEoT62BG0RAsd4AJ9fwlQyd8f6w3UO/2zRJzIZn8l8LwCbBN1k iZdYhN2253fntXTJrI+Bma0= =JKRQ -----END PGP SIGNATURE----- --nextPart2325617.StZqZKbVle--