From: Patrick McHardy <kaber@trash.net>
To: hadi@cyberus.ca
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [XFRM] Optimize SA dumping
Date: Mon, 04 Dec 2006 14:39:40 +0100 [thread overview]
Message-ID: <4574251C.8000906@trash.net> (raw)
In-Reply-To: <1165238866.3664.43.camel@localhost>
jamal wrote:
> On Mon, 2006-04-12 at 13:36 +0100, Patrick McHardy wrote:
>
>>jamal wrote:
>>
>>> for (i = 0; i <= xfrm_state_hmask; i++) {
>>> hlist_for_each_entry(x, entry, xfrm_state_bydst+i, bydst) {
>>>+ if (count && send_x != last_x) {
>>>+ err = func(send_x, count, data);
>>>+ if (err)
>>>+ goto out;
>>>+ send_x = NULL;
>>>+ }
>>> if (!xfrm_id_proto_match(x->id.proto, proto))
>>> continue;
>>
>>After you sent send_x and set it to NULL, it will be different from
>>last_x (since that is != NULL) and the NULL pointer will be given
>>to func() when continuing here.
>>
>
>
> This one you lost me. Can you give me an example? one or two SAs found?
More than three SAs, so we have:
send_x = last_x = NULL
1. iteration:
send_x = last_x = first policy
2. iteration:
send_x = first policy
last_x = second policy
3. iteration:
dump send_x, set send_x = NULL
continue at continue statement
4. iteration:
We have send_x = NULL and last_x != NULL, so send_x != last_x,
leading to dump(NULL, ...)
> In any case, if i go the done callback approach, I can get rid of all
> this tracking thing ...
I need to read your other mail first before commenting on this :)
next prev parent reply other threads:[~2006-12-04 13:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-03 16:33 [XFRM] Optimize SA dumping jamal
2006-12-04 12:36 ` Patrick McHardy
2006-12-04 13:27 ` jamal
2006-12-04 13:39 ` Patrick McHardy [this message]
2006-12-04 13:55 ` jamal
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=4574251C.8000906@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.