[source] lantiq: fix broadcasts and vlans in two iface mode

LEDE Commits lede-commits at lists.infradead.org
Sat Mar 11 05:14:50 PST 2017


mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/715b06641933a128acfba0e0240b261afd6afa1c

commit 715b06641933a128acfba0e0240b261afd6afa1c
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Fri Feb 24 09:19:49 2017 +0100

    lantiq: fix broadcasts and vlans in two iface mode
    
    The two phy operation mode where one phy is assigned to an interface
    without lantiq,* device tree property and the other phy is assigned to
    an interface with the lantiq,wan device property was broken with the
    multicast package leaks between vlans fixes.
    
    Move the multicast packages relevant portmap settings to the condition
    which handles multicast packages for better readability.
    
    Replace the priv->port_map based port_map only for the interface which
    has the lantiq,switch device tree property set, to allow tagged
    multicast packages in two phy mode where the lantiq,switch device tree
    property isn't used.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch    | 11 ++++++-----
 .../patches-4.9/0025-NET-MIPS-lantiq-adds-xrx200-net.patch    | 11 ++++++-----
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
index b84e205..1550f26 100644
--- a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
+++ b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
@@ -209,7 +209,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +};
 --- /dev/null
 +++ b/drivers/net/ethernet/lantiq_xrx200.c
-@@ -0,0 +1,1851 @@
+@@ -0,0 +1,1852 @@
 +/*
 + *   This program is free software; you can redistribute it and/or modify it
 + *   under the terms of the GNU General Public License version 2 as published
@@ -1262,7 +1262,6 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +	struct xrx200_chan *ch;
 +	struct ltq_dma_desc *desc;
 +	u32 byte_offset;
-+	u16 port_map = 0;
 +	int ret = NETDEV_TX_OK;
 +	int len;
 +#ifdef SW_ROUTING
@@ -1280,10 +1279,13 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +
 +#ifdef SW_ROUTING
 +	if (is_multicast_ether_addr(eth_hdr(skb)->h_dest)) {
-+		if (skb->protocol == htons(ETH_P_8021Q)) {
++		u16 port_map = priv->port_map;
++
++		if (priv->sw && skb->protocol == htons(ETH_P_8021Q)) {
 +			u16 vid;
 +			int i;
 +
++			port_map = 0;
 +			if (!__vlan_get_tag(skb, &vid)) {
 +				for (i = 0; i < XRX200_MAX_VLAN; i++) {
 +					if (priv->hw->vlan_vid[i] != vid)
@@ -1293,8 +1295,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +				}
 +			}
 +		}
-+	}
-+	if (port_map) {
++
 +		special_tag |= (port_map << PORT_MAP_SHIFT) |
 +			       PORT_MAP_SEL | PORT_MAP_EN;
 +	}
diff --git a/target/linux/lantiq/patches-4.9/0025-NET-MIPS-lantiq-adds-xrx200-net.patch b/target/linux/lantiq/patches-4.9/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
index a3693ee..80bcea0 100644
--- a/target/linux/lantiq/patches-4.9/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
+++ b/target/linux/lantiq/patches-4.9/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
@@ -209,7 +209,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +};
 --- /dev/null
 +++ b/drivers/net/ethernet/lantiq_xrx200.c
-@@ -0,0 +1,1850 @@
+@@ -0,0 +1,1851 @@
 +/*
 + *   This program is free software; you can redistribute it and/or modify it
 + *   under the terms of the GNU General Public License version 2 as published
@@ -1262,7 +1262,6 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +	struct xrx200_chan *ch;
 +	struct ltq_dma_desc *desc;
 +	u32 byte_offset;
-+	u16 port_map = 0;
 +	int ret = NETDEV_TX_OK;
 +	int len;
 +#ifdef SW_ROUTING
@@ -1280,10 +1279,13 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +
 +#ifdef SW_ROUTING
 +	if (is_multicast_ether_addr(eth_hdr(skb)->h_dest)) {
-+		if (skb->protocol == htons(ETH_P_8021Q)) {
++		u16 port_map = priv->port_map;
++
++		if (priv->sw && skb->protocol == htons(ETH_P_8021Q)) {
 +			u16 vid;
 +			int i;
 +
++			port_map = 0;
 +			if (!__vlan_get_tag(skb, &vid)) {
 +				for (i = 0; i < XRX200_MAX_VLAN; i++) {
 +					if (priv->hw->vlan_vid[i] != vid)
@@ -1293,8 +1295,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +				}
 +			}
 +		}
-+	}
-+	if (port_map) {
++
 +		special_tag |= (port_map << PORT_MAP_SHIFT) |
 +			       PORT_MAP_SEL | PORT_MAP_EN;
 +	}



More information about the lede-commits mailing list