Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Feb 2005 18:51:49 +0100
From:      Max Laier <max@love2party.net>
To:        freebsd-pf@freebsd.org
Subject:   Please test: MPSAFE callouts
Message-ID:  <200502211852.01792.max@love2party.net>

next in thread | raw e-mail | index | archive | help
--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502211852.01792.max>