Re: [PATCH bluetooth-next 3/3] ieee802154: allow netns create of lowpan interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 05/12/2016 09:28 AM, Nicolas Dichtel wrote:
> Le 12/05/2016 01:34, Alexander Aring a écrit :
> [snip]
>> But I don't know how it works when the $PHY isn't visible inside the
>> namespace where the interface should be changed to. But wireless should
>> have the same behaviour then, that the macvlan/veth/etc. the corresponding
>> wireless phy isn't visible in the namespace. Seems there exists some
>> "parent" device inside one namespace and macvlan/veth can be moved to
>> other namespaces, but I am not an expert into that. :-)
> Yes, the virtual interface (macvlan/veth,ip tunnels, vxlan, etc.) is created in
> the namespace of the physical netns. After, the virtual interface is moved to
> another netns (with 'ip link set foo netns bar'). This is called x-netns: the
> upper par of the interface and the link part are not in the same netns.
> With 'ip -d link' it's possible to show the link netns. There is an nsid which
> identified the link netns. The nsid is valid only in the current netns (ie the
> same netns can have another nsid in another netns).
> Usually, there are explicit boundary in the code when crossing netns (see
> skb_scrub_packet for example).
> 
> Example with a gre interface:
> 
> # create a gre interface in netns1
> ip netns exec netns1 ip link add dev tun1 type gre local 10.0.0.1 \
>      remote 10.0.0.2
> # move it in netns2: the link netns is still in netns1
> ip netns exec netns1 ip link set tun1 netns netns2
> 
> or (completely equivalent):
> 
> # assign a nsid to netns1 in netns2
> ip exec netns2 ip netns set netns1 1234
> # create a gre interface in netns2 with its link netns in netns1
> ip exec netns2 ip link add tun1 link-netnsid 1234 type gre local 10.0.0.1 \
>      remote 10.0.0.2

Thanks for the explanation.

The current patch series put the whole phy and all the interfaces into
one net namespace (like in wireless). The lowpan interface can also be
created in non init_net then.

So far I know it's not possible to move wpan or lowpan interfaces after
creation e.g. running "ip link set #IF netns $NETNS_NAME" and we need to
support such behaviour in future.

The current use-case is just for the fakelb driver (like hwsim in
wireless) which doesn't do any optimization in IPv6 stack if two
interfaces belongs to the same net namespace.

- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux