1. 13 May, 2023 5 commits
    • Vladimir Nikishkin's avatar
      net: vxlan: Add nolocalbypass option to vxlan. · 69474a8a
      Vladimir Nikishkin authored
      If a packet needs to be encapsulated towards a local destination IP, the
      packet will undergo a "local bypass" and be injected into the Rx path as
      if it was received by the target VXLAN device without undergoing
      encapsulation. If such a device does not exist, the packet will be
      dropped.
      
      There are scenarios where we do not want to perform such a bypass, but
      instead want the packet to be encapsulated and locally received by a
      user space program for post-processing.
      
      To that end, add a new VXLAN device attribute that controls whether a
      "local bypass" is performed or not. Default to performing a bypass to
      maintain existing behavior.
      Signed-off-by: default avatarVladimir Nikishkin <vladimir@nikishkin.pw>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69474a8a
    • David S. Miller's avatar
      Merge branch 'broadcom-phy-wol' · 7eef636e
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      Support for Wake-on-LAN for Broadcom PHYs
      
      This patch series adds support for Wake-on-LAN to the Broadcom PHY
      driver. Specifically the BCM54210E/B50212E are capable of supporting
      Wake-on-LAN using an external pin typically wired up to a system's GPIO.
      
      These PHY operate a programmable Ethernet MAC destination address
      comparator which will fire up an interrupt whenever a match is received.
      Because of that, it was necessary to introduce patch #1 which allows the
      PHY driver's ->suspend() routine to be called unconditionally. This is
      necessary in our case because we need a hook point into the device
      suspend/resume flow to enable the wake-up interrupt as late as possible.
      
      Patch #2 adds support for the Broadcom PHY library and driver for
      Wake-on-LAN proper with the WAKE_UCAST, WAKE_MCAST, WAKE_BCAST,
      WAKE_MAGIC and WAKE_MAGICSECURE. Note that WAKE_FILTER is supportable,
      however this will require further discussions and be submitted as a RFC
      series later on.
      
      Patch #3 updates the GENET driver to defer to the PHY for Wake-on-LAN if
      the PHY supports it, thus allowing the MAC to be powered down to
      conserve power.
      
      Changes in v3:
      
      - collected Reviewed-by tags
      - explicitly use return 0 in bcm54xx_phy_probe() (Paolo)
      
      Changes in v2:
      
      - introduce PHY_ALWAYS_CALL_SUSPEND and only have the Broadcom PHY
        driver set this flag to minimize changes to the suspend flow to only
        drivers that need it
      
      - corrected possibly uninitialized variable in bcm54xx_set_wakeup_irq
        (Simon)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7eef636e
    • Florian Fainelli's avatar
      net: bcmgenet: Add support for PHY-based Wake-on-LAN · 7e400ff3
      Florian Fainelli authored
      If available, interrogate the PHY to find out whether we can use it for
      Wake-on-LAN. This can be a more power efficient way of implementing
      that feature, especially when the MAC is powered off in low power
      states.
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e400ff3
    • Florian Fainelli's avatar
      net: phy: broadcom: Add support for Wake-on-LAN · 8baddaa9
      Florian Fainelli authored
      Add support for WAKE_UCAST, WAKE_MCAST, WAKE_BCAST, WAKE_MAGIC and
      WAKE_MAGICSECURE. This is only supported with the BCM54210E and
      compatible Ethernet PHYs. Using the in-band interrupt or an out of band
      GPIO interrupts are supported.
      
      Broadcom PHYs will generate a Wake-on-LAN level low interrupt on LED4 as
      soon as one of the supported patterns is being matched. That includes
      generating such an interrupt even if the PHY is operated during normal
      modes. If WAKE_UCAST is selected, this could lead to the LED4 interrupt
      firing up for every packet being received which is absolutely
      undesirable from a performance point of view.
      
      Because the Wake-on-LAN configuration can be set long before the system
      is actually put to sleep, we cannot have an interrupt service routine to
      clear on read the interrupt status register and ensure that new packet
      matches will be detected.
      
      It is desirable to enable the Wake-on-LAN interrupt as late as possible
      during the system suspend process such that we limit the number of
      interrupts to be handled by the system, but also conversely feed into
      the Linux's system suspend way of dealing with interrupts in and around
      the points of no return.
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8baddaa9
    • Florian Fainelli's avatar
      net: phy: Allow drivers to always call into ->suspend() · a7e34480
      Florian Fainelli authored
      A few PHY drivers are currently attempting to not suspend the PHY when
      Wake-on-LAN is enabled, however that code is not currently executing at
      all due to an early check in phy_suspend().
      
      This prevents PHY drivers from making an appropriate decisions and put
      the hardware into a low power state if desired.
      
      In order to allow the PHY drivers to opt into getting their ->suspend
      routine to be called, add a PHY_ALWAYS_CALL_SUSPEND bit which can be
      set. A boolean that tracks whether the PHY or the attached MAC has
      Wake-on-LAN enabled is also provided for convenience.
      
      If phydev::wol_enabled then the PHY shall not prevent its own
      Wake-on-LAN detection logic from working and shall not prevent the
      Ethernet MAC from receiving packets for matching.
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7e34480
  2. 12 May, 2023 24 commits
  3. 11 May, 2023 11 commits