* [PATCH RFC 1/5] net: add IFF_L2_ONLY flag
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
@ 2015-08-25 22:50 ` Florian Fainelli
2015-08-25 22:50 ` [PATCH RFC 2/5] net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces Florian Fainelli
` (7 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2015-08-25 22:50 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, linux, jiri, sfeldma, Florian Fainelli
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.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/uapi/linux/if.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h
index 9cf2394f0bcf..2de818930edf 100644
--- a/include/uapi/linux/if.h
+++ b/include/uapi/linux/if.h
@@ -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
--
2.1.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH RFC 2/5] net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
2015-08-25 22:50 ` [PATCH RFC 1/5] net: add IFF_L2_ONLY flag Florian Fainelli
@ 2015-08-25 22:50 ` Florian Fainelli
2015-08-25 22:50 ` [PATCH RFC 3/5] net: ipv6: Skip in6_dev " Florian Fainelli
` (6 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2015-08-25 22:50 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, linux, jiri, sfeldma, 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.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/ipv4/devinet.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 2d9cb1748f81..30068754e821 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -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))
--
2.1.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH RFC 3/5] net: ipv6: Skip in6_dev initialization for IFF_L2_ONLY interfaces
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
2015-08-25 22:50 ` [PATCH RFC 1/5] net: add IFF_L2_ONLY flag Florian Fainelli
2015-08-25 22:50 ` [PATCH RFC 2/5] net: ipv4: Skip in_dev initialization for IFF_L2_ONLY interfaces Florian Fainelli
@ 2015-08-25 22:50 ` Florian Fainelli
2015-08-25 22:50 ` [PATCH RFC 4/5] net: dsa: Flag slave network devices with IFF_L2_ONLY Florian Fainelli
` (5 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2015-08-25 22:50 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, linux, jiri, sfeldma, 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.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/ipv6/addrconf.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0f08d3b9e238..0365b5ffe339 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -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;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH RFC 4/5] net: dsa: Flag slave network devices with IFF_L2_ONLY
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
` (2 preceding siblings ...)
2015-08-25 22:50 ` [PATCH RFC 3/5] net: ipv6: Skip in6_dev " Florian Fainelli
@ 2015-08-25 22:50 ` Florian Fainelli
2015-08-25 22:50 ` [PATCH RFC 5/5] net: dsa: bcm_sf2: Allow disabling tagging protocol Florian Fainelli
` (4 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2015-08-25 22:50 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, linux, jiri, sfeldma, 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.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/dsa/slave.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index cce97385f743..855c66dddced 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -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;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH RFC 5/5] net: dsa: bcm_sf2: Allow disabling tagging protocol
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
` (3 preceding siblings ...)
2015-08-25 22:50 ` [PATCH RFC 4/5] net: dsa: Flag slave network devices with IFF_L2_ONLY Florian Fainelli
@ 2015-08-25 22:50 ` Florian Fainelli
2015-08-26 0:09 ` David Miller
2015-08-25 23:20 ` [PATCH RFC 0/5] net: L2 only interfaces Alexei Starovoitov
` (3 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Florian Fainelli @ 2015-08-25 22:50 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, linux, jiri, sfeldma, 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.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 289e20443d83..68abcc545231 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -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 */
--
2.1.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
` (4 preceding siblings ...)
2015-08-25 22:50 ` [PATCH RFC 5/5] net: dsa: bcm_sf2: Allow disabling tagging protocol Florian Fainelli
@ 2015-08-25 23:20 ` Alexei Starovoitov
2015-08-25 23:24 ` Florian Fainelli
` (2 more replies)
2015-08-25 23:24 ` Stephen Hemminger
` (2 subsequent siblings)
8 siblings, 3 replies; 21+ messages in thread
From: Alexei Starovoitov @ 2015-08-25 23:20 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, davem, andrew, linux, jiri, sfeldma
On Tue, Aug 25, 2015 at 03:50:10PM -0700, Florian Fainelli wrote:
> 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
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.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 23:20 ` [PATCH RFC 0/5] net: L2 only interfaces Alexei Starovoitov
@ 2015-08-25 23:24 ` Florian Fainelli
2015-08-25 23:33 ` David Ahern
2015-09-01 17:07 ` Vivien Didelot
2 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2015-08-25 23:24 UTC (permalink / raw)
To: Alexei Starovoitov; +Cc: netdev, davem, andrew, linux, jiri, sfeldma
On 25/08/15 16:20, Alexei Starovoitov wrote:
> On Tue, Aug 25, 2015 at 03:50:10PM -0700, Florian Fainelli wrote:
>> 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
>
> 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 ;)
> 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
> imo great first step to have lightweight netdevs. +1 for 'net_port' in the future.
Thanks!
--
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 23:20 ` [PATCH RFC 0/5] net: L2 only interfaces Alexei Starovoitov
2015-08-25 23:24 ` Florian Fainelli
@ 2015-08-25 23:33 ` David Ahern
2015-09-01 17:07 ` Vivien Didelot
2 siblings, 0 replies; 21+ messages in thread
From: David Ahern @ 2015-08-25 23:33 UTC (permalink / raw)
To: Alexei Starovoitov, Florian Fainelli
Cc: netdev, davem, andrew, linux, jiri, sfeldma
On 8/25/15 4:20 PM, Alexei Starovoitov wrote:
> On Tue, Aug 25, 2015 at 03:50:10PM -0700, Florian Fainelli wrote:
>> 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
>
> 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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 23:20 ` [PATCH RFC 0/5] net: L2 only interfaces Alexei Starovoitov
2015-08-25 23:24 ` Florian Fainelli
2015-08-25 23:33 ` David Ahern
@ 2015-09-01 17:07 ` Vivien Didelot
2 siblings, 0 replies; 21+ messages in thread
From: Vivien Didelot @ 2015-09-01 17:07 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Florian Fainelli, netdev, davem, andrew, linux, jiri, sfeldma,
Vivien Didelot
Hi Florian, All,
On Aug. Tuesday 25 (35) 04:20 PM, Alexei Starovoitov wrote:
> On Tue, Aug 25, 2015 at 03:50:10PM -0700, Florian Fainelli wrote:
> > 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
>
> 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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
` (5 preceding siblings ...)
2015-08-25 23:20 ` [PATCH RFC 0/5] net: L2 only interfaces Alexei Starovoitov
@ 2015-08-25 23:24 ` Stephen Hemminger
2015-08-25 23:23 ` Florian Fainelli
2015-08-25 23:44 ` Sowmini Varadhan
2015-08-26 0:12 ` David Miller
8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2015-08-25 23:24 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, davem, andrew, linux, jiri, sfeldma
On Tue, 25 Aug 2015 15:50:10 -0700
Florian Fainelli <f.fainelli@gmail.com> wrote:
> 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(-)
>
Can you bridge these?
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 23:24 ` Stephen Hemminger
@ 2015-08-25 23:23 ` Florian Fainelli
0 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2015-08-25 23:23 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, davem, andrew, linux, jiri, sfeldma
On 25/08/15 16:24, Stephen Hemminger wrote:
> On Tue, 25 Aug 2015 15:50:10 -0700
> Florian Fainelli <f.fainelli@gmail.com> wrote:
>
>> 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(-)
>>
>
> 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.
--
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
` (6 preceding siblings ...)
2015-08-25 23:24 ` Stephen Hemminger
@ 2015-08-25 23:44 ` Sowmini Varadhan
2015-08-25 23:52 ` David Ahern
2015-08-26 0:12 ` David Miller
8 siblings, 1 reply; 21+ messages in thread
From: Sowmini Varadhan @ 2015-08-25 23:44 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, David Miller, andrew, linux, Jiří Pírko,
sfeldma
On Tue, Aug 25, 2015 at 3:50 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> 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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 23:44 ` Sowmini Varadhan
@ 2015-08-25 23:52 ` David Ahern
2015-08-26 0:05 ` Sowmini Varadhan
0 siblings, 1 reply; 21+ messages in thread
From: David Ahern @ 2015-08-25 23:52 UTC (permalink / raw)
To: Sowmini Varadhan, Florian Fainelli
Cc: netdev, David Miller, andrew, linux, Jiří Pírko,
sfeldma
On 8/25/15 4:44 PM, Sowmini Varadhan wrote:
> On Tue, Aug 25, 2015 at 3:50 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> 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.
The VRF driver can check the device when the enslave request happens.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 23:52 ` David Ahern
@ 2015-08-26 0:05 ` Sowmini Varadhan
0 siblings, 0 replies; 21+ messages in thread
From: Sowmini Varadhan @ 2015-08-26 0:05 UTC (permalink / raw)
To: David Ahern
Cc: Florian Fainelli, netdev, David Miller, andrew, linux,
Jiří Pírko, sfeldma
On Tue, Aug 25, 2015 at 4:52 PM, David Ahern <dsa@cumulusnetworks.com> wrote:
> 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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-25 22:50 [PATCH RFC 0/5] net: L2 only interfaces Florian Fainelli
` (7 preceding siblings ...)
2015-08-25 23:44 ` Sowmini Varadhan
@ 2015-08-26 0:12 ` David Miller
2015-08-26 4:24 ` Marcel Holtmann
2015-08-26 17:32 ` Florian Fainelli
8 siblings, 2 replies; 21+ messages in thread
From: David Miller @ 2015-08-26 0:12 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, andrew, linux, jiri, sfeldma
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 25 Aug 2015 15:50:10 -0700
> 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!
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?
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-26 0:12 ` David Miller
@ 2015-08-26 4:24 ` Marcel Holtmann
2015-08-26 17:37 ` Florian Fainelli
2015-08-26 17:32 ` Florian Fainelli
1 sibling, 1 reply; 21+ messages in thread
From: Marcel Holtmann @ 2015-08-26 4:24 UTC (permalink / raw)
To: David S. Miller
Cc: f.fainelli, Network Development, andrew, Guenter Roeck, jiri,
sfeldma
Hi Dave,
>> 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!
>
> 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?
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-26 4:24 ` Marcel Holtmann
@ 2015-08-26 17:37 ` Florian Fainelli
2015-08-26 17:56 ` Marcel Holtmann
0 siblings, 1 reply; 21+ messages in thread
From: Florian Fainelli @ 2015-08-26 17:37 UTC (permalink / raw)
To: Marcel Holtmann, David S. Miller
Cc: Network Development, andrew, Guenter Roeck, jiri, sfeldma
On 25/08/15 21:24, Marcel Holtmann wrote:
> Hi Dave,
>
>>> 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!
>>
>> 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?
>
> 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.
--
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-26 17:37 ` Florian Fainelli
@ 2015-08-26 17:56 ` Marcel Holtmann
0 siblings, 0 replies; 21+ messages in thread
From: Marcel Holtmann @ 2015-08-26 17:56 UTC (permalink / raw)
To: Florian Fainelli
Cc: David S. Miller, Network Development, andrew, Guenter Roeck,
Jiri Pirko, sfeldma
Hi Florian,
>>>> 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!
>>>
>>> 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?
>>
>> 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.
> 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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH RFC 0/5] net: L2 only interfaces
2015-08-26 0:12 ` David Miller
2015-08-26 4:24 ` Marcel Holtmann
@ 2015-08-26 17:32 ` Florian Fainelli
1 sibling, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2015-08-26 17:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev, andrew, linux, jiri, sfeldma
On 25/08/15 17:12, David Miller wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Tue, 25 Aug 2015 15:50:10 -0700
>
>> 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!
>
> 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.
>
> 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!
--
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread