[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1341553282.3265.49.camel@edumazet-glaptop>
Date: Fri, 06 Jul 2012 07:41:22 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] ipv4: Avoid overhead when no custom FIB rules are
installed.
On Thu, 2012-07-05 at 22:31 -0700, David Miller wrote:
> If the user hasn't actually installed any custom rules, or fiddled
> with the default ones, don't go through the whole FIB rules layer.
>
> It's just pure overhead.
>
> Instead do what we do with CONFIG_IP_MULTIPLE_TABLES disabled, check
> the individual tables by hand, one by one.
>
> Also, move fib_num_tclassid_users into the ipv4 network namespace.
>
> Signed-off-by: David S. Miller <davem@...emloft.net>
> +static inline int fib_lookup(struct net *net, struct flowi4 *flp,
> + struct fib_result *res)
> +{
> + if (!net->ipv4.fib_has_custom_rules) {
> + if (net->ipv4.fib_local &&
> + !fib_table_lookup(net->ipv4.fib_local, flp, res,
> + FIB_LOOKUP_NOREF))
> + return 0;
> + if (net->ipv4.fib_main &&
> + !fib_table_lookup(net->ipv4.fib_main, flp, res,
> + FIB_LOOKUP_NOREF))
> + return 0;
> + if (net->ipv4.fib_default &&
> + !fib_table_lookup(net->ipv4.fib_default, flp, res,
> + FIB_LOOKUP_NOREF))
> + return 0;
> + return -ENETUNREACH;
> + }
> + return __fib_lookup(net, flp, res);
> +}
> +
Hmm, this seems quite big to be inlined ?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists