1. 15 4月, 2021 1 次提交
  2. 14 4月, 2021 3 次提交
    • O
      net: stmmac: Add TX via XDP zero-copy socket · 132c32ee
      Ong Boon Leong 提交于
      We add the support of XDP ZC TX submission and cleaning into
      stmmac_tx_clean(). The function is made to clean as many TX complete
      frames as possible, i.e. limit by priv->dma_tx_size instead of NAPI
      budget. For TX ring that is associated with XSK pool, the function
      stmmac_xdp_xmit_zc() is introduced to TX frame buffers from XSK pool by
      using xsk_tx_peek_desc(). To make stmmac_tx_clean() support the cleaning
      of XSK TX frames, STMMAC_TXBUF_T_XSK_TX TX buffer type is introduced.
      
      As stmmac_tx_clean() uses the return value to cue whether NAPI function
      should continue to poll, we augment the caller of stmmac_tx_clean() to
      pass NAPI budget instead of priv->dma_tx_size through 'budget' input and
      made stmmac_tx_clean() to always clean up-to the TX ring size instead.
      This allows us to use the return boolean status of stmmac_xdp_xmit_zc()
      to decide if XSK TX work is done or not: If true, set 'xmits' to return
      'budget - 1' so that NAPI poll may exit. Else, set 'xmits' to return
      'budget' to make NAPI poll continue to poll since XSK TX work is not
      done. Finally, at the end of stmmac_tx_clean(), the function now take
      a maximum value between 'count' and 'xmits' so that status from both
      TX cleaning and XSK TX (only for XDP ZC) is considered.
      
      This patch adds a new NAPI poll called stmmac_napi_poll_rxtx() that is
      meant to be enabled/disabled for RX and TX ring that are bound to XSK
      pool. This NAPI poll function starts with cleaning TX ring, then submits
      XSK TX frames to TX ring before proceed to perform RX operations, i.e.
      , receiving RX frames and replenishing RX ring with RX free buffers
      obtained from XSK pool. Therefore, during XSK RX and TX setup, the driver
      enables stmmac_napi_poll_rxtx() for RX and TX operations, then during
      XSK RX and TX pool tear-down, the driver reenables the exisiting
      independent NAPI poll functions accordingly: stmmac_napi_poll_rx() and
      stmmac_napi_poll_tx().
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      132c32ee
    • O
      net: stmmac: Enable RX via AF_XDP zero-copy · bba2556e
      Ong Boon Leong 提交于
      This patch adds the support for receiving packet via AF_XDP zero-copy
      mechanism.
      
      XDP ZC uses 1:1 mapping of XDP buffer to receive packet, therefore the
      use of split header is not used currently. The 'xdp_buff' is declared as
      union together with a struct that contains 'page', 'addr' and
      'page_offset' that are associated with primary buffer.
      
      RX buffers are now allocated either via page_pool or xsk pool. For RX
      buffers from xsk_pool they are allocated and deallocated using below
      functions:
      
       * stmmac_alloc_rx_buffers_zc(struct stmmac_priv *priv, u32 queue)
       * dma_free_rx_xskbufs(struct stmmac_priv *priv, u32 queue)
      
      With above functions now available, we then extend the following driver
      functions to support XDP ZC:
       * stmmac_reinit_rx_buffers()
       * __init_dma_rx_desc_rings()
       * init_dma_rx_desc_rings()
       * __free_dma_rx_desc_resources()
      
      Note: stmmac_alloc_rx_buffers_zc() may return -ENOMEM due to RX XDP
      buffer pool is not allocated (e.g. samples/bpf/xdpsock TX-only). But,
      it is still ok to let TX XDP ZC to continue, therefore, the -ENOMEM
      is silently ignored to let the driver succcessfully transition to XDP
      ZC mode for the said RX and TX queue.
      
      As XDP ZC buffer size is different, the DMA buffer size is required
      to be reprogrammed accordingly for RX DMA/Queue that is populated with
      XDP buffer from XSK pool.
      
      Next, to add or remove per-queue XSK pool, stmmac_xdp_setup_pool()
      will call stmmac_xdp_enable_pool() or stmmac_xdp_disable_pool()
      that in-turn coordinates the tearing down and setting up RX ring via
      RX buffers and descriptors removal and reallocation through
      stmmac_disable_rx_queue() and stmmac_enable_rx_queue(). In addition,
      stmmac_xsk_wakeup() is added to initiate XDP RX buffer replenishing
      by signalling user application to add available XDP frames back to
      FILL queue.
      
      For RX processing using XDP zero-copy buffer, stmmac_rx_zc() is
      introduced which is implemented with the assumption that RX split
      header is disabled. For XDP verdict is XDP_PASS, the XDP buffer is
      copied into a sk_buff allocated through stmmac_construct_skb_zc()
      and sent to Linux network GRO inside stmmac_dispatch_skb_zc(). Free RX
      buffers are then replenished using stmmac_rx_refill_zc()
      
      v2: introduce __stmmac_disable_all_queues() to contain the original code
          that does napi_disable() and then make stmmac_setup_tc_block_cb()
          to use it. Move synchronize_rcu() into stmmac_disable_all_queues()
          that eventually calls __stmmac_disable_all_queues(). Then,
          make both stmmac_release() and stmmac_suspend() to use
          stmmac_disable_all_queues(). Thanks David Miller for spotting the
          synchronize_rcu() issue in v1 patch.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bba2556e
    • 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
  3. 04 4月, 2021 4 次提交
    • O
      net: stmmac: Add support for XDP_REDIRECT action · 8b278a5b
      Ong Boon Leong 提交于
      This patch adds the support of XDP_REDIRECT to another remote cpu for
      further action. It also implements ndo_xdp_xmit ops, enabling the driver
      to transmit packets forwarded to it by XDP program running on another
      interface.
      
      This patch has been tested using "xdp_redirect_cpu" for XDP_REDIRECT
      + drop testing. It also been tested with "xdp_redirect" sample app
      which can be used to exercise ndo_xdp_xmit ops. The burst traffics are
      generated using pktgen_sample03_burst_single_flow.sh in samples/pktgen
      directory.
      
      v4: Move xdp_do_flush() processing into stmmac_finalize_xdp_rx() and
          combined the XDP verdict of XDP TX and REDIRECT together.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for point out.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8b278a5b
    • O
      net: stmmac: Add support for XDP_TX action · be8b38a7
      Ong Boon Leong 提交于
      This patch adds support for XDP_TX action which enables XDP program to
      transmit back received frames.
      
      This patch has been tested with the "xdp2" app located in samples/bpf
      dir. The DUT receives burst traffic packet generated using pktgen script
      'pktgen_sample03_burst_single_flow.sh'.
      
      v4: Moved stmmac_tx_timer_arm() to be done once at the end of NAPI RX.
          Fixed stmmac_xdp_xmit_back() to return STMMAC_XDP_CONSUMED if
          XDP buffer to frame conversion fails. Thanks to Jakub's input.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for pointing out.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be8b38a7
    • O
      net: stmmac: Add initial XDP support · 5fabb012
      Ong Boon Leong 提交于
      This patch adds the initial XDP support to stmmac driver. It supports
      XDP_PASS, XDP_DROP and XDP_ABORTED actions. Upcoming patches will add
      support for XDP_TX and XDP_REDIRECT.
      
      To support XDP headroom, this patch adds page_offset into RX buffer and
      change the dma_sync_single_for_device|cpu(). The DMA address used for
      RX operation are changed to take into page_offset too. As page_pool
      can handle dma_sync_single_for_device() on behalf of driver with
      PP_FLAG_DMA_SYNC_DEV flag, we skip doing that in stmmac driver.
      
      Current stmmac driver supports split header support (SPH) in RX but
      the flexibility of splitting header and payload at different position
      makes it very complex to be supported for XDP processing. In addition,
      jumbo frame is not supported in XDP to keep the initial codes simple.
      
      This patch has been tested with the sample app "xdp1" located in
      samples/bpf directory for both SKB and Native (XDP) mode. The burst
      traffic generated using pktgen_sample03_burst_single_flow.sh in
      samples/pktgen directory.
      
      Changes in v3:
       - factor in xdp header and tail adjustment done by XDP program.
         Thanks to Jakub Kicinski for pointing out the gap in v2.
      
      Changes in v2:
       - fix for "warning: variable 'len' set but not used" reported by lkp.
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5fabb012
    • O
      net: stmmac: make SPH enable/disable to be configurable · d08d32d1
      Ong Boon Leong 提交于
      SPH functionality splits header and payload according to split mode and
      offsef fields (SPLM and SPLOFST). It is beneficials for Linux network
      stack RX processing however it adds a lot of complexity in XDP
      processing.
      
      So, this patch makes the split-header (SPH) capability of the controller
      is stored in "priv->sph_cap" and the enabling/disabling of SPH is decided
      by "priv->sph".
      
      This is to prepare initial XDP enabling for stmmac to disable the use of
      SPH whenever XDP is enabled.
      Signed-off-by: NOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d08d32d1
  4. 26 3月, 2021 1 次提交
  5. 25 3月, 2021 1 次提交
  6. 18 3月, 2021 1 次提交
  7. 16 3月, 2021 1 次提交
    • J
      net: stmmac: add clocks management for gmac driver · 5ec55823
      Joakim Zhang 提交于
      This patch intends to add clocks management for stmmac driver:
      
      If CONFIG_PM enabled:
      1. Keep clocks disabled after driver probed.
      2. Enable clocks when up the net device, and disable clocks when down
      the net device.
      
      If CONFIG_PM disabled:
      Keep clocks always enabled after driver probed.
      
      Note:
      1. It is fine for ethtool, since the way of implementing ethtool_ops::begin
      in stmmac is only can be accessed when interface is enabled, so the clocks
      are ticked.
      2. The MDIO bus has a different life cycle to the MAC, need ensure
      clocks are enabled when _mdio_read/write() need clocks, because these
      functions can be called while the interface it not opened.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ec55823
  8. 25 11月, 2020 1 次提交
  9. 31 10月, 2020 1 次提交
  10. 04 10月, 2020 1 次提交
    • V
      net: stmmac: Modify configuration method of EEE timers · 388e201d
      Vineetha G. Jaya Kumaran 提交于
      Ethtool manual stated that the tx-timer is the "the amount of time the
      device should stay in idle mode prior to asserting its Tx LPI". The
      previous implementation for "ethtool --set-eee tx-timer" sets the LPI TW
      timer duration which is not correct. Hence, this patch fixes the
      "ethtool --set-eee tx-timer" to configure the EEE LPI timer.
      
      The LPI TW Timer will be using the defined default value instead of
      "ethtool --set-eee tx-timer" which follows the EEE LS timer implementation.
      
      Changelog V2
      *Not removing/modifying the eee_timer.
      *EEE LPI timer can be configured through ethtool and also the eee_timer
      module param.
      *EEE TW Timer will be configured with default value only, not able to be
      configured through ethtool or module param. This follows the implementation
      of the EEE LS Timer.
      
      Fixes: d765955d ("stmmac: add the Energy Efficient Ethernet support")
      Signed-off-by: NVineetha G. Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
      Signed-off-by: NVoon Weifeng <weifeng.voon@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      388e201d
  11. 17 9月, 2020 1 次提交
  12. 16 9月, 2020 1 次提交
  13. 14 1月, 2020 1 次提交
  14. 19 12月, 2019 1 次提交
  15. 05 9月, 2019 1 次提交
  16. 18 8月, 2019 3 次提交
    • J
      net: stmmac: Add support for SA Insertion/Replacement in XGMAC cores · 8000ddc0
      Jose Abreu 提交于
      Add the support for Source Address Insertion and Replacement in XGMAC
      cores. Two methods are supported: Descriptor based and register based.
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8000ddc0
    • J
      net: stmmac: Add Split Header support and enable it in XGMAC cores · 67afd6d1
      Jose Abreu 提交于
      Add the support for Split Header feature in the RX path and enable it in
      XGMAC cores.
      
      This does not impact neither beneficts bandwidth but it does reduces CPU
      usage because without the feature all the entire packet is memcpy'ed,
      while that with the feature only the header is.
      
      With Split Header disabled 'perf stat -d' gives:
      86870.624945 task-clock (msec)      #    0.429 CPUs utilized
           1073352 context-switches       #    0.012 M/sec
                 1 cpu-migrations         #    0.000 K/sec
               213 page-faults            #    0.002 K/sec
      327113872376 cycles                 #    3.766 GHz (62.53%)
       56618161216 instructions           #    0.17  insn per cycle (75.06%)
       10742205071 branches               #  123.658 M/sec (75.36%)
         584309242 branch-misses          #    5.44% of all branches (75.19%)
       17594787965 L1-dcache-loads        #  202.540 M/sec (74.88%)
        4003773131 L1-dcache-load-misses  #   22.76% of all L1-dcache hits (74.89%)
        1313301468 LLC-loads              #   15.118 M/sec (49.75%)
         355906510 LLC-load-misses        #   27.10% of all LL-cache hits (49.92%)
      
      With Split Header enabled 'perf stat -d' gives:
      49324.456539 task-clock (msec)     #    0.245 CPUs utilized
           2542387 context-switches      #    0.052 M/sec
                 1 cpu-migrations        #    0.000 K/sec
               213 page-faults           #    0.004 K/sec
      177092791469 cycles                #    3.590 GHz (62.30%)
       68555756017 instructions          #    0.39  insn per cycle (75.16%)
       12697019382 branches              #  257.418 M/sec (74.81%)
         442081897 branch-misses         #    3.48% of all branches (74.79%)
       20337958358 L1-dcache-loads       #  412.330 M/sec (75.46%)
        3820210140 L1-dcache-load-misses #   18.78% of all L1-dcache hits (75.35%)
        1257719198 LLC-loads             #   25.499 M/sec (49.73%)
         685543923 LLC-load-misses       #   54.51% of all LL-cache hits (49.86%)
      
      Changes from v2:
      	- Reword commit message (Jakub)
      Changes from v1:
      	- Add performance info (David)
      	- Add misssing dma_sync_single_for_device()
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67afd6d1
    • J
      net: stmmac: Prepare to add Split Header support · ec222003
      Jose Abreu 提交于
      In order to add Split Header support, stmmac_rx() needs to take into
      account that packet may be split accross multiple descriptors.
      
      Refactor the logic of this function in order to support this scenario.
      
      Changes from v2:
      	- Fixup if condition detection (Jakub)
      	- Don't stop NAPI with unfinished packet (Jakub)
      	- Use napi_alloc_skb() (Jakub)
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec222003
  17. 11 8月, 2019 1 次提交
    • G
      stmmac: no need to check return value of debugfs_create functions · 8d72ab11
      Greg Kroah-Hartman 提交于
      When calling debugfs functions, there is no need to ever check the
      return value.  The function can work or not, but the code logic should
      never do something different based on this.
      
      Because we don't care about the individual files, we can remove the
      stored dentry for the files, as they are not needed to be kept track of
      at all.
      
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Jose Abreu <joabreu@synopsys.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-stm32@st-md-mailman.stormreply.com
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d72ab11
  18. 09 8月, 2019 2 次提交
  19. 10 7月, 2019 2 次提交
  20. 14 6月, 2019 2 次提交
  21. 05 6月, 2019 1 次提交
    • T
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 291 · 4fa9c49f
      Thomas Gleixner 提交于
      Based on 2 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms and conditions of the gnu general public license
        version 2 as published by the free software foundation this program
        is distributed in the hope it will be useful but without any
        warranty without even the implied warranty of merchantability or
        fitness for a particular purpose see the gnu general public license
        for more details the full gnu general public license is included in
        this distribution in the file called copying
      
        this program is free software you can redistribute it and or modify
        it under the terms and conditions of the gnu general public license
        version 2 as published by the free software foundation this program
        is distributed in the hope [that] it will be useful but without any
        warranty without even the implied warranty of merchantability or
        fitness for a particular purpose see the gnu general public license
        for more details the full gnu general public license is included in
        this distribution in the file called copying
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-only
      
      has been chosen to replace the boilerplate/reference in 57 file(s).
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAlexios Zavras <alexios.zavras@intel.com>
      Reviewed-by: NAllison Randal <allison@lohutok.net>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190529141901.515993066@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4fa9c49f
  22. 25 5月, 2019 1 次提交
    • J
      net: stmmac: Introduce selftests support · 091810db
      Jose Abreu 提交于
      We add support for selftests on stmmac driver with 9 basic sanity checks
      for now:
      	- MAC Loopback
      	- PHY Loopback
      	- MMC Counters
      	- EEE
      	- Hash Filter Multicast
      	- Perfect Filter Unicast
      	- Multicast Filter All
      	- Unicast Filter All
      	- Flow Control
      
      This allows for fast tracking of regressions in the driver and helps in
      spotting mis-configuration of HW.
      
      Changes from v1:
      	- Fix build error as module (David)
      	- Check for link status before running tests
      Changes from RFC v2:
      	- Return proper error code in stmmac_test_mmc (Corentin)
      	- Use only 1 MMC counter in stmmac_test_mmc (Alexandre)
      Changes from RFC v1:
      	- Change test_loopback to test_mac_loopback (Andrew)
      	- Change timeout to retries (Andrew)
      	- Add MC/UC filter tests (Andrew)
      	- Only test in offline mode (Andrew)
      	- Do not call phy_loopback twice (Alexandre)
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Corentin Labbe <clabbe.montjoie@gmail.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      091810db
  23. 22 2月, 2019 1 次提交
    • J
      net: stmmac: Fix NAPI poll in TX path when in multi-queue · 4ccb4585
      Jose Abreu 提交于
      Commit 8fce3331 introduced the concept of NAPI per-channel and
      independent cleaning of TX path.
      
      This is currently breaking performance in some cases. The scenario
      happens when all packets are being received in Queue 0 but the TX is
      performed in Queue != 0.
      
      Fix this by using different NAPI instances per each TX and RX queue, as
      suggested by Florian.
      
      Changes from v2:
      	- Only force restart transmission if there are pending packets
      Changes from v1:
      	- Pass entire ring size to TX clean path (Florian)
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ccb4585
  24. 23 1月, 2019 1 次提交
  25. 19 9月, 2018 1 次提交
    • J
      net: stmmac: Rework coalesce timer and fix multi-queue races · 8fce3331
      Jose Abreu 提交于
      This follows David Miller advice and tries to fix coalesce timer in
      multi-queue scenarios.
      
      We are now using per-queue coalesce values and per-queue TX timer.
      
      Coalesce timer default values was changed to 1ms and the coalesce frames
      to 25.
      
      Tested in B2B setup between XGMAC2 and GMAC5.
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Fixes: 	ce736788 ("net: stmmac: adding multiple buffers for TX")
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8fce3331
  26. 30 8月, 2018 1 次提交
    • J
      Revert "net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit" · e5133f2f
      Jerome Brunet 提交于
      This reverts commit 4ae0169f.
      
      This change in the handling of the coalesce timer is causing regression on
      (at least) amlogic platforms.
      
      Network will break down very quickly (a few seconds) after starting
      a download. This can easily be reproduced using iperf3 for example.
      
      The problem has been reported on the S805, S905, S912 and A113 SoCs
      (Realtek and Micrel PHYs) and it is likely impacting all Amlogics
      platforms using Gbit ethernet
      
      No problem was seen with the platform using 10/100 only PHYs (GXL internal)
      
      Reverting change brings things back to normal and allows to use network
      again until we better understand the problem with the coalesce timer.
      
      Cc: Jose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Vitor Soares <soares@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Corentin Labbe <clabbe@baylibre.com>
      Signed-off-by: NJerome Brunet <jbrunet@baylibre.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5133f2f
  27. 16 6月, 2018 1 次提交
  28. 04 6月, 2018 1 次提交
    • J
      net: stmmac: Add Flexible PPS support · 9a8a02c9
      Jose Abreu 提交于
      This adds support for Flexible PPS output (which is equivalent
      to per_out output of PTP subsystem).
      
      Tested using an oscilloscope and the following commands:
      
      1) Start PTP4L:
      	# ptp4l -A -4 -H -m -i eth0 &
      2) Set Flexible PPS frequency:
      	# echo <idx> <ts> <tns> <ps> <pns> > /sys/class/ptp/ptpX/period
      
      Where, ts/tns is start time and ps/pns is period time, and ptpX is ptp
      of eth0.
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Vitor Soares <soares@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a8a02c9
  29. 29 5月, 2018 1 次提交
  30. 18 5月, 2018 1 次提交