1. 16 6月, 2017 1 次提交
    • J
      networking: introduce and use skb_put_data() · 59ae1d12
      Johannes Berg 提交于
      A common pattern with skb_put() is to just want to memcpy()
      some data into the new space, introduce skb_put_data() for
      this.
      
      An spatch similar to the one for skb_put_zero() converts many
      of the places using it:
      
          @@
          identifier p, p2;
          expression len, skb, data;
          type t, t2;
          @@
          (
          -p = skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          |
          -p = (t)skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, len);
          |
          -memcpy(p, data, len);
          )
      
          @@
          type t, t2;
          identifier p, p2;
          expression skb, data;
          @@
          t *p;
          ...
          (
          -p = skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          |
          -p = (t *)skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, sizeof(*p));
          |
          -memcpy(p, data, sizeof(*p));
          )
      
          @@
          expression skb, len, data;
          @@
          -memcpy(skb_put(skb, len), data, len);
          +skb_put_data(skb, data, len);
      
      (again, manually post-processed to retain some comments)
      Reviewed-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59ae1d12
  2. 19 4月, 2017 4 次提交
  3. 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
  4. 30 3月, 2017 2 次提交
  5. 17 3月, 2017 1 次提交
  6. 18 2月, 2017 1 次提交
  7. 11 2月, 2017 1 次提交
  8. 06 2月, 2017 1 次提交
  9. 31 1月, 2017 1 次提交
  10. 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
  11. 09 1月, 2017 1 次提交
  12. 09 12月, 2016 1 次提交
  13. 03 12月, 2016 5 次提交
  14. 30 11月, 2016 1 次提交
  15. 26 11月, 2016 1 次提交
  16. 17 11月, 2016 1 次提交
  17. 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
  18. 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
  19. 07 9月, 2016 1 次提交
  20. 09 8月, 2016 2 次提交
  21. 02 8月, 2016 1 次提交
  22. 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
  23. 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
  24. 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
  25. 02 4月, 2016 2 次提交
  26. 01 4月, 2016 1 次提交
  27. 15 3月, 2016 3 次提交