1. 19 1月, 2023 3 次提交
  2. 14 1月, 2023 1 次提交
  3. 10 11月, 2022 1 次提交
  4. 26 10月, 2022 1 次提交
  5. 29 9月, 2022 1 次提交
  6. 09 9月, 2022 2 次提交
  7. 25 6月, 2022 1 次提交
  8. 17 6月, 2022 2 次提交
  9. 27 5月, 2022 1 次提交
  10. 06 5月, 2022 1 次提交
  11. 18 3月, 2022 2 次提交
  12. 13 2月, 2022 5 次提交
  13. 10 1月, 2022 1 次提交
  14. 25 11月, 2021 1 次提交
  15. 28 10月, 2021 1 次提交
  16. 24 10月, 2021 2 次提交
  17. 02 10月, 2021 1 次提交
  18. 28 7月, 2021 1 次提交
    • A
      dev_ioctl: split out ndo_eth_ioctl · a7605370
      Arnd Bergmann 提交于
      Most users of ndo_do_ioctl are ethernet drivers that implement
      the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware
      timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP.
      
      Separate these from the few drivers that use ndo_do_ioctl to
      implement SIOCBOND, SIOCBR and SIOCWANDEV commands.
      
      This is a purely cosmetic change intended to help readers find
      their way through the implementation.
      
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Vladimir Oltean <olteanv@gmail.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a7605370
  19. 14 4月, 2021 1 次提交
    • M
      of: net: pass the dst buffer to of_get_mac_address() · 83216e39
      Michael Walle 提交于
      of_get_mac_address() returns a "const void*" pointer to a MAC address.
      Lately, support to fetch the MAC address by an NVMEM provider was added.
      But this will only work with platform devices. It will not work with
      PCI devices (e.g. of an integrated root complex) and esp. not with DSA
      ports.
      
      There is an of_* variant of the nvmem binding which works without
      devices. The returned data of a nvmem_cell_read() has to be freed after
      use. On the other hand the return of_get_mac_address() points to some
      static data without a lifetime. The trick for now, was to allocate a
      device resource managed buffer which is then returned. This will only
      work if we have an actual device.
      
      Change it, so that the caller of of_get_mac_address() has to supply a
      buffer where the MAC address is written to. Unfortunately, this will
      touch all drivers which use the of_get_mac_address().
      
      Usually the code looks like:
      
        const char *addr;
        addr = of_get_mac_address(np);
        if (!IS_ERR(addr))
          ether_addr_copy(ndev->dev_addr, addr);
      
      This can then be simply rewritten as:
      
        of_get_mac_address(np, ndev->dev_addr);
      
      Sometimes is_valid_ether_addr() is used to test the MAC address.
      of_get_mac_address() already makes sure, it just returns a valid MAC
      address. Thus we can just test its return code. But we have to be
      careful if there are still other sources for the MAC address before the
      of_get_mac_address(). In this case we have to keep the
      is_valid_ether_addr() call.
      
      The following coccinelle patch was used to convert common cases to the
      new style. Afterwards, I've manually gone over the drivers and fixed the
      return code variable: either used a new one or if one was already
      available use that. Mansour Moufid, thanks for that coccinelle patch!
      
      <spml>
      @a@
      identifier x;
      expression y, z;
      @@
      - x = of_get_mac_address(y);
      + x = of_get_mac_address(y, z);
        <...
      - ether_addr_copy(z, x);
        ...>
      
      @@
      identifier a.x;
      @@
      - if (<+... x ...+>) {}
      
      @@
      identifier a.x;
      @@
        if (<+... x ...+>) {
            ...
        }
      - else {}
      
      @@
      identifier a.x;
      expression e;
      @@
      - if (<+... x ...+>@e)
      -     {}
      - else
      + if (!(e))
            {...}
      
      @@
      expression x, y, z;
      @@
      - x = of_get_mac_address(y, z);
      + of_get_mac_address(y, z);
        ... when != x
      </spml>
      
      All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
      compile-time tested.
      Suggested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      83216e39
  20. 10 4月, 2021 1 次提交
  21. 02 4月, 2021 1 次提交
  22. 06 3月, 2021 1 次提交
  23. 17 2月, 2021 2 次提交
    • S
      lan743x: sync only the received area of an rx ring buffer · 966df6de
      Sven Van Asbroeck 提交于
      On cpu architectures w/o dma cache snooping, dma_unmap() is a
      is a very expensive operation, because its resulting sync
      needs to invalidate cpu caches.
      
      Increase efficiency/performance by syncing only those sections
      of the lan743x's rx ring buffers that are actually in use.
      Signed-off-by: NSven Van Asbroeck <thesven73@gmail.com>
      Reviewed-by: NBryan Whitehead <Bryan.Whitehead@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      966df6de
    • S
      lan743x: boost performance on cpu archs w/o dma cache snooping · a8db76d4
      Sven Van Asbroeck 提交于
      The buffers in the lan743x driver's receive ring are always 9K,
      even when the largest packet that can be received (the mtu) is
      much smaller. This performs particularly badly on cpu archs
      without dma cache snooping (such as ARM): each received packet
      results in a 9K dma_{map|unmap} operation, which is very expensive
      because cpu caches need to be invalidated.
      
      Careful measurement of the driver rx path on armv7 reveals that
      the cpu spends the majority of its time waiting for cache
      invalidation.
      
      Optimize by keeping the rx ring buffer size as close as possible
      to the mtu. This limits the amount of cache that requires
      invalidation.
      
      This optimization would normally force us to re-allocate all
      ring buffers when the mtu is changed - a disruptive event,
      because it can only happen when the network interface is down.
      
      Remove the need to re-allocate all ring buffers by adding support
      for multi-buffer frames. Now any combination of mtu and ring
      buffer size will work. When the mtu changes from mtu1 to mtu2,
      consumed buffers of size mtu1 are lazily replaced by newly
      allocated buffers of size mtu2.
      
      These optimizations double the rx performance on armv7.
      Third parties report 3x rx speedup on armv8.
      
      Tested with iperf3 on a freescale imx6qp + lan7430, both sides
      set to mtu 1500 bytes, measure rx performance:
      
      Before:
      [ ID] Interval           Transfer     Bandwidth       Retr
      [  4]   0.00-20.00  sec   550 MBytes   231 Mbits/sec    0
      After:
      [ ID] Interval           Transfer     Bandwidth       Retr
      [  4]   0.00-20.00  sec  1.33 GBytes   570 Mbits/sec    0
      Signed-off-by: NSven Van Asbroeck <thesven73@gmail.com>
      Reviewed-by: NBryan Whitehead <Bryan.Whitehead@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8db76d4
  24. 29 1月, 2021 1 次提交
  25. 17 12月, 2020 1 次提交
    • S
      lan743x: fix rx_napi_poll/interrupt ping-pong · 57030a0b
      Sven Van Asbroeck 提交于
      Even if there is more rx data waiting on the chip, the rx napi poll fn
      will never run more than once - it will always read a few buffers, then
      bail out and re-arm interrupts. Which results in ping-pong between napi
      and interrupt.
      
      This defeats the purpose of napi, and is bad for performance.
      
      Fix by making the rx napi poll behave identically to other ethernet
      drivers:
      1. initialize rx napi polling with an arbitrary budget (64).
      2. in the polling fn, return full weight if rx queue is not depleted,
         this tells the napi core to "keep polling".
      3. update the rx tail ("ring the doorbell") once for every 8 processed
         rx ring buffers.
      
      Thanks to Jakub Kicinski, Eric Dumazet and Andrew Lunn for their expert
      opinions and suggestions.
      
      Tested with 20 seconds of full bandwidth receive (iperf3):
              rx irqs      softirqs(NET_RX)
              -----------------------------
      before  23827        33620
      after   129          4081
      
      Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
      Fixes: 23f0703c ("lan743x: Add main source files for new lan743x driver")
      Signed-off-by: NSven Van Asbroeck <thesven73@gmail.com>
      Link: https://lore.kernel.org/r/20201215161954.5950-1-TheSven73@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      57030a0b
  26. 25 11月, 2020 2 次提交
  27. 18 11月, 2020 1 次提交
    • S
      lan743x: replace devicetree phy parse code with library function · 7c3e2b77
      Sven Van Asbroeck 提交于
      The code in this driver which parses the devicetree to determine
      the phy/fixed link setup, can be replaced by a single library
      function: of_phy_get_and_connect().
      
      Behaviour is identical, except that the library function will
      complain when 'phy-connection-type' is omitted, instead of
      blindly using PHY_INTERFACE_MODE_NA, which would result in an
      invalid phy configuration.
      
      The library function no longer brings out the exact phy_mode,
      but the driver doesn't need this, because phy_interface_is_rgmii()
      queries the phydev directly. Remove 'phy_mode' from the private
      adapter struct.
      
      While we're here, log info about the attached phy on connect,
      this is useful because the phy type and connection method is now
      fully configurable via the devicetree.
      
      Tested on a lan7430 chip with built-in phy. Verified that adding
      fixed-link/phy-connection-type in the devicetree results in a
      fixed-link setup. Used ethtool to verify that the devicetree
      settings are used.
      
      Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
      Signed-off-by: NSven Van Asbroeck <thesven73@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20201116170155.26967-1-TheSven73@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      7c3e2b77
  28. 15 11月, 2020 1 次提交
    • S
      lan743x: prevent entire kernel HANG on open, for some platforms · 796a2665
      Sven Van Asbroeck 提交于
      On arm imx6, when opening the chip's netdev, the whole Linux
      kernel intermittently hangs/freezes.
      
      This is caused by a bug in the driver code which tests if pcie
      interrupts are working correctly, using the software interrupt:
      
      1. open: enable the software interrupt
      2. open: tell the chip to assert the software interrupt
      3. open: wait for flag
      4. ISR: acknowledge s/w interrupt, set flag
      5. open: notice flag, disable the s/w interrupt, continue
      
      Unfortunately the ISR only acknowledges the s/w interrupt, but
      does not disable it. This will re-trigger the ISR in a tight
      loop.
      
      On some (lucky) platforms, open proceeds to disable the s/w
      interrupt even while the ISR is 'spinning'. On arm imx6,
      the spinning ISR does not allow open to proceed, resulting
      in a hung Linux kernel.
      
      Fix minimally by disabling the s/w interrupt in the ISR, which
      will prevent it from spinning. This won't break anything because
      the s/w interrupt is used as a one-shot interrupt.
      
      Note that this is a minimal fix, overlooking many possible
      cleanups, e.g.:
      - lan743x_intr_software_isr() is completely redundant and reads
        INT_STS twice for no apparent reason
      - disabling the s/w interrupt in lan743x_intr_test_isr() is now
        redundant, but harmless
      - waiting on software_isr_flag can be converted from a sleeping
        poll loop to wait_event_timeout()
      
      Fixes: 23f0703c ("lan743x: Add main source files for new lan743x driver")
      Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # arm imx6 lan7430
      Signed-off-by: NSven Van Asbroeck <thesven73@gmail.com>
      Link: https://lore.kernel.org/r/20201112204741.12375-1-TheSven73@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      796a2665