1. 02 3月, 2016 4 次提交
  2. 26 2月, 2016 1 次提交
  3. 24 2月, 2016 3 次提交
  4. 13 2月, 2016 2 次提交
    • V
      net: dsa: mv88e6xxx: do not leave reserved VLANs · 66d9cd0f
      Vivien Didelot 提交于
      BRIDGE_VLAN_FILTERING automatically adds a newly bridged port to the
      VLAN with the bridge's default_pvid.
      
      The mv88e6xxx driver currently reserves VLANs 4000+ for unbridged ports
      isolation. When a port joins a bridge, it leaves its reserved VLAN. When
      a port leaves a bridge, it joins again its reserved VLAN.
      
      But if the VLAN filtering is disabled, or if this hardware VLAN is
      already in use, the bridged port ends up with no default VLAN, and the
      communication with the CPU is thus broken.
      
      To fix this, make a port join its reserved VLAN once on setup, never
      leave it, and restore its PVID after another one was eventually used.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66d9cd0f
    • V
      net: dsa: mv88e6xxx: fix software VLAN deletion · 3c06f08b
      Vivien Didelot 提交于
      The current bridge code calls switchdev_port_obj_del on a VLAN port even
      if the corresponding switchdev_port_obj_add call returned -EOPNOTSUPP.
      
      If the DSA driver doesn't return -EOPNOTSUPP for a software port VLAN in
      its port_vlan_del function, the VLAN is not deleted. Unbridging the port
      also generates a stack trace for the same reason.
      
      This can be quickly tested on a VLAN filtering enabled system with:
      
          # brctl addbr br0
          # brctl addif br0 lan0
          # brctl addbr br1
          # brctl addif br1 lan1
          # brctl delif br1 lan1
      
      Both bridges have a default default_pvid set to 1. lan0 uses the
      hardware VLAN 1 while lan1 falls back to the software VLAN 1.
      
      Unbridging lan1 does not delete its software VLAN, and thus generates
      the following stack trace:
      
          [ 2991.681705] device lan1 left promiscuous mode
          [ 2991.686237] br1: port 1(lan1) entered disabled state
          [ 2991.725094] ------------[ cut here ]------------
          [ 2991.729761] WARNING: CPU: 0 PID: 869 at net/bridge/br_vlan.c:314 __vlan_group_free+0x4c/0x50()
          [ 2991.738437] Modules linked in:
          [ 2991.741546] CPU: 0 PID: 869 Comm: ip Not tainted 4.4.0 #16
          [ 2991.747039] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
          [ 2991.753511] Backtrace:
          [ 2991.756008] [<80014450>] (dump_backtrace) from [<8001469c>] (show_stack+0x20/0x24)
          [ 2991.763604]  r6:80512644 r5:00000009 r4:00000000 r3:00000000
          [ 2991.769343] [<8001467c>] (show_stack) from [<80268e44>] (dump_stack+0x24/0x28)
          [ 2991.776618] [<80268e20>] (dump_stack) from [<80025568>] (warn_slowpath_common+0x98/0xc4)
          [ 2991.784750] [<800254d0>] (warn_slowpath_common) from [<80025650>] (warn_slowpath_null+0x2c/0x34)
          [ 2991.793557]  r8:00000000 r7:9f786a8c r6:9f76c440 r5:9f786a00 r4:9f68ac00
          [ 2991.800366] [<80025624>] (warn_slowpath_null) from [<80512644>] (__vlan_group_free+0x4c/0x50)
          [ 2991.808946] [<805125f8>] (__vlan_group_free) from [<80514488>] (nbp_vlan_flush+0x44/0x68)
          [ 2991.817147]  r4:9f68ac00 r3:9ec70000
          [ 2991.820772] [<80514444>] (nbp_vlan_flush) from [<80506f08>] (del_nbp+0xac/0x130)
          [ 2991.828201]  r5:9f56f800 r4:9f786a00
          [ 2991.831841] [<80506e5c>] (del_nbp) from [<8050774c>] (br_del_if+0x40/0xbc)
          [ 2991.838724]  r7:80590f68 r6:00000000 r5:9ec71c38 r4:9f76c440
          [ 2991.844475] [<8050770c>] (br_del_if) from [<80503dc0>] (br_del_slave+0x1c/0x20)
          [ 2991.851802]  r5:9ec71c38 r4:9f56f800
          [ 2991.855428] [<80503da4>] (br_del_slave) from [<80484a34>] (do_setlink+0x324/0x7b8)
          [ 2991.863043] [<80484710>] (do_setlink) from [<80485e90>] (rtnl_newlink+0x508/0x6f4)
          [ 2991.870616]  r10:00000000 r9:9ec71ba8 r8:00000000 r7:00000000 r6:9f6b0400 r5:9f56f800
          [ 2991.878548]  r4:8076278c
          [ 2991.881110] [<80485988>] (rtnl_newlink) from [<80484048>] (rtnetlink_rcv_msg+0x18c/0x22c)
          [ 2991.889315]  r10:9f7d4e40 r9:00000000 r8:00000000 r7:00000000 r6:9f7d4e40 r5:9f6b0400
          [ 2991.897250]  r4:00000000
          [ 2991.899814] [<80483ebc>] (rtnetlink_rcv_msg) from [<80497c74>] (netlink_rcv_skb+0xb0/0xcc)
          [ 2991.908104]  r8:00000000 r7:9f7d4e40 r6:9f7d4e40 r5:80483ebc r4:9f6b0400
          [ 2991.914928] [<80497bc4>] (netlink_rcv_skb) from [<80483eb4>] (rtnetlink_rcv+0x34/0x3c)
          [ 2991.922874]  r6:9f5ea000 r5:00000028 r4:9f7d4e40 r3:80483e80
          [ 2991.928622] [<80483e80>] (rtnetlink_rcv) from [<80497604>] (netlink_unicast+0x180/0x200)
          [ 2991.936742]  r4:9f4edc00 r3:80483e80
          [ 2991.940362] [<80497484>] (netlink_unicast) from [<80497a88>] (netlink_sendmsg+0x33c/0x350)
          [ 2991.948648]  r8:00000000 r7:00000028 r6:00000000 r5:9f5ea000 r4:9ec71f4c
          [ 2991.955481] [<8049774c>] (netlink_sendmsg) from [<80457ff0>] (sock_sendmsg+0x24/0x34)
          [ 2991.963342]  r10:00000000 r9:9ec71e28 r8:00000000 r7:9f1e2140 r6:00000000 r5:00000000
          [ 2991.971276]  r4:9ec71f4c
          [ 2991.973849] [<80457fcc>] (sock_sendmsg) from [<80458af0>] (___sys_sendmsg+0x1fc/0x204)
          [ 2991.981809] [<804588f4>] (___sys_sendmsg) from [<804598d0>] (__sys_sendmsg+0x4c/0x7c)
          [ 2991.989640]  r10:00000000 r9:9ec70000 r8:80010824 r7:00000128 r6:7ee946c4 r5:00000000
          [ 2991.997572]  r4:9f1e2140
          [ 2992.000128] [<80459884>] (__sys_sendmsg) from [<80459918>] (SyS_sendmsg+0x18/0x1c)
          [ 2992.007725]  r6:00000000 r5:7ee9c7b8 r4:7ee946e0
          [ 2992.012430] [<80459900>] (SyS_sendmsg) from [<80010660>] (ret_fast_syscall+0x0/0x3c)
          [ 2992.020182] ---[ end trace 5d4bc29f4da04280 ]---
      
      To fix this, return -EOPNOTSUPP in _mv88e6xxx_port_vlan_del instead of
      -ENOENT if the hardware VLAN doesn't exist or the port is not a member.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c06f08b
  5. 30 1月, 2016 1 次提交
  6. 26 1月, 2016 1 次提交
    • R
      net: dsa: fix mv88e6xxx switches · db0e51af
      Russell King 提交于
      Since commit 76e398a6 ("net: dsa: use switchdev obj for VLAN add/del
      ops"), the Marvell 88E6xxx switch has been unable to pass traffic
      between ports - any received traffic is discarded by the switch.
      Taking a port out of bridge mode and configuring a vlan on it also the
      port to start passing traffic.
      
      With the debugfs files re-instated to allow debug of this issue by
      comparing the register settings between the working and non-working
      case, the reason becomes clear:
      
           GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
      - 7:  1111    707f    2001     2    2    2    2    2    0    2
      + 7:  1111    707f    2001     1    1    1    1    1    0    1
      
      Register 7 for the ports is the default vlan tag register, and in the
      non-working setup, it has been set to 2, despite vlan 2 not being
      configured.  This causes the switch to drop all packets coming in to
      these ports.  The working setup has the default vlan tag register set
      to 1, which is the default vlan when none is configured.
      
      Inspection of the code reveals why.  The code prior to this commit
      was:
      
      -		for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
      ...
      -			if (!err && vlan->flags & BRIDGE_VLAN_INFO_PVID)
      -				err = ds->drv->port_pvid_set(ds, p->port, vid);
      
      but the new code is:
      
      +	for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
      ...
      +	}
      ...
      +	if (pvid)
      +		err = _mv88e6xxx_port_pvid_set(ds, port, vid);
      
      This causes the new code to always set the default vlan to one higher
      than the old code.
      
      Fix this.
      
      Fixes: 76e398a6 ("net: dsa: use switchdev obj for VLAN add/del ops")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db0e51af
  7. 24 12月, 2015 1 次提交
    • A
      dsa: mv88e6xxx: Add Second back of statistics · f5e2ed02
      Andrew Lunn 提交于
      The 6320 family of switch chips has a second bank for statistics, but
      is missing three statistics in the port registers. Generalise and
      extend the code:
      
      * adding a field to the statistics table indicating the bank/register
        set where each statistics is.
      * add a function indicating if an individual statistics
        is available on this device
      * calculate at run time the sset_count.
      * return strings based on the available statistics of the device
      * return statistics based on the available statistics of the device
      * Add support for reading from the second bank.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f5e2ed02
  8. 24 11月, 2015 1 次提交
  9. 06 11月, 2015 1 次提交
  10. 04 11月, 2015 2 次提交
  11. 03 11月, 2015 2 次提交
  12. 02 11月, 2015 1 次提交
  13. 23 10月, 2015 2 次提交
  14. 22 10月, 2015 4 次提交
  15. 13 10月, 2015 3 次提交
    • V
      net: dsa: mv88e6xxx: fix hardware bridging · 5fe7f680
      Vivien Didelot 提交于
      Playing with the VLAN map of every port to implement "hardware bridging"
      in the 88E6352 driver was a hack until full 802.1Q was supported.
      
      Indeed with 802.1Q port mode "Disabled" or "Fallback", this feature is
      used to restrict which output ports an input port can egress frames to.
      
      A Linux bridge is an untagged VLAN. With full 802.1Q support, we don't
      need this hack anymore and can use the "Secure" strict 802.1Q port mode.
      
      With this mode, the port-based VLAN map still needs to be configured,
      but all the logic is VTU-centric. This means that the switch only cares
      about rules described in its hardware VLAN table, which is exactly what
      Linux bridge expects and what we want.
      
      Note also that the hardware bridging was broken with the previous
      flexible "Fallback" 802.1Q port mode. Here's an example:
      
      Port0 and Port1 belong to the same bridge. If Port0 sends crafted tagged
      frames with VID 200 to Port1, Port1 receives it. Even if Port1 is in
      hardware VLAN 200, but not Port0, Port1 will still receive it, because
      Fallback mode doesn't care about invalid VID or non-member source port.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5fe7f680
    • V
      net: dsa: mv88e6xxx: do not support per-port FID · f02bdffc
      Vivien Didelot 提交于
      Since we configure a switch chip through a Linux bridge, and a bridge is
      implemented as a VLAN, there is no need for per-port FID anymore.
      
      This patch gets rid of this and simplifies the driver code since we can
      now directly map all 4095 FIDs available to all VLANs.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f02bdffc
    • V
      net: dsa: mv88e6xxx: bridges do not need an FID · ede8098d
      Vivien Didelot 提交于
      With 88E6352 and similar switch chips, each port has a map to restrict
      which output port this input port can egress frames to.
      
      The current driver code implements hardware bridging using this feature,
      and assigns to a bridge group the FID of its first member.
      
      Now that 802.1Q is fully implemented in this driver, a Linux bridge
      which is a simple untagged VLAN, already gets its own FID.
      
      This patch gets rid of the per-bridge FID and explicits the usage of the
      port based VLAN map feature.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ede8098d
  16. 11 10月, 2015 3 次提交
  17. 07 10月, 2015 1 次提交
  18. 30 9月, 2015 2 次提交
  19. 23 9月, 2015 1 次提交
    • R
      net: dsa: actually force the speed on the CPU port · 53adc9e8
      Russell King 提交于
      Commit 54d792f2 ("net: dsa: Centralise global and port setup
      code into mv88e6xxx.") merged in the 4.2 merge window broke the link
      speed forcing for the CPU port of Marvell DSA switches.  The original
      code was:
      
              /* MAC Forcing register: don't force link, speed, duplex
               * or flow control state to any particular values on physical
               * ports, but force the CPU port and all DSA ports to 1000 Mb/s
               * full duplex.
               */
              if (dsa_is_cpu_port(ds, p) || ds->dsa_port_mask & (1 << p))
                      REG_WRITE(addr, 0x01, 0x003e);
              else
                      REG_WRITE(addr, 0x01, 0x0003);
      
      but the new code does a read-modify-write:
      
                      reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_PCS_CTRL);
                      if (dsa_is_cpu_port(ds, port) ||
                          ds->dsa_port_mask & (1 << port)) {
                              reg |= PORT_PCS_CTRL_FORCE_LINK |
                                      PORT_PCS_CTRL_LINK_UP |
                                      PORT_PCS_CTRL_DUPLEX_FULL |
                                      PORT_PCS_CTRL_FORCE_DUPLEX;
                              if (mv88e6xxx_6065_family(ds))
                                      reg |= PORT_PCS_CTRL_100;
                              else
                                      reg |= PORT_PCS_CTRL_1000;
      
      The link speed in the PCS control register is a two bit field.  Forcing
      the link speed in this way doesn't ensure that the bit field is set to
      the correct value - on the hardware I have here, the speed bitfield
      remains set to 0x03, resulting in the speed not being forced to gigabit.
      
      We must clear both bits before forcing the link speed.
      
      Fixes: 54d792f2 ("net: dsa: Centralise global and port setup code into mv88e6xxx.")
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53adc9e8
  20. 16 9月, 2015 4 次提交