1. 18 4月, 2017 1 次提交
    • J
      net: mvneta: fix failed to suspend if WOL is enabled · 82960fff
      Jisheng Zhang 提交于
      Recently, suspend/resume and WOL support are added into mvneta driver.
      If we enable WOL, then we get some error as below on Marvell BG4CT
      platforms during suspend:
      
      [  184.149723] dpm_run_callback(): mdio_bus_suspend+0x0/0x50 returns -16
      [  184.149727] PM: Device f7b62004.mdio-mi:00 failed to suspend: error -16
      
      -16 means -EBUSY, phy_suspend() will return -EBUSY if it finds the
      device has WOL enabled.
      
      We fix this issue by properly setting the netdev's power.can_wakeup
      and power.wakeup, i.e
      
      1. in mvneta_mdio_probe(), call device_set_wakeup_capable() to set
      power.can_wakeup if the phy support WOL.
      
      2. in mvneta_ethtool_set_wol(), call device_set_wakeup_enable() to
      set power.wakeup if WOL has been successfully enabled in phy.
      Signed-off-by: NJisheng Zhang <jszhang@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      82960fff
  2. 30 3月, 2017 2 次提交
  3. 17 3月, 2017 1 次提交
  4. 18 2月, 2017 1 次提交
  5. 11 2月, 2017 1 次提交
  6. 06 2月, 2017 1 次提交
  7. 31 1月, 2017 1 次提交
  8. 17 1月, 2017 2 次提交
    • M
      net: mvneta: add BQL support · a29b6235
      Marcin Wojtas 提交于
      Tests showed that when whole bandwidth is consumed, the latency for
      various kind of traffic can reach high values. With saturated
      link (e.g. with iperf from target to host) simple ping could take
      significant amount of time. BQL proved to improve this situation
      when implemented in mvneta driver. Measurements of ping latency
      for 3 link speeds:
      Speed | Latency w/o BQL | Latency with BQL
      10    |      7-14 ms    |     3.5 ms
      100   |      2-12 ms    |     0.6 ms
      1000  |   often timeout |   up to 2ms
      
      Decreasing latency as above result in sligt performance cost - 4kpps
      (-1.4%) when pushing 64B packets via two bridged interfaces of Armada 38x.
      For 1500B packets in the same setup, the mpstat tool showed +8% of
      CPU occupation (default affinity, second CPU idle). Even though this
      cost seems reasonable to take, considering other improvements.
      
      This commit adds byte queue limit mechanism for the mvneta driver.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a29b6235
    • S
      net: mvneta: add xmit_more support · 2a90f7e1
      Simon Guinot 提交于
      Basing on xmit_more flag of the skb, TX descriptors can be concatenated
      before flushing. This commit delay Tx descriptor flush if the queue is
      running and if there is more skb's to send.
      
      A maximum allowed number of descriptors for flushing at once due to
      MVNETA_TXQ_UPDATE_REG(q) reqisters limitation, is 255. Because of that
      a new macro was added (MVNETA_TXQ_DEC_SENT_MASK) in order to ensure that
      concatenated amount of descriptor does not exceed that value.
      Signed-off-by: NSimon Guinot <simon.guinot@sequanux.org>
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a90f7e1
  9. 09 1月, 2017 1 次提交
  10. 09 12月, 2016 1 次提交
  11. 03 12月, 2016 5 次提交
  12. 30 11月, 2016 1 次提交
  13. 26 11月, 2016 1 次提交
  14. 17 11月, 2016 1 次提交
  15. 18 10月, 2016 1 次提交
    • J
      ethernet/marvell: use core min/max MTU checking · 5777987e
      Jarod Wilson 提交于
      mvneta: min_mtu 68, max_mtu 9676
      - mtu validation routine mostly did range check, merge back into
        mvneta_change_mtu for simplicity
      
      mvpp2: min_mtu 68, max_mtu 9676
      - mtu validation routine mostly did range check, merge back into
        mvpp2_change_mtu for simplicity
      
      pxa168_eth: min_mtu 68, max_mtu 9500
      
      skge: min_mtu 60, max_mtu 9000
      
      sky2: min_mtu 68, max_mtu 1500 or 9000, depending on hw
      
      CC: netdev@vger.kernel.org
      CC: Mirko Lindner <mlindner@marvell.com>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5777987e
  16. 26 9月, 2016 1 次提交
    • B
      net: mvneta: mark symbols static where possible · 2dc0d2b4
      Baoyou Xie 提交于
      We get 2 warnings when building kernel with W=1:
      drivers/net/ethernet/marvell/mvneta.c:639:27: warning: no previous prototype for 'mvneta_get_stats64' [-Wmissing-prototypes]
      drivers/net/ethernet/marvell/mvneta.c:3529:5: warning: no previous prototype for 'mvneta_ethtool_set_link_ksettings' [-Wmissing-prototypes]
      
      In fact, these two functions are only used in the file in which they are
      declared and don't need a declaration, but can be made static.
      so this patch marks these functions with 'static'.
      Signed-off-by: NBaoyou Xie <baoyou.xie@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2dc0d2b4
  17. 07 9月, 2016 1 次提交
  18. 09 8月, 2016 2 次提交
  19. 02 8月, 2016 1 次提交
  20. 09 7月, 2016 1 次提交
    • D
      net: mvneta: set real interrupt per packet for tx_done · 06708f81
      Dmitri Epshtein 提交于
      Commit aebea2ba ("net: mvneta: fix Tx interrupt delay") intended to
      set coalescing threshold to a value guaranteeing interrupt generation
      per each sent packet, so that buffers can be released with no delay.
      
      In fact setting threshold to '1' was wrong, because it causes interrupt
      every two packets. According to the documentation a reason behind it is
      following - interrupt occurs once sent buffers counter reaches a value,
      which is higher than one specified in MVNETA_TXQ_SIZE_REG(q). This
      behavior was confirmed during tests. Also when testing the SoC working
      as a NAS device, better performance was observed with int-per-packet,
      as it strongly depends on the fact that all transmitted packets are
      released immediately.
      
      This commit enables NETA controller work in interrupt per sent packet mode
      by setting coalescing threshold to 0.
      Signed-off-by: NDmitri Epshtein <dima@marvell.com>
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Cc: <stable@vger.kernel.org> # v3.10+
      Fixes aebea2ba ("net: mvneta: fix Tx interrupt delay")
      Acked-by: NWilly Tarreau <w@1wt.eu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      06708f81
  21. 01 7月, 2016 1 次提交
    • R
      net: mvneta: fix open() error cleanup · 3d8c4530
      Russell King - ARM Linux 提交于
      If mvneta_mdio_probe() fails, a kernel warning is triggered due to
      missing cleanup in the error path.  Add the necessary cleanup.
      
      ------------[ cut here ]------------
      WARNING: CPU: 1 PID: 281 at kernel/irq/manage.c:1814 __free_percpu_irq+0xfc/0x130
      percpu IRQ 38 still enabled on CPU0!
      Modules linked in: bnep bluetooth xhci_plat_hcd xhci_hcd marvell_cesa armada_thermal des_generic ehci_orion mcp3021 spi_orion sfp mdio_i2c evbug fuse
      CPU: 1 PID: 281 Comm: connmand Not tainted 4.7.0-rc2+ #53
      Hardware name: Marvell Armada 380/385 (Device Tree)
      Backtrace:
      [<c0013488>] (dump_backtrace) from [<c00137d0>] (show_stack+0x18/0x1c)
       r6:60010093 r5:ffffffff r4:00000000 r3:dc8ba500
      [<c00137b8>] (show_stack) from [<c02c6fe0>] (dump_stack+0xa4/0xdc)
      [<c02c6f3c>] (dump_stack) from [<c002d4ec>] (__warn+0xd8/0x104)
       r6:c081e6a0 r5:00000000 r4:edfe5d50 r3:dc8ba500
      [<c002d414>] (__warn) from [<c002d5d0>] (warn_slowpath_fmt+0x40/0x48)
       r10:a0010013 r8:c09356f8 r7:00000026 r6:ef11a260 r5:edd7b980 r4:ef11a200
      [<c002d594>] (warn_slowpath_fmt) from [<c008c8e0>] (__free_percpu_irq+0xfc/0x130)
       r3:00000026 r2:c081e7ac
      [<c008c7e4>] (__free_percpu_irq) from [<c008c95c>] (free_percpu_irq+0x48/0x74)
       r10:00008914 r8:00000000 r7:ffffffed r6:c09356f8 r5:00000026 r4:ef11a200
      [<c008c914>] (free_percpu_irq) from [<c043dd70>] (mvneta_open+0x118/0x134)
       r6:ffffffed r5:ef01e640 r4:ef01e000 r3:ef01e000
      [<c043dc58>] (mvneta_open) from [<c055f5b4>] (__dev_open+0xa4/0x108)
       r7:ef01e030 r6:c06ff3d8 r5:ffff9003 r4:ef01e000
      [<c055f510>] (__dev_open) from [<c055f844>] (__dev_change_flags+0x94/0x150)
       r7:00001002 r6:00000001 r5:ffff9003 r4:ef01e000
      [<c055f7b0>] (__dev_change_flags) from [<c055f938>] (dev_change_flags+0x20/0x50)
       r8:00000000 r7:c09334c8 r6:00001002 r5:00000148 r4:ef01e000 r3:00008914
      [<c055f918>] (dev_change_flags) from [<c05de044>] (devinet_ioctl+0x6f4/0x7e0)
       r8:00000000 r7:c09334c8 r6:00000000 r5:ee87200c r4:00000000 r3:00008914
      [<c05dd950>] (devinet_ioctl) from [<c05e0168>] (inet_ioctl+0x1b8/0x1c8)
       r10:beb4499c r9:edfe4000 r8:ecf13280 r7:c096cf00 r6:beb4499c r5:eef7c240
       r4:00008914
      [<c05dffb0>] (inet_ioctl) from [<c053c898>] (sock_ioctl+0x78/0x300)
      [<c053c820>] (sock_ioctl) from [<c0155ecc>] (do_vfs_ioctl+0x98/0xa60)
       r7:00000011 r6:00008914 r5:00000011 r4:c01568d0
      [<c0155e34>] (do_vfs_ioctl) from [<c01568d0>] (SyS_ioctl+0x3c/0x60)
       r10:00000000 r9:edfe4000 r8:beb4499c r7:00000011 r6:00008914 r5:ecf13280
       r4:ecf13280
      [<c0156894>] (SyS_ioctl) from [<c000fe60>] (ret_fast_syscall+0x0/0x1c)
       r8:c0010004 r7:00000036 r6:00000011 r5:000a2978 r4:00000000 r3:00009003
      ---[ end trace 711f625d5b04b3a7 ]---
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Tested-by: NJon Nettleton <jon@solid-run.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d8c4530
  22. 04 5月, 2016 1 次提交
    • A
      net: mvneta: Remove superfluous SMP function call · 0e28bf93
      Anna-Maria Gleixner 提交于
      Since commit 3b9d6da6 ("cpu/hotplug: Fix rollback during error-out
      in __cpu_disable()") it is ensured that callbacks of CPU_ONLINE and
      CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this SMP
      function calls are no longer required.
      
      Replace smp_call_function_single() with a direct call to
      mvneta_percpu_enable() or mvneta_percpu_disable(). The functions do
      not require to be called with interrupts disabled, therefore the
      smp_call_function_single() calling convention is not preserved.
      
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NAnna-Maria Gleixner <anna-maria@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e28bf93
  23. 02 4月, 2016 2 次提交
  24. 01 4月, 2016 1 次提交
  25. 15 3月, 2016 7 次提交
    • D
      net: mvneta: replace magic numbers by existing macros · a3703fb3
      Dmitri Epshtein 提交于
      Some literal values are actually already defined by macros, so let's use
      them.
      
      [gregory.clement@free-electrons.com: split intial commit in two
      individual changes]
      Signed-off-by: NDmitri Epshtein <dima@marvell.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3703fb3
    • D
      net: mvneta: fix error messages in mvneta_port_down function · 0838abb3
      Dmitri Epshtein 提交于
      This commit corrects error printing when shutting down the port.
      
      [gregory.clement@free-electrons.com: split initial commit in two
      individual changes]
      Signed-off-by: NDmitri Epshtein <dima@marvell.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0838abb3
    • D
      net: mvneta: enable change MAC address when interface is up · 928b6519
      Dmitri Epshtein 提交于
      Function eth_prepare_mac_addr_change() is called as part of MAC
      address change. This function check if interface is running.
      To enable change MAC address when interface is running:
      IFF_LIVE_ADDR_CHANGE flag must be set to dev->priv_flags field
      
      Fixes: c5aff182 ("net: mvneta: driver for Marvell Armada 370/XP
      network unit")
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitri Epshtein <dima@marvell.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      928b6519
    • G
      net: mvneta: Fix spinlock usage · 1c2722a9
      Gregory CLEMENT 提交于
      In the previous patch, the spinlock was not initialized. While it didn't
      cause any trouble yet it could be a problem to use it uninitialized.
      
      The most annoying part was the critical section protected by the spinlock
      in mvneta_stop(). Some of the functions could sleep as pointed when
      activated CONFIG_DEBUG_ATOMIC_SLEEP. Actually, in mvneta_stop() we only
      need to protect the is_stopped flagged, indeed the code of the notifier
      for CPU online is protected by the same spinlock, so when we get the
      lock, the notifer work is done.
      Reported-by: NPatrick Uiterwijk <patrick@puiterwijk.org>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c2722a9
    • A
      net: mvneta: Add missing hotplug notifier transition · 0df83e7a
      Anna-Maria Gleixner 提交于
      The mvneta_percpu_notifier() hotplug callback lacks handling of the
      CPU_DOWN_FAILED case. That means, if CPU_DOWN_PREPARE failes, the
      driver is not well configured on the CPU.
      
      Add handling for CPU_DOWN_FAILED[_FROZEN] hotplug notifier transition
      to setup the driver.
      
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NAnna-Maria Gleixner <anna-maria@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0df83e7a
    • G
      net: mvneta: Use the new hwbm framework · baa11ebc
      Gregory CLEMENT 提交于
      Now that the hardware buffer management framework had been introduced,
      let's use it.
      Tested-by: NSebastian Careba <nitroshift@yahoo.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      baa11ebc
    • M
      net: mvneta: bm: add support for hardware buffer management · dc35a10f
      Marcin Wojtas 提交于
      Buffer manager (BM) is a dedicated hardware unit that can be used by all
      ethernet ports of Armada XP and 38x SoC's. It allows to offload CPU on RX
      path by sparing DRAM access on refilling buffer pool, hardware-based
      filling of descriptor ring data and better memory utilization due to HW
      arbitration for using 'short' pools for small packets.
      
      Tests performed with A388 SoC working as a network bridge between two
      packet generators showed increase of maximum processed 64B packets by
      ~20k (~555k packets with BM enabled vs ~535 packets without BM). Also
      when pushing 1500B-packets with a line rate achieved, CPU load decreased
      from around 25% without BM to 20% with BM.
      
      BM comprise up to 4 buffer pointers' (BP) rings kept in DRAM, which
      are called external BP pools - BPPE. Allocating and releasing buffer
      pointers (BP) to/from BPPE is performed indirectly by write/read access
      to a dedicated internal SRAM, where internal BP pools (BPPI) are placed.
      BM hardware controls status of BPPE automatically, as well as assigning
      proper buffers to RX descriptors. For more details please refer to
      Functional Specification of Armada XP or 38x SoC.
      
      In order to enable support for a separate hardware block, common for all
      ports, a new driver has to be implemented ('mvneta_bm'). It provides
      initialization sequence of address space, clocks, registers, SRAM,
      empty pools' structures and also obtaining optional configuration
      from DT (please refer to device tree binding documentation). mvneta_bm
      exposes also a necessary API to mvneta driver, as well as a dedicated
      structure with BM information (bm_priv), whose presence is used as a
      flag notifying of BM usage by port. It has to be ensured that mvneta_bm
      probe is executed prior to the ones in ports' driver. In case BM is not
      used or its probe fails, mvneta falls back to use software buffer
      management.
      
      A sequence executed in mvneta_probe function is modified in order to have
      an access to needed resources before possible port's BM initialization is
      done. According to port-pools mapping provided by DT appropriate registers
      are configured and the buffer pools are filled. RX path is modified
      accordingly. Becaues the hardware allows a wide variety of configuration
      options, following assumptions are made:
      * using BM mechanisms can be selectively disabled/enabled basing
        on DT configuration among the ports
      * 'long' pool's single buffer size is tied to port's MTU
      * using 'long' pool by port is obligatory and it cannot be shared
      * using 'short' pool for smaller packets is optional
      * one 'short' pool can be shared among all ports
      
      This commit enables hardware buffer management operation cooperating with
      existing mvneta driver. New device tree binding documentation is added and
      the one of mvneta is updated accordingly.
      
      [gregory.clement@free-electrons.com: removed the suspend/resume part]
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc35a10f
  26. 13 2月, 2016 1 次提交