netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Octavian Purdila <opurdila@ixiacom.com>
Cc: netdev@vger.kernel.org,
	Lucian Adrian Grijincu <lucian.grijincu@gmail.com>,
	Vlad Dogaru <ddvlad@rosedu.org>
Subject: Re: [PATCH] iproute2: add dynamic index and name hashes
Date: Fri, 10 Dec 2010 08:20:40 -0800	[thread overview]
Message-ID: <20101210082040.230a2832@nehalam> (raw)
In-Reply-To: <1291993164-8793-1-git-send-email-opurdila@ixiacom.com>

On Fri, 10 Dec 2010 16:59:24 +0200
Octavian Purdila <opurdila@ixiacom.com> wrote:

> The hashes sizes start with 16 entries and grow up to 2^20
> entries. The hashes double when the entries in the LL map is greater
> then the hash size.
> 
> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
> ---
>  lib/ll_map.c |  125 +++++++++++++++++++++++++++++++++++++++++++++++----------
>  1 files changed, 103 insertions(+), 22 deletions(-)
> 
> diff --git a/lib/ll_map.c b/lib/ll_map.c
> index b8b49aa..9831322 100644
> --- a/lib/ll_map.c
> +++ b/lib/ll_map.c
> @@ -26,7 +26,8 @@ extern unsigned int if_nametoindex (const char *);
>  
>  struct idxmap
>  {
> -	struct idxmap * next;
> +	struct idxmap *idx_next;
> +	struct idxmap *name_next;
>  	unsigned	index;
>  	int		type;
>  	int		alen;
> @@ -35,31 +36,100 @@ struct idxmap
>  	char		name[16];
>  };
>  
> -static struct idxmap *idxmap[16];

This is user space, and memory space is realtively cheap. Why not just
make initial idxmap much bigger and be done with it.


-- 

  parent reply	other threads:[~2010-12-10 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10 14:59 [PATCH] iproute2: add dynamic index and name hashes Octavian Purdila
2010-12-10 16:09 ` Daniel Baluta
2010-12-10 16:20 ` Stephen Hemminger [this message]
2010-12-10 17:35   ` Octavian Purdila

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=20101210082040.230a2832@nehalam \
    --to=shemminger@vyatta.com \
    --cc=ddvlad@rosedu.org \
    --cc=lucian.grijincu@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=opurdila@ixiacom.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;
as well as URLs for NNTP newsgroup(s).