* [pve-devel] [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change
@ 2023-04-20 21:37 Alexandre Derumier
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 1/2] patch : vlan: fix vlan-protocol query check Alexandre Derumier
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Alexandre Derumier @ 2023-04-20 21:37 UTC (permalink / raw)
To: pve-devel
This patch series fix the reload of vlan interface,
when attribute change like vlan-protocol (only use for qinq currently).
Like vxlan, we need to ifdown/ifup the interface on reload.
Alexandre Derumier (2):
patch : vlan: fix vlan-protocol query check
patch: add vlan interface ifdown/ifup when changes on reload, like for
vxlan
...-vxlan-interfaces-when-ifreload_down.patch | 11 ++-
debian/patches/series | 3 +-
...-check-vlan-protocol-for-not-dotted-.patch | 88 +++++++++++++++++++
3 files changed, 97 insertions(+), 5 deletions(-)
create mode 100644 debian/patches/upstream/0001-vlan-query_check-check-vlan-protocol-for-not-dotted-.patch
--
2.30.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH ifupdown2 1/2] patch : vlan: fix vlan-protocol query check
2023-04-20 21:37 [pve-devel] [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change Alexandre Derumier
@ 2023-04-20 21:37 ` Alexandre Derumier
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 2/2] patch: add vlan interface ifdown/ifup when changes on reload, like for vxlan Alexandre Derumier
2023-04-22 7:01 ` [pve-devel] applied: Re: [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change Thomas Lamprecht
2 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2023-04-20 21:37 UTC (permalink / raw)
To: pve-devel
upstream:
https://github.com/CumulusNetworks/ifupdown2/pull/258
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
debian/patches/series | 3 +-
...-check-vlan-protocol-for-not-dotted-.patch | 88 +++++++++++++++++++
2 files changed, 90 insertions(+), 1 deletion(-)
create mode 100644 debian/patches/upstream/0001-vlan-query_check-check-vlan-protocol-for-not-dotted-.patch
diff --git a/debian/patches/series b/debian/patches/series
index ccfd03d..a7c8da8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,4 +12,5 @@ pve/0011-d-rules-drop-now-default-with-systemd.patch
pve/0012-d-rules-add-dh_installsystemd-override-for-compat-12.patch
pve/0013-postinst-reload-network-config-on-first-install.patch
pve/0014-fix-pointopoint-regression.patch
-upstream/0001-ovs-add-support-for-fakebridge.patch
\ No newline at end of file
+upstream/0001-ovs-add-support-for-fakebridge.patch
+upstream/0001-vlan-query_check-check-vlan-protocol-for-not-dotted-.patch
\ No newline at end of file
diff --git a/debian/patches/upstream/0001-vlan-query_check-check-vlan-protocol-for-not-dotted-.patch b/debian/patches/upstream/0001-vlan-query_check-check-vlan-protocol-for-not-dotted-.patch
new file mode 100644
index 0000000..402c5e2
--- /dev/null
+++ b/debian/patches/upstream/0001-vlan-query_check-check-vlan-protocol-for-not-dotted-.patch
@@ -0,0 +1,88 @@
+From e50a7ccadb460bf923d841d620080f351fd74d9d Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier@odiso.com>
+Date: Thu, 20 Apr 2023 11:48:11 +0200
+Subject: [PATCH] vlan: query_check: check vlan-protocol for not dotted
+ interface
+
+---
+ ifupdown2/addons/vlan.py | 44 +++++++++++++++++++++-------------------
+ 1 file changed, 23 insertions(+), 21 deletions(-)
+
+diff --git a/ifupdown2/addons/vlan.py b/ifupdown2/addons/vlan.py
+index 584fe6e..3b045dc 100644
+--- a/ifupdown2/addons/vlan.py
++++ b/ifupdown2/addons/vlan.py
+@@ -224,10 +224,13 @@ class vlan(Addon, moduleBase):
+ def _query_check(self, ifaceobj, ifaceobjcurr):
+ if not self.cache.link_exists(ifaceobj.name):
+ return
++
++ ifname = ifaceobj.name
++ cached_vlan_info_data = self.cache.get_link_info_data(ifname)
++
+ if '.' not in ifaceobj.name:
+ # if vlan name is not in the dot format, check its running state
+
+- ifname = ifaceobj.name
+ cached_vlan_raw_device = self.cache.get_lower_device_ifname(ifname)
+
+ #
+@@ -239,8 +242,6 @@ class vlan(Addon, moduleBase):
+ cached_vlan_raw_device != ifaceobj.get_attr_value_first('vlan-raw-device')
+ )
+
+- cached_vlan_info_data = self.cache.get_link_info_data(ifname)
+-
+ #
+ # vlan-id
+ #
+@@ -252,27 +253,28 @@ class vlan(Addon, moduleBase):
+ cached_vlan_id_str = str(cached_vlan_id)
+ ifaceobjcurr.update_config_with_status('vlan-id', cached_vlan_id_str, vlanid_config != cached_vlan_id_str)
+
+- #
+- # vlan-protocol
+- #
+- protocol_config = ifaceobj.get_attr_value_first('vlan-protocol')
+- if protocol_config:
++ #
++ # vlan-protocol (dot or not dot format)
++ #
++ protocol_config = ifaceobj.get_attr_value_first('vlan-protocol')
++ if protocol_config:
+
+- cached_vlan_protocol = cached_vlan_info_data.get(Link.IFLA_VLAN_PROTOCOL)
++ cached_vlan_protocol = cached_vlan_info_data.get(Link.IFLA_VLAN_PROTOCOL)
+
+- if protocol_config.upper() != cached_vlan_protocol.upper():
+- ifaceobjcurr.update_config_with_status(
+- 'vlan-protocol',
+- cached_vlan_protocol,
+- 1
+- )
+- else:
+- ifaceobjcurr.update_config_with_status(
+- 'vlan-protocol',
+- protocol_config,
+- 0
+- )
++ if protocol_config.upper() != cached_vlan_protocol.upper():
++ ifaceobjcurr.update_config_with_status(
++ 'vlan-protocol',
++ cached_vlan_protocol,
++ 1
++ )
++ else:
++ ifaceobjcurr.update_config_with_status(
++ 'vlan-protocol',
++ protocol_config,
++ 0
++ )
+
++ if '.' not in ifaceobj.name:
+ #
+ # vlan-bridge-binding
+ #
+--
+2.30.2
+
--
2.30.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH ifupdown2 2/2] patch: add vlan interface ifdown/ifup when changes on reload, like for vxlan
2023-04-20 21:37 [pve-devel] [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change Alexandre Derumier
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 1/2] patch : vlan: fix vlan-protocol query check Alexandre Derumier
@ 2023-04-20 21:37 ` Alexandre Derumier
2023-04-22 7:03 ` Thomas Lamprecht
2023-04-22 7:01 ` [pve-devel] applied: Re: [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change Thomas Lamprecht
2 siblings, 1 reply; 5+ messages in thread
From: Alexandre Derumier @ 2023-04-20 21:37 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
...-down-up-vxlan-interfaces-when-ifreload_down.patch | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch b/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
index c9964af..63494c9 100644
--- a/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
+++ b/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
@@ -1,13 +1,16 @@
From 2c38d0a157c8946f35a7da1c7c05484d33e6986f Mon Sep 17 00:00:00 2001
From: Alexandre Derumier <aderumier@odiso.com>
Date: Wed, 5 Jun 2019 14:47:05 +0200
-Subject: [PATCH 6/7] ifreload: down/up vxlan interfaces when
+Subject: [PATCH 6/7] ifreload: down/up vxlan && vlan interfaces when
ifreload_down_changed=0
almost all attributes of vxlan interfaces can't be updated
-in current kernel (<= 5.2). (including vxlan-id)
+(including vxlan-id).
-so when ifreload_down_changed=0, ifreload can't update vxlan.
+Same for vlan interfaces (vlan-protocol, vlan-id)
+
+so when ifreload_down_changed=0, ifreload can't update vxlan or vlan
+ attributes.
fix: https://github.com/CumulusNetworks/ifupdown2/issues/50
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
@@ -25,7 +28,7 @@ index b4e1864..9313573 100644
ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind)))
ifacedownlist.append(newifaceobjlist[objidx].name)
- if not down_changed:
-+ if not down_changed and ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) != 'vxlan':
++ if not down_changed and ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) != 'vxlan' and ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) != 'vlan':
continue
if len(newifaceobjlist) != len(lastifaceobjlist):
ifacedownlist.append(ifname)
--
2.30.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] applied: Re: [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change
2023-04-20 21:37 [pve-devel] [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change Alexandre Derumier
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 1/2] patch : vlan: fix vlan-protocol query check Alexandre Derumier
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 2/2] patch: add vlan interface ifdown/ifup when changes on reload, like for vxlan Alexandre Derumier
@ 2023-04-22 7:01 ` Thomas Lamprecht
2 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2023-04-22 7:01 UTC (permalink / raw)
To: Proxmox VE development discussion, Alexandre Derumier
On 20/04/2023 23:37, Alexandre Derumier wrote:
> This patch series fix the reload of vlan interface,
> when attribute change like vlan-protocol (only use for qinq currently).
>
> Like vxlan, we need to ifdown/ifup the interface on reload.
>
> Alexandre Derumier (2):
> patch : vlan: fix vlan-protocol query check
> patch: add vlan interface ifdown/ifup when changes on reload, like for
> vxlan
>
> ...-vxlan-interfaces-when-ifreload_down.patch | 11 ++-
> debian/patches/series | 3 +-
> ...-check-vlan-protocol-for-not-dotted-.patch | 88 +++++++++++++++++++
> 3 files changed, 97 insertions(+), 5 deletions(-)
> create mode 100644 debian/patches/upstream/0001-vlan-query_check-check-vlan-protocol-for-not-dotted-.patch
>
applied series, thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH ifupdown2 2/2] patch: add vlan interface ifdown/ifup when changes on reload, like for vxlan
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 2/2] patch: add vlan interface ifdown/ifup when changes on reload, like for vxlan Alexandre Derumier
@ 2023-04-22 7:03 ` Thomas Lamprecht
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2023-04-22 7:03 UTC (permalink / raw)
To: Proxmox VE development discussion, Alexandre Derumier
On 20/04/2023 23:37, Alexandre Derumier wrote:
> Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
> ---
> ...-down-up-vxlan-interfaces-when-ifreload_down.patch | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch b/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
> index c9964af..63494c9 100644
> --- a/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
> +++ b/debian/patches/pve/0005-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
> @@ -1,13 +1,16 @@
> From 2c38d0a157c8946f35a7da1c7c05484d33e6986f Mon Sep 17 00:00:00 2001
> From: Alexandre Derumier <aderumier@odiso.com>
> Date: Wed, 5 Jun 2019 14:47:05 +0200
> -Subject: [PATCH 6/7] ifreload: down/up vxlan interfaces when
> +Subject: [PATCH 6/7] ifreload: down/up vxlan && vlan interfaces when
> ifreload_down_changed=0
>
> almost all attributes of vxlan interfaces can't be updated
> -in current kernel (<= 5.2). (including vxlan-id)
> +(including vxlan-id).
>
> -so when ifreload_down_changed=0, ifreload can't update vxlan.
> +Same for vlan interfaces (vlan-protocol, vlan-id)
> +
> +so when ifreload_down_changed=0, ifreload can't update vxlan or vlan
> + attributes.
>
> fix: https://github.com/CumulusNetworks/ifupdown2/issues/50
> Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
> @@ -25,7 +28,7 @@ index b4e1864..9313573 100644
> ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind)))
> ifacedownlist.append(newifaceobjlist[objidx].name)
> - if not down_changed:
> -+ if not down_changed and ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) != 'vxlan':
> ++ if not down_changed and ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) != 'vxlan' and ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) != 'vlan':
style nit: could be slightly nicer if we pull out the link_kind
into an intermediate variable, i.e., something like:
link_kind = ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind)
if not down_changed and link_kind != 'vxlan' and link_kind != 'vlan':
> continue
> if len(newifaceobjlist) != len(lastifaceobjlist):
> ifacedownlist.append(ifname)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-04-22 7:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-20 21:37 [pve-devel] [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change Alexandre Derumier
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 1/2] patch : vlan: fix vlan-protocol query check Alexandre Derumier
2023-04-20 21:37 ` [pve-devel] [PATCH ifupdown2 2/2] patch: add vlan interface ifdown/ifup when changes on reload, like for vxlan Alexandre Derumier
2023-04-22 7:03 ` Thomas Lamprecht
2023-04-22 7:01 ` [pve-devel] applied: Re: [PATCH ifupdown2 0/2] fix #4683 : fix reload of vlan interfaces when attribute change Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox