Skip to content

Commit f97bce7

Browse files
committed
to be squashed
1 parent be9946a commit f97bce7

File tree

1 file changed

+63
-6
lines changed

1 file changed

+63
-6
lines changed
Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,68 @@
1-
From a0b31fc93cb0ac37dbe5085adb6c86a9c9f7284c Mon Sep 17 00:00:00 2001
1+
From b617a40fd4542f273ca2f59bcd93f9c4cdc9e2bf Mon Sep 17 00:00:00 2001
22
From: Marcin Zyla <marcin.zyla@vprocess.pl>
33
Date: Wed, 17 Sep 2025 13:00:28 +0200
44
Subject: [PATCH] fix: don't rename nodes of tunnel interfaces
55

66
---
7-
src/vnet/interface.c | 10 +++++++---
8-
1 file changed, 7 insertions(+), 3 deletions(-)
7+
src/plugins/gre/gre.c | 1 +
8+
src/plugins/vxlan/vxlan.c | 1 +
9+
src/vnet/interface.c | 19 +++++++++++++------
10+
src/vnet/interface.h | 3 +++
11+
4 files changed, 18 insertions(+), 6 deletions(-)
912

13+
diff --git a/src/plugins/gre/gre.c b/src/plugins/gre/gre.c
14+
index fee81c2b4..60dde73d7 100644
15+
--- a/src/plugins/gre/gre.c
16+
+++ b/src/plugins/gre/gre.c
17+
@@ -763,6 +763,7 @@ VNET_DEVICE_CLASS (gre_device_class) = {
18+
.format_tx_trace = format_gre_tx_trace,
19+
.admin_up_down_function = gre_interface_admin_up_down,
20+
.ip_tun_desc = gre_tunnel_desc,
21+
+ .is_tunnel = 1,
22+
#ifdef SOON
23+
.clear counter = 0;
24+
#endif
25+
diff --git a/src/plugins/vxlan/vxlan.c b/src/plugins/vxlan/vxlan.c
26+
index f1ab7a7cb..5c59cb728 100644
27+
--- a/src/plugins/vxlan/vxlan.c
28+
+++ b/src/plugins/vxlan/vxlan.c
29+
@@ -134,6 +134,7 @@ VNET_DEVICE_CLASS (vxlan_device_class, static) = {
30+
.format_device_name = format_vxlan_name,
31+
.format_tx_trace = format_vxlan_encap_trace,
32+
.admin_up_down_function = vxlan_interface_admin_up_down,
33+
+ .is_tunnel = 1,
34+
};
35+
/* *INDENT-ON* */
36+
1037
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
11-
index db47d42c8..c4a852895 100644
38+
index db47d42c8..44f23ff9a 100644
1239
--- a/src/vnet/interface.c
1340
+++ b/src/vnet/interface.c
14-
@@ -1577,9 +1577,13 @@ vnet_rename_interface (vnet_main_t * vnm, u32 hw_if_index, char *new_name)
41+
@@ -1149,9 +1149,9 @@ vnet_delete_hw_interface (vnet_main_t * vnm, u32 hw_if_index)
42+
}
43+
44+
vlib_node_rename (vm, hw->output_node_index,
45+
- "interface-%d-output-deleted", hw_if_index);
46+
- vlib_node_rename (vm, hw->tx_node_index, "interface-%d-tx-deleted",
47+
- hw_if_index);
48+
+ "interface-%d-%d-output-deleted", hw_if_index, hw->output_node_index);
49+
+ vlib_node_rename (vm, hw->tx_node_index, "interface-%d-%d-tx-deleted",
50+
+ hw_if_index, hw->tx_node_index);
51+
vlib_unregister_errors (vm, hw->output_node_index);
52+
vlib_unregister_errors (vm, hw->tx_node_index);
53+
vec_add2 (im->deleted_hw_interface_nodes, dn, 1);
54+
@@ -1577,9 +1577,16 @@ vnet_rename_interface (vnet_main_t * vnm, u32 hw_if_index, char *new_name)
1555
hash_unset_mem (im->hw_interface_by_name, old_name);
1656
hash_set_mem (im->hw_interface_by_name, hw->name, hw_if_index);
1757

1858
- /* rename tx/output nodes */
1959
- vlib_node_rename (vm, hw->tx_node_index, "%v-tx", hw->name);
2060
- vlib_node_rename (vm, hw->output_node_index, "%v-output", hw->name);
61+
+ vnet_device_class_t *dev_class =
62+
+ vnet_get_device_class (vnm, hw->dev_class_index);
63+
+
2164
+ /* only rename nodes of non-tunnel ifaces */
22-
+ if (hw->dev_class_index != vxlan_device_class.index && hw->dev_class_index != gre_device_class.index)
65+
+ if (!dev_class->is_tunnel)
2366
+ {
2467
+ /* rename tx/output nodes */
2568
+ vlib_node_rename (vm, hw->tx_node_index, "%v-tx", hw->name);
@@ -28,6 +71,20 @@ index db47d42c8..c4a852895 100644
2871

2972
/* rename statseg directory */
3073
statseg_interface_rename (vnm, hw->sw_if_index);
74+
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
75+
index f0cb540f9..d9c2a596b 100644
76+
--- a/src/vnet/interface.h
77+
+++ b/src/vnet/interface.h
78+
@@ -290,6 +290,9 @@ typedef struct _vnet_device_class
79+
/* Interface to set rss queues of the interface */
80+
vnet_interface_rss_queues_set_t *set_rss_queues_function;
81+
82+
+ /* Interfaces of this device share nodes, so dont rename them*/
83+
+ u8 is_tunnel;
84+
+
85+
} vnet_device_class_t;
86+
87+
u32 vnet_register_device_class (vlib_main_t *, vnet_device_class_t *);
3188
--
3289
2.51.0
3390

0 commit comments

Comments
 (0)