From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: xiaosuo@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] inetpeer: Support ipv6 addresses.
Date: Tue, 30 Nov 2010 07:11:19 +0100 [thread overview]
Message-ID: <1291097479.2725.13.camel@edumazet-laptop> (raw)
In-Reply-To: <20101129.215303.48488457.davem@davemloft.net>
Le lundi 29 novembre 2010 à 21:53 -0800, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 30 Nov 2010 06:42:16 +0100
>
> > Its a bit early in the morning here, I must confess I dont yet
> > understand your patch David :)
> >
> > As we use a tree, why not using two different trees for ipv4 / ipv6 ?
>
> The "key" just creates a natural ordering in the tree, it's
> almost arbitrary except that it must distribute well amongst
> the entries.
Hmm. AVL search must take a decision, take the left or the right path.
if current key is equal, which path do you take ?
@@ -165,9 +208,9 @@ static void unlink_from_unused(struct inet_peer *p)
> for (u = rcu_dereference_protected(peers.root, \
> lockdep_is_held(&peers.lock)); \
> u != peer_avl_empty; ) { \
> - if (_daddr == u->v4daddr) \
> + if (inet_peer_addr_equal(_daddr, &u->daddr)) \
> break; \
> - if ((__force __u32)_daddr < (__force __u32)u->v4daddr) \
> + if (key < inet_peer_key(&u->daddr)) \
> v = &u->avl_left; \
> else \
> v = &u->avl_right; \
Apparently you take the right one, you may miss the target if its on the
left path ?
>
> I currently don't see any reason to make two trees right now.
>
Cost of a tree is one pointer, and ipv4 search would be faster if we use
different search functions.
> > I dont understand how computing a 32bit key (sort of hash key) is going
> > to help when hash collision happens, with an avl tree.
> > Either version of tree (AVL/rbtree) will be expensive to use if depth is
> > big (With 2 millions entries, depth is going to be very big). I
> > understand you want to get rid of route cache ?
>
> Do we plan to talk to 2 million unique destinations and have active
> non-default metrics for each one of them very often?
>
> inet_peer entries will only get created when we need to make
> non-default metric settings for a specific destination address.
>
> See that's the thing, it's scope is so much smaller than the existing
> routing cache. It's only going to be used in limited if not
> controlled cases.
>
OK good :)
I have no idea how many addresses have non default metric settings.
Do you know how to make an estimation on a server ?
next prev parent reply other threads:[~2010-11-30 6:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 21:44 [PATCH 1/3] inetpeer: Support ipv6 addresses David Miller
2010-11-29 22:33 ` Stephen Hemminger
2010-11-30 3:18 ` David Miller
2010-11-30 2:11 ` Brian Haley
2010-11-30 3:18 ` David Miller
2010-11-30 2:33 ` Changli Gao
2010-11-30 3:14 ` David Miller
2010-11-30 4:51 ` Changli Gao
2010-11-30 5:22 ` David Miller
2010-11-30 5:42 ` Eric Dumazet
2010-11-30 5:53 ` David Miller
2010-11-30 6:11 ` Eric Dumazet [this message]
2010-11-30 6:31 ` 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=1291097479.2725.13.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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