[Libct] [PATCH] net: add a fast path for net_route_setup()

Dmitry Guryanov dguryanov at parallels.com
Tue Nov 18 03:18:29 PST 2014


On Tuesday 18 November 2014 15:09:27 Andrey Vagin wrote:
> From: Andrew Vagin <avagin at openvz.org>
> 
> If routes are not set, we don't need to get information about 
links.

Is it performance improvement only?

> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  src/route.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/route.c b/src/route.c
> index fd1a3b0..7248ddf 100644
> --- a/src/route.c
> +++ b/src/route.c
> @@ -152,6 +152,9 @@ int net_route_setup(struct container *ct)
>  	struct nl_sock *sk;
>  	struct nl_cache *cache;
> 
> +	if (list_empty(&ct->ct_net_routes))
> +		return 0;
> +
>  	if (switch_ns(ct->root_pid, &net_ns, &rst))
>  		return -1;



More information about the Libct mailing list