1. 17 9月, 2019 14 次提交
    • D
      Merge branch 'ethtool-implement-Energy-Detect-Powerdown-support-via-phy-tunable' · 1b8da103
      David S. Miller 提交于
      Alexandru Ardelean says:
      
      ====================
      ethtool: implement Energy Detect Powerdown support via phy-tunable
      
      This changeset proposes a new control for PHY tunable to control Energy
      Detect Power Down.
      
      The `phy_tunable_id` has been named `ETHTOOL_PHY_EDPD` since it looks like
      this feature is common across other PHYs (like EEE), and defining
      `ETHTOOL_PHY_ENERGY_DETECT_POWER_DOWN` seems too long.
      
      The way EDPD works, is that the RX block is put to a lower power mode,
      except for link-pulse detection circuits. The TX block is also put to low
      power mode, but the PHY wakes-up periodically to send link pulses, to avoid
      lock-ups in case the other side is also in EDPD mode.
      
      Currently, there are 2 PHY drivers that look like they could use this new
      PHY tunable feature: the `adin` && `micrel` PHYs.
      
      This series updates only the `adin` PHY driver to support this new feature,
      as this chip has been tested. A change for `micrel` can be proposed after a
      discussion of the PHY-tunable API is resolved.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b8da103
    • A
      net: phy: adin: implement Energy Detect Powerdown mode via phy-tunable · 65d7be09
      Alexandru Ardelean 提交于
      This driver becomes the first user of the kernel's `ETHTOOL_PHY_EDPD`
      phy-tunable feature.
      EDPD is also enabled by default on PHY config_init, but can be disabled via
      the phy-tunable control.
      
      When enabling EDPD, it's also a good idea (for the ADIN PHYs) to enable TX
      periodic pulses, so that in case the other PHY is also on EDPD mode, there
      is no lock-up situation where both sides are waiting for the other to
      transmit.
      
      Via the phy-tunable control, TX pulses can be disabled if specifying 0
      `tx-interval` via ethtool.
      
      The ADIN PHY supports only fixed 1 second intervals; they cannot be
      configured. That is why the acceptable values are 1,
      ETHTOOL_PHY_EDPD_DFLT_TX_MSECS and ETHTOOL_PHY_EDPD_NO_TX (which disables
      TX pulses).
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65d7be09
    • A
      ethtool: implement Energy Detect Powerdown support via phy-tunable · 9f2f13f4
      Alexandru Ardelean 提交于
      The `phy_tunable_id` has been named `ETHTOOL_PHY_EDPD` since it looks like
      this feature is common across other PHYs (like EEE), and defining
      `ETHTOOL_PHY_ENERGY_DETECT_POWER_DOWN` seems too long.
      
      The way EDPD works, is that the RX block is put to a lower power mode,
      except for link-pulse detection circuits. The TX block is also put to low
      power mode, but the PHY wakes-up periodically to send link pulses, to avoid
      lock-ups in case the other side is also in EDPD mode.
      
      Currently, there are 2 PHY drivers that look like they could use this new
      PHY tunable feature: the `adin` && `micrel` PHYs.
      
      The ADIN's datasheet mentions that TX pulses are at intervals of 1 second
      default each, and they can be disabled. For the Micrel KSZ9031 PHY, the
      datasheet does not mention whether they can be disabled, but mentions that
      they can modified.
      
      The way this change is structured, is similar to the PHY tunable downshift
      control:
      * a `ETHTOOL_PHY_EDPD_DFLT_TX_MSECS` value is exposed to cover a default
        TX interval; some PHYs could specify a certain value that makes sense
      * `ETHTOOL_PHY_EDPD_NO_TX` would disable TX when EDPD is enabled
      * `ETHTOOL_PHY_EDPD_DISABLE` will disable EDPD
      
      As noted by the `ETHTOOL_PHY_EDPD_DFLT_TX_MSECS` the interval unit is 1
      millisecond, which should cover a reasonable range of intervals:
       - from 1 millisecond, which does not sound like much of a power-saver
       - to ~65 seconds which is quite a lot to wait for a link to come up when
         plugging a cable
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9f2f13f4
    • M
      s390/ctcm: Delete unnecessary checks before the macro call “dev_kfree_skb” · 56a4e37e
      Markus Elfring 提交于
      The dev_kfree_skb() function performs also input parameter validation.
      Thus the test around the shown calls is not needed.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      56a4e37e
    • D
      Merge branch 'drop_monitor-Better-sanitize-notified-packets' · f432c2e3
      David S. Miller 提交于
      Ido Schimmel says:
      
      ====================
      drop_monitor: Better sanitize notified packets
      
      When working in 'packet' mode, drop monitor generates a notification
      with a potentially truncated payload of the dropped packet. The payload
      is copied from the MAC header, but I forgot to check that the MAC header
      was set, so do it now.
      
      Patch #1 sets the offsets to the various protocol layers in netdevsim,
      so that it will continue to work after the MAC header check is added to
      drop monitor in patch #2.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f432c2e3
    • I
      drop_monitor: Better sanitize notified packets · bef17466
      Ido Schimmel 提交于
      When working in 'packet' mode, drop monitor generates a notification
      with a potentially truncated payload of the dropped packet. The payload
      is copied from the MAC header, but I forgot to check that the MAC header
      was set, so do it now.
      
      Fixes: ca30707d ("drop_monitor: Add packet alert mode")
      Fixes: 5e58109b ("drop_monitor: Add support for packet alert mode for hardware drops")
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bef17466
    • I
      netdevsim: Set offsets to various protocol layers · 58a406de
      Ido Schimmel 提交于
      The driver periodically generates "trapped" UDP packets that it then
      passes on to devlink. Set the offsets to the various protocol layers.
      
      This is a prerequisite to the next patch, where drop monitor is taught
      to check that the offset to the MAC header was set.
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58a406de
    • D
      Merge branch 'tc-taprio-offload-for-SJA1105-DSA' · db539cae
      David S. Miller 提交于
      Vladimir Oltean says:
      
      ====================
      tc-taprio offload for SJA1105 DSA
      
      This is the third attempt to submit the tc-taprio offload model for
      inclusion in the networking tree. The sja1105 switch driver will provide
      the first implementation of the offload. Only the bare minimum is added:
      
      - The offload model and a DSA pass-through
      - The hardware implementation
      - The interaction with the netdev queues in the tagger code
      - Documentation
      
      What has been removed from previous attempts is support for
      PTP-as-clocksource in sja1105, as well as configuring the traffic class
      for management traffic.  These will be added as soon as the offload
      model is settled.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db539cae
    • V
      docs: net: dsa: sja1105: Add info about the Time-Aware Scheduler · 7c95afa4
      Vladimir Oltean 提交于
      While not an exhaustive usage tutorial, this describes the details
      needed to build more complex scenarios.
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c95afa4
    • V
      net: dsa: sja1105: Configure the Time-Aware Scheduler via tc-taprio offload · 317ab5b8
      Vladimir Oltean 提交于
      This qdisc offload is the closest thing to what the SJA1105 supports in
      hardware for time-based egress shaping. The switch core really is built
      around SAE AS6802/TTEthernet (a TTTech standard) but can be made to
      operate similarly to IEEE 802.1Qbv with some constraints:
      
      - The gate control list is a global list for all ports. There are 8
        execution threads that iterate through this global list in parallel.
        I don't know why 8, there are only 4 front-panel ports.
      
      - Care must be taken by the user to make sure that two execution threads
        never get to execute a GCL entry simultaneously. I created a O(n^4)
        checker for this hardware limitation, prior to accepting a taprio
        offload configuration as valid.
      
      - The spec says that if a GCL entry's interval is shorter than the frame
        length, you shouldn't send it (and end up in head-of-line blocking).
        Well, this switch does anyway.
      
      - The switch has no concept of ADMIN and OPER configurations. Because
        it's so simple, the TAS settings are loaded through the static config
        tables interface, so there isn't even place for any discussion about
        'graceful switchover between ADMIN and OPER'. You just reset the
        switch and upload a new OPER config.
      
      - The switch accepts multiple time sources for the gate events. Right
        now I am using the standalone clock source as opposed to PTP. So the
        base time parameter doesn't really do much. Support for the PTP clock
        source will be added in a future series.
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      317ab5b8
    • V
      net: dsa: sja1105: Advertise the 8 TX queues · 5f06c63b
      Vladimir Oltean 提交于
      This is a preparation patch for the tc-taprio offload (and potentially
      for other future offloads such as tc-mqprio).
      
      Instead of looking directly at skb->priority during xmit, let's get the
      netdev queue and the queue-to-traffic-class mapping, and put the
      resulting traffic class into the dsa_8021q PCP field. The switch is
      configured with a 1-to-1 PCP-to-ingress-queue-to-egress-queue mapping
      (see vlan_pmap in sja1105_main.c), so the effect is that we can inject
      into a front-panel's egress traffic class through VLAN tagging from
      Linux, completely transparently.
      
      Unfortunately the switch doesn't look at the VLAN PCP in the case of
      management traffic to/from the CPU (link-local frames at
      01-80-C2-xx-xx-xx or 01-1B-19-xx-xx-xx) so we can't alter the
      transmission queue of this type of traffic on a frame-by-frame basis. It
      is only selected through the "hostprio" setting which ATM is harcoded in
      the driver to 7.
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5f06c63b
    • V
      net: dsa: sja1105: Add static config tables for scheduling · 7f1e4ba8
      Vladimir Oltean 提交于
      In order to support tc-taprio offload, the TTEthernet egress scheduling
      core registers must be made visible through the static interface.
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7f1e4ba8
    • V
      net: dsa: Pass ndo_setup_tc slave callback to drivers · 47d23af2
      Vladimir Oltean 提交于
      DSA currently handles shared block filters (for the classifier-action
      qdisc) in the core due to what I believe are simply pragmatic reasons -
      hiding the complexity from drivers and offerring a simple API for port
      mirroring.
      
      Extend the dsa_slave_setup_tc function by passing all other qdisc
      offloads to the driver layer, where the driver may choose what it
      implements and how. DSA is simply a pass-through in this case.
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Acked-by: NKurt Kanzenbach <kurt@linutronix.de>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47d23af2
    • V
      taprio: Add support for hardware offloading · 9c66d156
      Vinicius Costa Gomes 提交于
      This allows taprio to offload the schedule enforcement to capable
      network cards, resulting in more precise windows and less CPU usage.
      
      The gate mask acts on traffic classes (groups of queues of same
      priority), as specified in IEEE 802.1Q-2018, and following the existing
      taprio and mqprio semantics.
      It is up to the driver to perform conversion between tc and individual
      netdev queues if for some reason it needs to make that distinction.
      
      Full offload is requested from the network interface by specifying
      "flags 2" in the tc qdisc creation command, which in turn corresponds to
      the TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD bit.
      
      The important detail here is the clockid which is implicitly /dev/ptpN
      for full offload, and hence not configurable.
      
      A reference counting API is added to support the use case where Ethernet
      drivers need to keep the taprio offload structure locally (i.e. they are
      a multi-port switch driver, and configuring a port depends on the
      settings of other ports as well). The refcount_t variable is kept in a
      private structure (__tc_taprio_qopt_offload) and not exposed to drivers.
      
      In the future, the private structure might also be expanded with a
      backpointer to taprio_sched *q, to implement the notification system
      described in the patch (of when admin became oper, or an error occurred,
      etc, so the offload can be monitored with 'tc qdisc show').
      Signed-off-by: NVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: NVoon Weifeng <weifeng.voon@intel.com>
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c66d156
  2. 16 9月, 2019 25 次提交
  3. 15 9月, 2019 1 次提交