Re: kern/165252 patch

2012-04-27 Thread Nikos Vassiliadis

Christian Lavoie wrote:

Interestingly, both this and the other patch fail to prevent the whole
thing from dying when running "/etc/rc.d/jail stop" (individually or
not). I should be able to get a backtrace and more useful info out of
ddb early next week -- anything in particular that could help?


Nothing special, as far as I know.

I think you should take the backtrace, compare to the existing PRs
and maybe file a new PR. I believe there are plenty of problems
with pf and vimage which are not yet in the PR database. Having them
there helps.

Nikos

___
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: kern/165252 patch

2012-04-27 Thread Christian Lavoie
Interestingly, both this and the other patch fail to prevent the whole
thing from dying when running "/etc/rc.d/jail stop" (individually or
not). I should be able to get a backtrace and more useful info out of
ddb early next week -- anything in particular that could help?

On Thu, Apr 26, 2012 at 2:26 PM, Christian Lavoie
 wrote:
> So far, boots and seems to be working (1 hour and counting). I'll try
> to load up the machine some next week and stress test this.
>
> On Tue, Apr 24, 2012 at 5:15 AM, Nikos Vassiliadis  wrote:
>> On 4/23/2012 6:33 PM, Christian Lavoie wrote:
>>>
>>> The patch mentioned at
>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=165252&cat=kern#reply1 is
>>> working for me -- without the patch my FreeBSD machine crashes within
>>> a minute or two of booting, and with it it's been up for about half a
>>> day now, under non-trivial networking load.
>>>
>>> I've contacted the author directly, and he asked that I mention here
>>> that the patch is working for me, and ask that it be reviewed. Can
>>> someone review said patch?
>>>
>>> I'm running 9.0-RELEASE, running two jails created following the
>>> vimage/vnet howto at
>>>
>>> http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet#Advenced_networking_:_NAT_and_firewalling
>>>
>>
>> Hi Christian,
>>
>> You may want to try this better version of the patch.
>>
>> Warning: it's untested, I can't test it at moment in my FreeBSD-10,
>> because pf panics in several places. I believe it should apply cleanly
>> to FreeBSD-9.0.
>>
>> Nikos
>
>
>
> --
> Have fun, Christian
> http://linkedin.christianlavoie.net
>
> "I won't let you fall apart."



-- 
Have fun, Christian
http://linkedin.christianlavoie.net

"I won't let you fall apart."
___
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: kern/165252 patch

2012-04-26 Thread Christian Lavoie
So far, boots and seems to be working (1 hour and counting). I'll try
to load up the machine some next week and stress test this.

On Tue, Apr 24, 2012 at 5:15 AM, Nikos Vassiliadis  wrote:
> On 4/23/2012 6:33 PM, Christian Lavoie wrote:
>>
>> The patch mentioned at
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=165252&cat=kern#reply1 is
>> working for me -- without the patch my FreeBSD machine crashes within
>> a minute or two of booting, and with it it's been up for about half a
>> day now, under non-trivial networking load.
>>
>> I've contacted the author directly, and he asked that I mention here
>> that the patch is working for me, and ask that it be reviewed. Can
>> someone review said patch?
>>
>> I'm running 9.0-RELEASE, running two jails created following the
>> vimage/vnet howto at
>>
>> http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet#Advenced_networking_:_NAT_and_firewalling
>>
>
> Hi Christian,
>
> You may want to try this better version of the patch.
>
> Warning: it's untested, I can't test it at moment in my FreeBSD-10,
> because pf panics in several places. I believe it should apply cleanly
> to FreeBSD-9.0.
>
> Nikos



-- 
Have fun, Christian
http://linkedin.christianlavoie.net

"I won't let you fall apart."
___
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: kern/165252 patch

2012-04-24 Thread Nikos Vassiliadis

On 4/23/2012 6:33 PM, Christian Lavoie wrote:

The patch mentioned at
http://www.freebsd.org/cgi/query-pr.cgi?pr=165252&cat=kern#reply1 is
working for me -- without the patch my FreeBSD machine crashes within
a minute or two of booting, and with it it's been up for about half a
day now, under non-trivial networking load.

I've contacted the author directly, and he asked that I mention here
that the patch is working for me, and ask that it be reviewed. Can
someone review said patch?

I'm running 9.0-RELEASE, running two jails created following the
vimage/vnet howto at
http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet#Advenced_networking_:_NAT_and_firewalling



Hi Christian,

You may want to try this better version of the patch.

Warning: it's untested, I can't test it at moment in my FreeBSD-10,
because pf panics in several places. I believe it should apply cleanly
to FreeBSD-9.0.

Nikos
Index: sys/contrib/pf/net/pf.c
===
--- sys/contrib/pf/net/pf.c	(revision 234438)
+++ sys/contrib/pf/net/pf.c	(working copy)
@@ -203,6 +203,8 @@
 VNET_DEFINE(uma_zone_t,	 pf_state_key_pl);
 VNET_DEFINE(uma_zone_t,	 pf_state_item_pl);
 VNET_DEFINE(uma_zone_t,	 pf_altq_pl);
+
+#define	V_curVNET(cur)
 #else
 struct pf_state_tree	 pf_statetbl;
 
@@ -1661,7 +1663,7 @@
 pf_purge_expired_states(u_int32_t maxcheck)
 #endif
 {
-	static struct pf_state	*cur = NULL;
+	static VNET_DEFINE(struct pf_state *, cur) = NULL;
 	struct pf_state		*next;
 #ifdef __FreeBSD__
 	int			 locked = waslocked;
@@ -1671,20 +1673,20 @@
 
 	while (maxcheck--) {
 		/* wrap to start of list when we hit the end */
-		if (cur == NULL) {
+		if (V_cur == NULL) {
 #ifdef __FreeBSD__
-			cur = TAILQ_FIRST(&V_state_list);
+			V_cur = TAILQ_FIRST(&V_state_list);
 #else
-			cur = TAILQ_FIRST(&state_list);
+			V_cur = TAILQ_FIRST(&state_list);
 #endif
-			if (cur == NULL)
+			if (V_cur == NULL)
 break;	/* list empty */
 		}
 
 		/* get next state, as cur may get deleted */
-		next = TAILQ_NEXT(cur, entry_list);
+		next = TAILQ_NEXT(V_cur, entry_list);
 
-		if (cur->timeout == PFTM_UNLINKED) {
+		if (V_cur->timeout == PFTM_UNLINKED) {
 			/* free unlinked state */
 			if (! locked) {
 #ifdef __FreeBSD__
@@ -1695,10 +1697,10 @@
 #endif
 locked = 1;
 			}
-			pf_free_state(cur);
-		} else if (pf_state_expires(cur) <= time_second) {
+			pf_free_state(V_cur);
+		} else if (pf_state_expires(V_cur) <= time_second) {
 			/* unlink and free expired state */
-			pf_unlink_state(cur);
+			pf_unlink_state(V_cur);
 			if (! locked) {
 #ifdef __FreeBSD__
 if (!sx_try_upgrade(&V_pf_consistency_lock))
@@ -1708,9 +1710,9 @@
 #endif
 locked = 1;
 			}
-			pf_free_state(cur);
+			pf_free_state(V_cur);
 		}
-		cur = next;
+		V_cur = next;
 	}
 
 #ifdef __FreeBSD__
___
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


kern/165252 patch

2012-04-23 Thread Christian Lavoie
The patch mentioned at
http://www.freebsd.org/cgi/query-pr.cgi?pr=165252&cat=kern#reply1 is
working for me -- without the patch my FreeBSD machine crashes within
a minute or two of booting, and with it it's been up for about half a
day now, under non-trivial networking load.

I've contacted the author directly, and he asked that I mention here
that the patch is working for me, and ask that it be reviewed. Can
someone review said patch?

I'm running 9.0-RELEASE, running two jails created following the
vimage/vnet howto at
http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet#Advenced_networking_:_NAT_and_firewalling

-- 
Have fun, Christian
http://linkedin.christianlavoie.net

"I won't let you fall apart."
___
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"