Skip to contentSkip to conversation

net: L2 only interfaces

RFC PATCH In review Florian Fainelli 8 participants 21 messages Aug 25, 2015 – Sep 1, 2015

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

cover net: L2 only interfaces

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Comments, flames, flying tomatoes welcome!

Florian Fainelli (5):
net: add IFF_L2_ONLY flag
net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces
net: dsa: Flag slave network devices with IFF_L2_ONLY
net: dsa: bcm_sf2: Allow disabling tagging protocol

 drivers/net/dsa/bcm_sf2.c | 16 +++++++++++++---
 include/uapi/linux/if.h   |  5 ++++-
 net/dsa/slave.c           |  1 +
 net/ipv4/devinet.c        |  3 +++
 net/ipv6/addrconf.c       |  4 ++++
 5 files changed, 25 insertions(+), 4 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

RFC PATCH 1/5 net: add IFF_L2_ONLY flag

Allow network device drivers to flag specific network devices as being L2 only, that is, no IPv4/v6 configuration will be allowed on these interfaces, yet they are still usable as configuration endpoints for ethtool interfaces.

---
 include/uapi/linux/if.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/uapi/linux/if.h +4 -1
index 9cf2394f0bcf..2de818930edf 100644
@@ -87,6 +87,7 @@ enum net_device_flags {
 	IFF_LOWER_UP			= 1<<16, /* volatile */
 	IFF_DORMANT			= 1<<17, /* volatile */
 	IFF_ECHO			= 1<<18, /* volatile */
+	IFF_L2_ONLY			= 1<<19, /* volatile */
 };
 
 #define IFF_UP				IFF_UP
@@ -108,9 +109,11 @@ enum net_device_flags {
 #define IFF_LOWER_UP			IFF_LOWER_UP
 #define IFF_DORMANT			IFF_DORMANT
 #define IFF_ECHO			IFF_ECHO
+#define IFF_L2_ONLY			IFF_L2_ONLY
 
 #define IFF_VOLATILE	(IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
-		IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
+		IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT|\
+		IFF_L2_ONLY)
 
 #define IF_GET_IFACE	0x0001		/* for querying only */
 #define IF_GET_PROTO	0x0002
Signature · 1 line
2.1.0
#2 lore raw

RFC PATCH 2/5 net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces

In reply to Florian Fainelli

IFF_L2_ONLY interfaces are Layer-2 only and do not support configuration of IPv4 addresses, nor the full IPv4 protocol stack. Do nothing for these interfaces.

---
 net/ipv4/devinet.c | 3 +++
 1 file changed, 3 insertions(+)
net/ipv4/devinet.c +3 -0
index 2d9cb1748f81..30068754e821 100644
@@ -1383,6 +1383,9 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
 	ASSERT_RTNL();
 
 	if (!in_dev) {
+		if (dev->flags & IFF_L2_ONLY)
+			goto out;
+
 		if (event == NETDEV_REGISTER) {
 			in_dev = inetdev_init(dev);
 			if (IS_ERR(in_dev))
Signature · 1 line
2.1.0
#3 lore raw

RFC PATCH 3/5 net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces

In reply to Florian Fainelli

IFF_L2_ONLY interfaces are Layer-2 only network devices and do not support configuration of IPv6 addresses, nor the full IPv6 protocol stack. Do nothing for these interfaces.

---
 net/ipv6/addrconf.c | 4 ++++
 1 file changed, 4 insertions(+)
net/ipv6/addrconf.c +4 -0
index 0f08d3b9e238..0365b5ffe339 100644
@@ -3161,6 +3161,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 	int run_pending = 0;
 	int err;
 
+	if (dev->flags & IFF_L2_ONLY)
+		goto out;
+
 	switch (event) {
 	case NETDEV_REGISTER:
 		if (!idev && dev->mtu >= IPV6_MIN_MTU) {
@@ -3304,6 +3307,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 		addrconf_type_change(dev, event);
 		break;
 	}
+out:
 
 	return NOTIFY_OK;
 }
Signature · 1 line
2.1.0
#4 lore raw

RFC PATCH 4/5 net: dsa: Flag slave network devices with IFF_L2_ONLY

In reply to Florian Fainelli

When tagging is not supported by the underlying switch driver, ds->tag_protocol will be set to DSA_TAG_PROTO_NONE, and we should be flagging the slave network devices with IFF_L2_ONLY such that IP configuration is denied and they are just control end-points.

---
 net/dsa/slave.c | 1 +
 1 file changed, 1 insertion(+)
net/dsa/slave.c +1 -0
index cce97385f743..855c66dddced 100644
@@ -1185,6 +1185,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
 		break;
 #endif
 	default:
+		slave_dev->flags |= IFF_L2_ONLY;
 		p->xmit	= dsa_slave_notag_xmit;
 		break;
 	}
Signature · 1 line
2.1.0
#5 lore raw

RFC PATCH 5/5 net: dsa: bcm_sf2: Allow disabling tagging protocol

In reply to Florian Fainelli

Update the IMP port configuration to check whether tagging is enabled (DSA_TAG_PROTO_BRCM) or disabled (DSA_TAG_PROTO_NONE) and correctly program the relevant registers in both cases.

---
 drivers/net/dsa/bcm_sf2.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/net/dsa/bcm_sf2.c +13 -3
index 289e20443d83..68abcc545231 100644
@@ -159,6 +159,7 @@ static void bcm_sf2_imp_vlan_setup(struct dsa_switch *ds, int cpu_port)
 
 static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)
 {
+	bool tagging_disabled = !!(ds->tag_protocol == DSA_TAG_PROTO_NONE);
 	struct bcm_sf2_priv *priv = ds_to_priv(ds);
 	u32 reg, val;
 
@@ -199,21 +200,30 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)
 
 	/* Enable Broadcom tags for IMP port */
 	reg = core_readl(priv, CORE_BRCM_HDR_CTRL);
-	reg |= val;
+	if (!tagging_disabled)
+		reg |= val;
+	else
+		reg &= ~val;
 	core_writel(priv, reg, CORE_BRCM_HDR_CTRL);
 
 	/* Enable reception Broadcom tag for CPU TX (switch RX) to
 	 * allow us to tag outgoing frames
 	 */
 	reg = core_readl(priv, CORE_BRCM_HDR_RX_DIS);
-	reg &= ~(1 << port);
+	if (tagging_disabled)
+		reg |= 1 << port;
+	else
+		reg &= ~(1 << port);
 	core_writel(priv, reg, CORE_BRCM_HDR_RX_DIS);
 
 	/* Enable transmission of Broadcom tags from the switch (CPU RX) to
 	 * allow delivering frames to the per-port net_devices
 	 */
 	reg = core_readl(priv, CORE_BRCM_HDR_TX_DIS);
-	reg &= ~(1 << port);
+	if (tagging_disabled)
+		reg |= 1 << port;
+	else
+		reg &= ~(1 << port);
 	core_writel(priv, reg, CORE_BRCM_HDR_TX_DIS);
 
 	/* Force link status for IMP port */
Signature · 1 line
2.1.0
maintainer
#6 lore raw

Re: [PATCH RFC 5/5] net: dsa: bcm_sf2: Allow disabling tagging protocol

From: Florian Fainelli <[email protected]>
Date: Tue, 25 Aug 2015 15:50:15 -0700

drivers/net/dsa/bcm_sf2.c static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) · line 203

Quoted 4 lines
drivers/net/dsa/bcm_sf2.c +1 -1
 	/* Enable Broadcom tags for IMP port */
 	reg = core_readl(priv, CORE_BRCM_HDR_CTRL);
-	reg |= val;
+	if (!tagging_disabled)

Just a pet-peeve of mine, I hate conditions that read as double negatives, like this one does.

#7 lore raw
In reply to Florian Fainelli
Quoted 13 lines · Florian Fainelli

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Quoted 6 lines

Comments, flames, flying tomatoes welcome!

Florian Fainelli (5):
net: add IFF_L2_ONLY flag
net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces

interesting idea! Do you know how kernel/iproute2 will react to lack of in_dev? No crashes I'm assuming, but what kind of errors are thrown?
imo great first step to have lightweight netdevs. +1 for 'net_port' in the future.

#8 lore raw
Quoted 14 lines · Alexei Starovoitov
Quoted 13 lines · Florian Fainelli

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Quoted 8 lines
Quoted 6 lines

Comments, flames, flying tomatoes welcome!

Florian Fainelli (5):
net: add IFF_L2_ONLY flag
net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces

interesting idea! Do you know how kernel/iproute2 will react to lack of in_dev?

Surprisingly pretty good so far, have not found a way to make the kernel crash ;)

Quoted 1 line

No crashes I'm assuming, but what kind of errors are thrown?

If you try to assign an IP address to such an interface, you get:

# ifconfig gphy 192.168.1.1
ifconfig: SIOCSIFADDR: No buffer space available
Quoted 1 line

imo great first step to have lightweight netdevs. +1 for 'net_port' in the future.

Thanks!

Signature · 1 line
Florian
#9 lore raw
In reply to Alexei Starovoitov
Quoted 16 lines · Alexei Starovoitov
Quoted 15 lines · Florian Fainelli

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Comments, flames, flying tomatoes welcome!

Quoted 9 lines
Quoted 4 lines

Florian Fainelli (5):
net: add IFF_L2_ONLY flag
net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces

interesting idea! Do you know how kernel/iproute2 will react to lack of in_dev? No crashes I'm assuming, but what kind of errors are thrown?
imo great first step to have lightweight netdevs. +1 for 'net_port' in the future.

I was looking a lightweight netdevice a couple of months ago -- bypassing procfs, sysfs and reducing the overall size of the net_device struct (which needs to go on a diet). In my POC (which is not ready for posting) I am using a link attribute (IFLA_LWT_NETDEV) as the trigger to bypass devinet_sysctl_register for example.

In your case you are proposing an interface flag. Is the intention to allow a run time change?

David

#10 lore raw
In reply to Alexei Starovoitov

Hi Florian, All,

Quoted 16 lines · Alexei Starovoitov
Quoted 15 lines · Florian Fainelli

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Comments, flames, flying tomatoes welcome!

Quoted 8 lines
Quoted 4 lines

Florian Fainelli (5):
net: add IFF_L2_ONLY flag
net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces

interesting idea! Do you know how kernel/iproute2 will react to lack of in_dev? No crashes I'm assuming, but what kind of errors are thrown?
imo great first step to have lightweight netdevs. +1 for 'net_port' in the future.

Lightening net_device with a new inner net_port structure seems like a great idea to register and expose L2 only interfaces.

DSA would get benefit from this too, as we could finally expose CPU and DSA ports. We'll then be able to use standard tools to configure them (e.g. speed/duplex), and allow fine-grained control of bridging: we may want to explicitly include or exclude these ports in bridges or VLANs.

Same goes for the support of basic switches (home routers).

A new iproute2 command or additional command line flags can be added later to explicitly access them from userspace. In the meantime, ifconfig and such would transparently configure (net_device)->port.

Thanks,
-v

#11 lore raw
In reply to Florian Fainelli
Quoted 22 lines · On Tue, 25 Aug 2015 15:50:10 -0700 Florian Fainelli <[email protected]>…

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Comments, flames, flying tomatoes welcome!

Florian Fainelli (5):
net: add IFF_L2_ONLY flag
net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces
net: dsa: Flag slave network devices with IFF_L2_ONLY
net: dsa: bcm_sf2: Allow disabling tagging protocol

Quoted 7 lines
 drivers/net/dsa/bcm_sf2.c | 16 +++++++++++++---
 include/uapi/linux/if.h   |  5 ++++-
 net/dsa/slave.c           |  1 +
 net/ipv4/devinet.c        |  3 +++
 net/ipv6/addrconf.c       |  4 ++++
 5 files changed, 25 insertions(+), 4 deletions(-)

Can you bridge these?

#12 lore raw
Quoted 33 lines · Stephen Hemminger
Quoted 22 lines · On Tue, 25 Aug 2015 15:50:10 -0700 Florian Fainelli <[email protected]>…

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Comments, flames, flying tomatoes welcome!

Florian Fainelli (5):
net: add IFF_L2_ONLY flag
net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces
net: dsa: Flag slave network devices with IFF_L2_ONLY
net: dsa: bcm_sf2: Allow disabling tagging protocol

Quoted 7 lines
 drivers/net/dsa/bcm_sf2.c | 16 +++++++++++++---
 include/uapi/linux/if.h   |  5 ++++-
 net/dsa/slave.c           |  1 +
 net/ipv4/devinet.c        |  3 +++
 net/ipv6/addrconf.c       |  4 ++++
 5 files changed, 25 insertions(+), 4 deletions(-)
Quoted 1 line

Can you bridge these?

You can add such an interface to the bridge, but I am still figuring out how functional such a bridge is, because with my change to bcm_sf2, there is no switch tag inserted, so I cannot differentiate a BPDU from Port 0, 1 etc... probably of limited use. You could still configure VLANs using bridge vlan filtering though, which was the main idea.

Signature · 1 line
Florian
#13 lore raw
In reply to Florian Fainelli
Quoted 6 lines · Florian Fainelli

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

This is a very interesting idea. A few questions/thoughts: will there be any eventual restrictions on which types interfaces can be L2_ONLY? Ideally, it should be possible to let interfaces wink in/out of L2 only state administratively (as can be done on a typical router, after unwinding existing config as needed)

I'm assuming something will prevent an L2-only interface from being part of a vrf.

--Sowmini

#14 lore raw
Quoted 8 lines · Sowmini Varadhan
Quoted 6 lines · Florian Fainelli

Hi all,

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

Quoted 8 lines

This is a very interesting idea. A few questions/thoughts: will there be any eventual restrictions on which types interfaces can be L2_ONLY? Ideally, it should be possible to let interfaces wink in/out of L2 only state administratively (as can be done on a typical router, after unwinding existing config as needed)

I'm assuming something will prevent an L2-only interface from being part of a vrf.

The VRF driver can check the device when the enslave request happens.

#15 lore raw
Quoted 2 lines · David Ahern

The VRF driver can check the device when the enslave request happens.

Will this work correctly if I set up a bonding interface or SVI, and want to put the bond-master or SVI in the vrf (but subsequently want to get, say, timestamp/other-stats from the L2 slave in the vrf?)

--Sowmini

maintainer
#16 lore raw
In reply to Florian Fainelli

From: Florian Fainelli <[email protected]>
Date: Tue, 25 Aug 2015 15:50:10 -0700

Quoted 13 lines

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Quoted 1 line

Comments, flames, flying tomatoes welcome!

Interesting, indeed.

Do you plan to extend this to defining a more minimal network device sub-type as well?

Then we can pass "net_device_common" or whatever around as a common base type of actual net device "implementations".

Or is you main goal just getting the L2-only semantic?

#17 lore raw

Hi Dave,

Quoted 17 lines
Quoted 13 lines

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Quoted 1 line

Comments, flames, flying tomatoes welcome!

Interesting, indeed.

Quoted 7 lines

Do you plan to extend this to defining a more minimal network device sub-type as well?

Then we can pass "net_device_common" or whatever around as a common base type of actual net device "implementations".

Or is you main goal just getting the L2-only semantic?

the other end of this could be also an IP only net_device where we do not have ethtool semantics.

We do have a need for a IPv6 only net_device when utilizing ARPHRD_6LOWPAN for 802.15.4 and Bluetooth LE. Skipping in_dev initialization there might be an interesting step towards that. Not sure how much entangled in_dev and in6_dev still are. If it works for IFF_L2_ONLY, it might work also in the other direction.

Regards

Marcel

#18 lore raw
Quoted 22 lines · Marcel Holtmann

Hi Dave,

Quoted 20 lines
Quoted 13 lines

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Quoted 1 line

Comments, flames, flying tomatoes welcome!

Interesting, indeed.

Do you plan to extend this to defining a more minimal network device sub-type as well?

Quoted 8 lines
Quoted 4 lines

Then we can pass "net_device_common" or whatever around as a common base type of actual net device "implementations".

Or is you main goal just getting the L2-only semantic?

the other end of this could be also an IP only net_device where we do not have ethtool semantics.

We do have a need for a IPv6 only net_device when utilizing ARPHRD_6LOWPAN for 802.15.4 and Bluetooth LE. Skipping in_dev initialization there might be an interesting step towards that. Not sure how much entangled in_dev and in6_dev still are. If it works for IFF_L2_ONLY, it might work also in the other direction.

Just out of curiosity, is the aim for IPv6 only net_device to be denying any kind of IPv4 configuration/tools, or is it for performance purposes?

The IFF_L2_ONLY flag would probably need to mean something like (IFF_NO_IPV4 | IFF_NO_IPV6) such that you could decide which one of the two IP stacks you want to use, or none.

Signature · 1 line
Florian
#19 lore raw

Hi Florian,

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 13 lines

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Quoted 1 line

Comments, flames, flying tomatoes welcome!

Interesting, indeed.

Do you plan to extend this to defining a more minimal network device sub-type as well?

Then we can pass "net_device_common" or whatever around as a common base type of actual net device "implementations".

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Or is you main goal just getting the L2-only semantic?

the other end of this could be also an IP only net_device where we do not have ethtool semantics.

We do have a need for a IPv6 only net_device when utilizing ARPHRD_6LOWPAN for 802.15.4 and Bluetooth LE. Skipping in_dev initialization there might be an interesting step towards that. Not sure how much entangled in_dev and in6_dev still are. If it works for IFF_L2_ONLY, it might work also in the other direction.

Just out of curiosity, is the aim for IPv6 only net_device to be denying any kind of IPv4 configuration/tools, or is it for performance purposes?

when you have 6LoWPAN, then it would be actually good to forbid IPv4 configuration on these interface since they have no mapping whatsoever. Eventually it might allow us to decrease the size of the network stack for embedded sensor devices.

Quoted 3 lines

The IFF_L2_ONLY flag would probably need to mean something like (IFF_NO_IPV4 | IFF_NO_IPV6) such that you could decide which one of the two IP stacks you want to use, or none.

I think IFF_NO_IPV4 and IFF_NO_IPV6 instead of IFF_L2_ONLY sounds like a good idea.

Regards

Marcel

#20 lore raw
In reply to David Miller
Quoted 18 lines · David Miller

From: Florian Fainelli <[email protected]>
Date: Tue, 25 Aug 2015 15:50:10 -0700

Quoted 13 lines

This patch series implements a L2 only interface concept which basically denies any kind of IP address configuration on these interfaces, but still allows them to be used as configuration end-points to keep using ethtool and friends.

A cleaner approach might be to finally come up with the concept of net_port which a net_device would be a superset of, but this still raises tons of questions as to whether we should be modifying userland tools to be able to configure/query these interfaces. During all the switch talks/discussions last year, it seemed to me like th L2-only interface is closest we have to a "network port".

Quoted 1 line

Comments, flames, flying tomatoes welcome!

Quoted 7 lines

Interesting, indeed.

Do you plan to extend this to defining a more minimal network device sub-type as well?

Then we can pass "net_device_common" or whatever around as a common base type of actual net device "implementations".

I am a little worried this is not going to scale well without introducing massive amounts of churn, but I am not opposed to the idea of having a common denominator structure which is either further specialized into a full-fledged net_device, or some other construct.

Quoted 2 lines

Or is you main goal just getting the L2-only semantic?

Yes, this was the main goal behind this submission, and see if there was something obviously wrong with doing that.

Now, based on the feedback, it seems like there is both interest and uses cases I had not initially thought about, like making this flag fully volatile.

Thanks!

Signature · 1 line
Florian