Skip to contentSkip to conversation

Remove IPVlan module dependencies on IPv6 and L3 Master dev

PATCH In review Matteo Croce 2 participants 4 messages Feb 21, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover Remove IPVlan module dependencies on IPv6 and L3 Master dev

The IPVlan module currently depends on IPv6 and L3 Master dev. Refactor the code to allow building IPVlan module regardless of the value of CONFIG_IPV6 as done in other drivers like VxLAN or GENEVE. Also change the CONFIG_NET_L3_MASTER_DEV dependency into a select, since compiling L3 Master device alone has little sense.

$ grep -wE 'CONFIG_(IPV6|IPVLAN)' .config
CONFIG_IPV6=y
CONFIG_IPVLAN=m
$ ll drivers/net/ipvlan/ipvlan.ko
48K drivers/net/ipvlan/ipvlan.ko
$ grep -wE 'CONFIG_(IPV6|IPVLAN)' .config
# CONFIG_IPV6 is not set
CONFIG_IPVLAN=m
$ ll drivers/net/ipvlan/ipvlan.ko
44K drivers/net/ipvlan/ipvlan.ko

Matteo Croce (2):
ipvlan: drop ipv6 dependency
ipvlan: selects master_l3 device instead of depending on it

 drivers/net/Kconfig              |  3 +-
 drivers/net/ipvlan/ipvlan_core.c | 72 ++++++++++++++++++++++++++++++----------
 drivers/net/ipvlan/ipvlan_main.c | 48 +++++++++++++++++----------
 3 files changed, 86 insertions(+), 37 deletions(-)
Signature · 1 line
2.14.3
#1 lore raw

PATCH v4 1/2 ipvlan: drop ipv6 dependency

IPVlan has an hard dependency on IPv6, refactor the ipvlan code to allow compiling it with IPv6 disabled, move duplicate code into addr_equal() and refactor series of if-else into a switch.

---
v4: more descriptive commit message and fix checkpatch.pl warnings

 drivers/net/Kconfig              |  1 -
 drivers/net/ipvlan/ipvlan_core.c | 72 ++++++++++++++++++++++++++++++----------
 drivers/net/ipvlan/ipvlan_main.c | 48 +++++++++++++++++----------
 3 files changed, 85 insertions(+), 36 deletions(-)
drivers/net/Kconfig +0 -1
index 944ec3c9282c..3234c6618d75 100644
@@ -149,7 +149,6 @@ config MACVTAP
 config IPVLAN
     tristate "IP-VLAN support"
     depends on INET
-    depends on IPV6
     depends on NETFILTER
     depends on NET_L3_MASTER_DEV
     ---help---
drivers/net/ipvlan/ipvlan_core.c +54 -18

170 lines not on this page · raw message

drivers/net/ipvlan/ipvlan_main.c +31 -17

125 lines not on this page · raw message

Signature · 1 line
2.14.3
#2 lore raw

PATCH v4 2/2 ipvlan: selects master_l3 device instead of depending on it

In reply to Matteo Croce

The L3 Master device is just a glue between the core networking code and device drivers, so it should be selected automatically rather than requiring to be enabled explicitly.

---
 drivers/net/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/Kconfig +1 -1
index 3234c6618d75..d88b78a17440 100644
@@ -150,7 +150,7 @@ config IPVLAN
     tristate "IP-VLAN support"
     depends on INET
     depends on NETFILTER
-    depends on NET_L3_MASTER_DEV
+    select NET_L3_MASTER_DEV
     ---help---
       This allows one to create virtual devices off of a main interface
       and packets will be delivered based on the dest L3 (IPv6/IPv4 addr)
Signature · 1 line
2.14.3
maintainer
#3 lore raw
In reply to Matteo Croce

From: Matteo Croce <[email protected]>
Date: Wed, 21 Feb 2018 01:31:12 +0100

Quoted 12 lines

The IPVlan module currently depends on IPv6 and L3 Master dev. Refactor the code to allow building IPVlan module regardless of the value of CONFIG_IPV6 as done in other drivers like VxLAN or GENEVE. Also change the CONFIG_NET_L3_MASTER_DEV dependency into a select, since compiling L3 Master device alone has little sense.

$ grep -wE 'CONFIG_(IPV6|IPVLAN)' .config
CONFIG_IPV6=y
CONFIG_IPVLAN=m
$ ll drivers/net/ipvlan/ipvlan.ko
48K drivers/net/ipvlan/ipvlan.ko
Quoted 5 lines
$ grep -wE 'CONFIG_(IPV6|IPVLAN)' .config
# CONFIG_IPV6 is not set
CONFIG_IPVLAN=m
$ ll drivers/net/ipvlan/ipvlan.ko
44K drivers/net/ipvlan/ipvlan.ko

Series applied, thanks Matteo.