After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756963 - support creation of VXLANs in NetworkManager [bg/device-creation-vxlan-bgo756963]
support creation of VXLANs in NetworkManager [bg/device-creation-vxlan-bgo756...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-review 749369
 
 
Reported: 2015-10-22 12:40 UTC by Beniamino Galvani
Modified: 2015-12-09 15:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Beniamino Galvani 2015-10-22 12:40:25 UTC
This is a sub-task of bug 749369 specific for VXLANs. The goal is to add to NM support for defining VXLANs connections and have NM automatically create and configure the needed software devices.
Comment 1 Beniamino Galvani 2015-10-22 12:43:37 UTC
Pushed branch bg/device-creation-vxlan-bgo756963, please review.
Comment 2 Lubomir Rintel 2015-10-26 14:19:49 UTC
Looks all good to me.

However, iproute2 seems to support more properties; I'm wondering why you don't:
remote, dstport, srcport, maxaddress and gbp.
Comment 3 Beniamino Galvani 2015-10-26 15:33:31 UTC
(In reply to Lubomir Rintel from comment #2)
> Looks all good to me.
>
> However, iproute2 seems to support more properties; I'm wondering why you
> don't:
> remote,

iproute2 offers two distinct options to set 'group' and 'remote' but
from a netlink/kernel point of view there is a single attribute
'group' that contains one or the other. So I think it makes sense to
have only one property ('vxlan.group') which specifies the multicast
group or the unicast remote address.

> dstport, srcport, maxaddress and gbp.

The iproute2 version I was using didn't have dstport, maxaddresses
and gbp. They seem useful, I will add them.
Comment 4 Thomas Haller 2015-11-03 14:56:36 UTC
>> libnm: add NMSettingVxlan
    

I thought that the name "remote" makes more sense the "group" (given that we combine them).


+         g_set_error_literal (error,
+                      NM_CONNECTION_ERROR,
+                      NM_C

whitespace




Is the parent property redundant to master? Maybe then the vxlan setting should not have it's own parent property, but reuse master.

This question will also pop up for gre again, maybe others. I think the parent should be consolidated with the master property there.

Do you intend the vxlan setting to be a slave-type? Then you'd also have to extend _nm_setting_slave_type_is_valid() and _nm_connection_detect_slave_type().


>> ifcfg-rh: add VXLAN support

Regarding ifcfg-rh support... I commented on the tun branch that it was missing there. I merely asked whether we really should add it. I think adding ifcfg-rh support *only* makes sense if initscripts also support such a connection type. Do initscripts support vxlan tunnels (Beyond placing a plain `ip link add` command there).
Otherwise, it seems that keyfile is preferable in every way.



>> platform: add vxlan support

+NMPlatformError nm_platform_vxlan_add (NMPlatform *self, const char *name, NMPlatformLnkVxlan *props, NMPlatformLink *out_link);
+

all our other platform-add commands accept the arguments individually instead of accepting a NMPlatform* struct. Eg. nm_platform_ip4_route_add().

Hm, ok.



>> device/vxlan: support device creation


inet_ntop (AF_INET6, &priv->props.group6, str, sizeof (str)

nm_utils_inet6_ntop()?



When I compare vxlan's update_connection() to the vlan implementation, they behave different. The vlan implementation looks up the platform settings and updates priv->props. The vxlan implementation misses that step. Seems one of them needs fixing.




Regarding the NMDeviceVxlan implementation for libnm-glib, I think again that it would be better just to create an shallow generic device for it to preserve backward behavior.
Comment 5 Beniamino Galvani 2015-11-26 14:53:39 UTC
(In reply to Thomas Haller from comment #4)
> >> libnm: add NMSettingVxlan
> I thought that the name "remote" makes more sense the "group" (given that we
> combine them).

Fixed. But note that NMDeviceVxlan is still exporting via D-Bus
".Group", we can't change the D-Bus API. Other properties that differ
are:

NMSettingVxlan:                         NMDeviceVxlan:
vxlan.remote                           .Group
vxlan.source-port-min                  .SrcPortMin
vxlan.source-port-max                  .SrcPortMax
vxlan.destination-port                 .DstPort

> Is the parent property redundant to master? Maybe then the vxlan setting
> should not have it's own parent property, but reuse master.

> Do you intend the vxlan setting to be a slave-type? Then you'd also have to
> extend _nm_setting_slave_type_is_valid() and
> _nm_connection_detect_slave_type().

This is only for specifying a link parent device. There is no explicit
support for master-slave relationships at the moment (is it needed)?

> >> ifcfg-rh: add VXLAN support
>
> Regarding ifcfg-rh support... I commented on the tun branch that it was
> missing there. I merely asked whether we really should add it. I think
> adding ifcfg-rh support *only* makes sense if initscripts also support such
> a connection type. Do initscripts support vxlan tunnels (Beyond placing a
> plain `ip link add` command there).
> Otherwise, it seems that keyfile is preferable in every way.

Ok, dropped ifcfg-rh support.

> all our other platform-add commands accept the arguments individually
> instead of accepting a NMPlatform* struct. Eg. nm_platform_ip4_route_add().
>
> Hm, ok.

Vxlans have a lot of parameters, IMO it makes sense to use a struct to
pass them.

> When I compare vxlan's update_connection() to the vlan implementation, they
> behave different. The vlan implementation looks up the platform settings and
> updates priv->props. The vxlan implementation misses that step. Seems one of
> them needs fixing.

Now vxlan implementation updates platform settings too.

> Regarding the NMDeviceVxlan implementation for libnm-glib, I think again
> that it would be better just to create an shallow generic device for it to
> preserve backward behavior.

Makes sense. Repushed branch bg/device-creation-vxlan-bgo756963.
Comment 6 Beniamino Galvani 2015-12-03 10:52:37 UTC
Rebased on master.
Comment 7 Thomas Haller 2015-12-03 11:23:37 UTC
nmtstp_link_vxlan_add() must wait until platform sees the changes.

see nmtstp_link_gre_add():
  nmtstp_assert_wait_for_link (name, NM_LINK_TYPE_GRE, 100);


- inet_pton (AF_INET, "23.1.2.164", &lnk_vxlan.local);
+ lnk_vxlan.local = nmtst_inet4_from_string ("23.1.2.164");



>> libnm-glib: consider unknown devices as generic ones
    
          g_warning ("Unknown device type %d", dtype);
-         return G_TYPE_INVALID;
+         return NM_TYPE_DEVICE_GENERIC;


maybe even drop the warning? (or make it g_debug() only).

It's well understood that there are device-types that libnm-glib doesn't understand. Printing a message to stdout doesn't help much.




Rest LGTM
Comment 8 Beniamino Galvani 2015-12-09 15:12:14 UTC
(In reply to Thomas Haller from comment #7)

Fixed, thanks.