Re: [PATCH net-next 0/3] vsock: support network namespace

From: Jason Wang
Date: Wed Apr 29 2020 - 05:22:03 EST



On 2020/4/29 äå12:00, Stefano Garzarella wrote:
On Tue, Apr 28, 2020 at 04:13:22PM +0800, Jason Wang wrote:
On 2020/4/27 äå10:25, Stefano Garzarella wrote:
Hi David, Michael, Stefan,
I'm restarting to work on this topic since Kata guys are interested to
have that, especially on the guest side.

While working on the v2 I had few doubts, and I'd like to have your
suggestions:

1. netns assigned to the device inside the guest

Currently I assigned this device to 'init_net'. Maybe it is better
if we allow the user to decide which netns assign to the device
or to disable this new feature to have the same behavior as before
(host reachable from any netns).
I think we can handle this in the vsock core and not in the single
transports.

The simplest way that I found, is to add a new
IOCTL_VM_SOCKETS_ASSIGN_G2H_NETNS to /dev/vsock to enable the feature
and assign the device to the same netns of the process that do the
ioctl(), but I'm not sure it is clean enough.

Maybe it is better to add new rtnetlink messages, but I'm not sure if
it is feasible since we don't have a netdev device.

What do you suggest?
As we've discussed, it should be a netdev probably in either guest or host
side. And it would be much simpler if we want do implement namespace then.
No new API is needed.

Thanks Jason!

It would be cool, but I don't have much experience on netdev.
Do you see any particular obstacles?


I don't see but if there's we can try to find a solution or ask for netdev experts for that. I do hear from somebody that is interested in having netdev in the past.



I'll take a look to understand how to do it, surely in the guest would
be very useful to have the vsock device as a netdev and maybe also in the host.


Yes, it's worth to have a try then we will have a unified management interface and we will benefit from it in the future.

Starting form guest is good idea which should be less complicated than host.

Thanks



Stefano