Skip to contentSkip to conversation

iplink_geneve: Support IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6.

PATCH Superseded Kuniyuki Iwashima 2 participants 3 messages Jun 4 – Jun 6

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 iplink_geneve: Support IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6.

IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6 allow specifying a local IPv4/IPv6 address for the backend UDP socket of a GENEVE devcie.

Let's support the attributes with the "local" keyword.

  # for i in $(seq 1 2);
  do
          ip link add geneve4_${i} type geneve local 192.168.0.${i} external
          ip addr add 192.168.0.${i}/24 dev geneve4_${i}
          ip link set geneve4_${i} up
          ip link add geneve6_${i} type geneve local 2001:9292::${i} external
          ip addr add 2001:9292::${i}/64 dev geneve6_${i} nodad
          ip link set geneve6_${i} up

done

  # ip -d l | grep geneve
  9: geneve4_1: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
      geneve external id 0 local 192.168.0.1 ...
  10: geneve6_1: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
      geneve external id 0 local 2001:9292::1 ...
  11: geneve4_2: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
      geneve external id 0 local 192.168.0.2 ...
  12: geneve6_2: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
      geneve external id 0 local 2001:9292::2 ...
  # ss -ua | grep geneve
  UNCONN 0      0         192.168.0.2:geneve      0.0.0.0:*
  UNCONN 0      0         192.168.0.1:geneve      0.0.0.0:*
  UNCONN 0      0      [2001:9292::2]:geneve            *:*
  UNCONN 0      0      [2001:9292::1]:geneve            *:*

Note that kernel dumps the wildcard address if the device created with IFLA_GENEVE_COLLECT_METADATA is not dualstack.

---
The corresponding kernel commit is afabbb56a726 ("geneve: Introduce IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6.").

v3:
* Use strcmp() instead of match()
* Use print_color_string()

v2: https://lore.kernel.org/netdev/[email protected]/
* Print LOCAL/LOCAL6 even if wildcard to match the kernel behaviour

v1: https://lore.kernel.org/netdev/[email protected]/

---
 include/uapi/linux/if_link.h |  2 ++
 ip/iplink_geneve.c           | 41 +++++++++++++++++++++++++++++++++++-
 2 files changed, 42 insertions(+), 1 deletion(-)
include/uapi/linux/if_link.h +2 -0
index a8c64be26f2c..d692d466da6b 100644
@@ -1487,6 +1487,8 @@ enum {
 	IFLA_GENEVE_INNER_PROTO_INHERIT,
 	IFLA_GENEVE_PORT_RANGE,
 	IFLA_GENEVE_GRO_HINT,
+	IFLA_GENEVE_LOCAL,
+	IFLA_GENEVE_LOCAL6,
 	__IFLA_GENEVE_MAX
 };
 #define IFLA_GENEVE_MAX	(__IFLA_GENEVE_MAX - 1)
ip/iplink_geneve.c +40 -1

79 lines not on this page · raw message

Signature · 1 line
2.54.0.1032.g2f8565e1d1-goog
#1 lore raw

include/uapi/linux/if_link.h enum { · line 1494

Quoted 13 lines · Kuniyuki Iwashima
include/uapi/linux/if_link.h +2 -0
index a8c64be26f2c..d692d466da6b 100644
@@ -1487,6 +1487,8 @@ enum {
 	IFLA_GENEVE_INNER_PROTO_INHERIT,
 	IFLA_GENEVE_PORT_RANGE,
 	IFLA_GENEVE_GRO_HINT,
+	IFLA_GENEVE_LOCAL,
+	IFLA_GENEVE_LOCAL6,
 	__IFLA_GENEVE_MAX
 };
 #define IFLA_GENEVE_MAX	(__IFLA_GENEVE_MAX - 1)

drop the uapi from this patch and update man/man8/ip-link.8.in

#2 lore raw
Quoted 17 lines · David Ahern

include/uapi/linux/if_link.h enum { · line 1494

Quoted 13 lines · Kuniyuki Iwashima
include/uapi/linux/if_link.h +2 -0
index a8c64be26f2c..d692d466da6b 100644
@@ -1487,6 +1487,8 @@ enum {
      IFLA_GENEVE_INNER_PROTO_INHERIT,
      IFLA_GENEVE_PORT_RANGE,
      IFLA_GENEVE_GRO_HINT,
+     IFLA_GENEVE_LOCAL,
+     IFLA_GENEVE_LOCAL6,
      __IFLA_GENEVE_MAX
 };
 #define IFLA_GENEVE_MAX      (__IFLA_GENEVE_MAX - 1)

drop the uapi from this patch and

Do you mean split into two patches or will maintainers sync the header before applying the patch ? I guess the latter from git log.

Quoted 1 line

update man/man8/ip-link.8.in

Will do.