netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Maxime Bizon <mbizon@freebox.fr>
Cc: David Miller <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 2/3] xfrm: Increase the garbage collector threshold
Date: Mon, 16 Dec 2013 12:51:45 +0100	[thread overview]
Message-ID: <20131216115145.GH31491@secunet.com> (raw)
In-Reply-To: <1386951209.25449.61.camel@sakura.staff.proxad.net>

On Fri, Dec 13, 2013 at 05:13:29PM +0100, Maxime Bizon wrote:
> 
> On Fri, 2013-12-13 at 11:12 +0100, Steffen Klassert wrote:
> 
> > Can you please be a bit more precise with your problem description?
> 
> yes sorry I wasn't clear.
> 
> I have a problem with an even simpler workload that the one using apache
> bench in the original bug report.
> 
> I am using ipsec transport mode between two hosts and just run this on
> one side:
> 
>   while :; do wget -O /dev/null http://remote_host/; done
> 
> I was surprised to see it fails after only 1024 requests (ENOBUF on
> connect), and how long I had to wait to be able to do new requests.
> 
> After debugging I saw that the xfrm gc was called but was not able to
> release anything.
> 
> after running "ip route flush cache", which forces all ipv4 dst entries
> to be released, suddenly the xfrm gc had something to free, and xfrm
> entry count went to zero.

Well, "ip route flush cache" bumps the rt_genid what marks all
routes as invalid. The xfrm garbage collector will notice this
on the next run and deletes all invalid cached routes.

Garbage collecting is different from flushing, it only removes
stale routes and keeps everything that was used recently. That's
the whole point of this caching, we cache recently used IPsec
routes to avoid a slow path lookup.

> 
> So if it is correct that once a ipv4 dst entry exists, the xfrm entry
> cannot be gc-ed, then we need to make sure we allow more xfrm entries to
> be allocated than ipv4 dst.

No, we don't cache plain ipv4 routes, we cache only IPsec routes.
The original ipv4 dst_entry is cached together with the xfrm dst_entry
as a xfrm bundle at the IPsec flow cache, so it does not make sense to
ensure something like that.

  reply	other threads:[~2013-12-16 11:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01  8:21 pull request (net): ipsec 2013-11-01 Steffen Klassert
2013-11-01  8:21 ` [PATCH 1/3] xfrm: prevent ipcomp scratch buffer race condition Steffen Klassert
2013-11-01  8:21 ` [PATCH 2/3] xfrm: Increase the garbage collector threshold Steffen Klassert
2013-12-10 14:38   ` Maxime Bizon
2013-12-13 10:12     ` Steffen Klassert
2013-12-13 16:13       ` Maxime Bizon
2013-12-16 11:51         ` Steffen Klassert [this message]
2013-12-16 14:29           ` Maxime Bizon
2013-11-01  8:21 ` [PATCH 3/3] xfrm: Fix null pointer dereference when decoding sessions Steffen Klassert
2013-11-24 14:27   ` Matthias Schiffer
2013-12-01  4:19     ` Matthias Schiffer
2013-12-02  1:35       ` David Miller
2013-12-03  9:56         ` Steffen Klassert
2013-12-03 10:37           ` Wolfgang Walter
2013-12-03 10:41             ` Hannes Frederic Sowa
2013-12-05 21:35           ` David Miller
2013-11-02  5:22 ` pull request (net): ipsec 2013-11-01 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131216115145.GH31491@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=mbizon@freebox.fr \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).