1. 22 7月, 2020 9 次提交
    • R
      net: phylink: update ethtool reporting for fixed-link modes · 1ceb7ee7
      Russell King 提交于
      Comparing the ethtool output from phylink and non-phylink fixed-link
      setups shows that we have some differences:
      
      - The "auto-negotiation" fields are different; phylink reports these
        as "No", non-phylink reports these as "Yes" for the supported and
        advertising masks.
      - The link partner advertisement is set to the link speed with non-
        phylink, but phylink leaves this unset, causing all link partner
        fields to be omitted.
      
      The phylink ethtool output also disagrees with the software emulated
      PHY dump via the MII registers.
      
      Update the phylink fixed-link parsing code so that we better reflect
      the behaviour of the non-phylink code that this facility replaces, and
      bring the ethtool interface more into line with the report from via the
      MII interface.
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ceb7ee7
    • D
      Merge branch 'enetc-Add-adaptive-interrupt-coalescing' · ccbc6dac
      David S. Miller 提交于
      Claudiu Manoil says:
      
      ====================
      enetc: Add adaptive interrupt coalescing
      
      Apart from some related cleanup patches, this set
      introduces in a straightforward way the support needed
      to enable and configure interrupt coalescing for ENETC.
      
      Patch 5 introduces the support needed for configuring the
      interrupt coalescing parameters and for switching between
      moderated (int. coalescing) and per-packet interrupt modes.
      When interrupt coalescing is enabled the Rx/Tx time
      thresholds are configurable, packet thresholds are fixed.
      To make this work reliably, patch 5 uses the traffic
      pause procedure introduced in patch 2.
      
      Patch 6 adds DIM (Dynamic Interrupt Moderation) to implement
      adaptive coalescing based on time thresholds, for the Rx 'channel'.
      On the Tx side a default optimal value is used instead, optimized for
      TCP traffic over 1G and 2.5G links.  This default 'optimal' value can
      be overridden anytime via 'ethtool -C tx-usecs'.
      
      netperf -t TCP_MAERTS measurements show a significant CPU load
      reduction correlated w/ reduced interrupt rates. For the
      measurement results refer to the comments in patch 6.
      
      v2: Replaced Tx DIM with predefined optimal value, giving
      better results. This was also suggested by Jakub (cc).
      Switched order of patches 4 and 5, for better grouping.
      
      v3: minor cleanup/improvements
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccbc6dac
    • C
      enetc: Add adaptive interrupt coalescing · ae0e6a5d
      Claudiu Manoil 提交于
      Use the generic dynamic interrupt moderation (dim)
      framework to implement adaptive interrupt coalescing
      on Rx.  With the per-packet interrupt scheme, a high
      interrupt rate has been noted for moderate traffic flows
      leading to high CPU utilization.  The 'dim' scheme
      implemented by the current patch addresses this issue
      improving CPU utilization while using minimal coalescing
      time thresholds in order to preserve a good latency.
      On the Tx side use an optimal time threshold value by
      default.  This value has been optimized for Tx TCP
      streams at a rate of around 85kpps on a 1G link,
      at which rate half of the Tx ring size (128) gets filled
      in 1500 usecs.  Scaling this down to 2.5G links yields
      the current value of 600 usecs, which is conservative
      and gives good enough results for 1G links too (see
      next).
      
      Below are some measurement results for before and after
      this patch (and related dependencies) basically, for a
      2 ARM Cortex-A72 @1.3Ghz CPUs system (32 KB L1 data cache),
      using 60secs log netperf TCP stream tests @ 1Gbit link
      (maximum throughput):
      
      1) 1 Rx TCP flow, both Rx and Tx processed by the same NAPI
      thread on the same CPU:
      	CPU utilization		int rate (ints/sec)
      Before:	50%-60% (over 50%)		92k
      After:  13%-22%				3.5k-12k
      Comment:  Major CPU utilization improvement for a single flow
      	  Rx TCP flow (i.e. netperf -t TCP_MAERTS) on a single
      	  CPU. Usually settles under 16% for longer tests.
      
      2) 4 Rx TCP flows + 4 Tx TCP flows (+ pings to check the latency):
      	Total CPU utilization	Total int rate (ints/sec)
      Before:	~80% (spikes to 90%)		~100k
      After:   60% (more steady)		  ~4k
      Comment:  Important improvement for this load test, while the
      	  ping test outcome does not show any notable
      	  difference compared to before.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ae0e6a5d
    • C
      enetc: Add interrupt coalescing support · 91571081
      Claudiu Manoil 提交于
      Enable programming of the interrupt coalescing registers
      and allow manual configuration of the coalescing time
      thresholds via ethtool.  Packet thresholds have been fixed
      to predetermined values as there's no point in making them
      run-time configurable, also anticipating the dynamic interrupt
      moderation (DIM) algorithm which uses fixed packet thresholds
      as well.  If the interface is up when the operation mode of
      traffic interrupt events is changed by the user (i.e. switching
      from default per-packet interrupts to coalesced interrupts),
      the traffic needs to be paused in the process.
      This patch also prepares the ground for introducing DIM on Rx.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      91571081
    • C
      enetc: Drop redundant ____cacheline_aligned_in_smp · 058d9cfa
      Claudiu Manoil 提交于
      'struct enetc_bdr' is already '____cacheline_aligned_in_smp'.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      058d9cfa
    • C
      enetc: Fix interrupt coalescing register naming · 12460a0a
      Claudiu Manoil 提交于
      Interrupt coalescing registers naming in the current revision
      of the Ref Man (RM) is ICR, deprecating the ICIR name used
      in earlier (draft) versions of the RM.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12460a0a
    • C
      enetc: Factor out the traffic start/stop procedures · bbb96dc7
      Claudiu Manoil 提交于
      A reliable traffic pause (and reconfiguration) procedure
      is needed to be able to safely make h/w configuration
      changes during run-time, like changing the mode in which the
      interrupts are operating (i.e. with or without coalescing),
      as opposed to making on-the-fly register updates that
      may be subject to h/w or s/w concurrency issues.
      To this end, the code responsible of the run-time device
      configurations that basically starts resp. stops the traffic
      flow through the device has been extracted from the
      the enetc_open/_close procedures, to the separate standalone
      enetc_start/_stop procedures. Traffic stop should be as
      graceful as possible, it lets the executing napi threads to
      to finish while the interrupts stay disabled.  But since
      the napi thread will try to re-enable interrupts by clearing
      the device's unmask register, the enable_irq/ disable_irq
      API has been used to avoid this potential concurrency issue
      and make the traffic pause procedure more reliable.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bbb96dc7
    • C
      enetc: Refine buffer descriptor ring sizes · 02293dd4
      Claudiu Manoil 提交于
      It's time to differentiate between Rx and Tx ring sizes.
      Not only Tx rings are processed differently than Rx rings,
      but their default number also differs - i.e. up to 8 Tx rings
      per device (8 traffic classes) vs. 2 Rx rings (one per CPU).
      So let's set Tx rings sizes to half the size of the Rx rings
      for now, to be conservative.
      The default ring sizes were decreased as well (to the next
      lower power of 2), to reduce the memory footprint, buffering
      etc., since the measurements I've made so far show that the
      rings are very unlikely to get full.
      This change also anticipates the introduction of the
      dynamic interrupt moderation (dim) algorithm which operates
      on maximum packet thresholds of 256 packets for Rx and 128
      packets for Tx.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      02293dd4
    • J
      net: mdio-mux-gpio: use devm_gpiod_get_array() · c17e3178
      Jisheng Zhang 提交于
      Use devm_gpiod_get_array() to simplify the error handling and exit
      code path.
      Signed-off-by: NJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c17e3178
  2. 21 7月, 2020 31 次提交