Subject: Re: [PATCH net-next v3] route: allow to route in a peer netns via lwt framework

From: Nicolas Dichtel <[email-masked]>
Date: Wed, 29 Jul 2015 23:17:51 +0200

Le 29/07/2015 17:20, Eric Dumazet a écrit :
> On Wed, 2015-07-29 at 15:16 +0200, Nicolas Dichtel wrote:
>> This patch takes advantage of the newly added lwtunnel framework to
>> allow the user to set routes that point to a peer netns.
>>
>> Packets are injected to the peer netns via the loopback device. It works
>> only when the output device is 'lo'.
>>
>> Example:
>> ip route add 40.1.1.1/32 encap netns nsid 5 via dev lo
>>
>> The goal is to be scalable when the number of netns is high (10k or more).
>> Which this patch, we can save two interfaces (veth) per netns, which helps
>> to to reduce memory consumption and the time needed to create a netns.
>
>
> Really this is a hack Nicolas.
>
> get_net_ns_by_id() was not meant to be used in data (fast ???) path.
>
> Same for get_net() and put_net()
>
> Plumbing like that should not happen in lo start_xmit()
Yes, I think you're right. I was a bit too enthusiasm with this new framework.
Do you think it would be acceptable if the netns was directly referenced
instead of a nsid?