Patchwork Fwd: Memory exhaust issue with only IPsec policies configured on continuous traffic

login
register
mail settings
Submitter Eric Dumazet
Date May 10, 2012, 5:32 a.m.
Message ID <1336627923.12504.128.camel@edumazet-glaptop>
Download mbox | patch
Permalink /patch/158181/
State RFC
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - May 10, 2012, 5:32 a.m.
On Thu, 2012-05-10 at 07:27 +0200, Eric Dumazet wrote:

> Yep, we can use DST_NOCACHE
> 

Please try following patch :



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nikhil Agarwal - May 10, 2012, 9:42 a.m.
If i disable this cache of DST, dst are working fine. But now XFRM
state is allocated for every incoming packet and then freed. But while
freeing the xfrm state same garbage collection logic is there. Now
since packets are coming continuously garbage collector may not get
scheduled and large amount of memory is stuck to be freed causing the
system to go into non-recoverable state.

It seems that ther should be some change garbage collection scheduling
logic or  some mechnism to decide wether to cache some entry or not.

On Thu, May 10, 2012 at 11:02 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2012-05-10 at 07:27 +0200, Eric Dumazet wrote:
>
>> Yep, we can use DST_NOCACHE
>>
>
> Please try following patch :
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 5773f5d..172c251 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2896,6 +2896,7 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
>        if (rt) {
>                struct dst_entry *new = &rt->dst;
>
> +               new->flags |= DST_NOCACHE;
>                new->__use = 1;
>                new->input = dst_discard;
>                new->output = dst_discard;
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 5773f5d..172c251 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2896,6 +2896,7 @@  struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
 	if (rt) {
 		struct dst_entry *new = &rt->dst;
 
+		new->flags |= DST_NOCACHE;
 		new->__use = 1;
 		new->input = dst_discard;
 		new->output = dst_discard;