1. Apr 25, 2022
  2. Apr 23, 2022
  3. Apr 22, 2022
    • Lorenzo Bianconi's avatar
      dt-bindings: net: mediatek,net: convert to the json-schema · c78c5a66
      Lorenzo Bianconi authored
      
      
      This patch converts the existing mediatek-net.txt binding file
      in yaml format.
      
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c78c5a66
    • David S. Miller's avatar
      Merge branch 'ipv6-RT_ONLINK-remove-prep' · fb799dd4
      David S. Miller authored
      
      
      Guillaume Nault says:
      
      ====================
      ipv4: First steps toward removing RTO_ONLINK
      
      RTO_ONLINK is a flag that allows to reduce the scope of route lookups.
      It's stored in a normally unused bit of the ->flowi4_tos field, in
      struct flowi4. However it has several problems:
      
       * This bit is also used by ECN. Although ECN bits are supposed to be
         cleared before doing a route lookup, it happened that some code
         paths didn't properly sanitise their ->flowi4_tos. So this mechanism
         is fragile and we had bugs in the past where ECN bits slipped in and
         could end up being erroneously interpreted as RTO_ONLINK.
      
       * A dscp_t type was recently introduced to ensure ECN bits are cleared
         during route lookups. ->flowi4_tos is the most important structure
         field to convert, but RTO_ONLINK prevents such conversion, as dscp_t
         mandates that ECN bits (where RTO_ONLINK is stored) be zero.
      
      Therefore we need to stop using RTO_ONLINK altogether. Fortunately
      RTO_ONLINK isn't a necessity. Instead of passing a flag in ->flowi4_tos
      to tell the route lookup function to restrict the scope, we can simply
      initialise the scope correctly.
      
      Patch 1 does some preparatory work: it stops resetting ->flowi4_scope
      automatically before a route lookup, thus allowing callers to set their
      desired scope without having to rely on the RTO_ONLINK flag.
      
      Patch 2-3 convert a few code paths to avoid relying on RTO_ONLINK.
      
      More conversions will have to take place before we can eventually
      remove this flag.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fb799dd4
    • Guillaume Nault's avatar
      ipv4: Initialise ->flowi4_scope properly in ICMP handlers. · b1ad4138
      Guillaume Nault authored
      
      
      All the *_redirect() and *_update_pmtu() functions initialise their
      struct flowi4 variable with either __build_flow_key() or
      build_sk_flow_key(). When sk is provided, these functions use
      RT_CONN_FLAGS() to set ->flowi4_tos and always use RT_SCOPE_UNIVERSE
      for ->flowi4_scope. Then they rely on ip_rt_fix_tos() to adjust the
      scope based on the RTO_ONLINK bit and to mask the tos with
      IPTOS_RT_MASK.
      
      This patch modifies __build_flow_key() and build_sk_flow_key() to
      properly initialise ->flowi4_tos and ->flowi4_scope, so that the
      ICMP redirects and PMTU handlers don't need an extra call to
      ip_rt_fix_tos() before doing a fib lookup. That is, we:
      
        * Drop RT_CONN_FLAGS(): use ip_sock_rt_tos() and ip_sock_rt_scope()
          instead, so that we don't have to rely on ip_rt_fix_tos() to adjust
          the scope anymore.
      
        * Apply IPTOS_RT_MASK to the tos, so that we don't need
          ip_rt_fix_tos() to do it for us.
      
        * Drop the ip_rt_fix_tos() calls that now become useless.
      
      The only remaining ip_rt_fix_tos() caller is ip_route_output_key_hash()
      which needs it as long as external callers still use the RTO_ONLINK
      flag.
      
      Note:
        This patch also drops some useless RT_TOS() calls as IPTOS_RT_MASK is
        a stronger mask.
      
      Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1ad4138
    • Guillaume Nault's avatar
      ipv4: Avoid using RTO_ONLINK with ip_route_connect(). · 67e1e2f4
      Guillaume Nault authored
      
      
      Now that ip_rt_fix_tos() doesn't reset ->flowi4_scope unconditionally,
      we don't have to rely on the RTO_ONLINK bit to properly set the scope
      of a flowi4 structure. We can just set ->flowi4_scope explicitly and
      avoid using RTO_ONLINK in ->flowi4_tos.
      
      This patch converts callers of ip_route_connect(). Instead of setting
      the tos parameter with RT_CONN_FLAGS(sk), as all callers do, we can:
      
        1- Drop the tos parameter from ip_route_connect(): its value was
           entirely based on sk, which is also passed as parameter.
      
        2- Set ->flowi4_scope depending on the SOCK_LOCALROUTE socket option
           instead of always initialising it with RT_SCOPE_UNIVERSE (let's
           define ip_sock_rt_scope() for this purpose).
      
        3- Avoid overloading ->flowi4_tos with RTO_ONLINK: since the scope is
           now properly initialised, we don't need to tell ip_rt_fix_tos() to
           adjust ->flowi4_scope for us. So let's define ip_sock_rt_tos(),
           which is the same as RT_CONN_FLAGS() but without the RTO_ONLINK
           bit overload.
      
      Note:
        In the original ip_route_connect() code, __ip_route_output_key()
        might clear the RTO_ONLINK bit of fl4->flowi4_tos (because of
        ip_rt_fix_tos()). Therefore flowi4_update_output() had to reuse the
        original tos variable. Now that we don't set RTO_ONLINK any more,
        this is not a problem and we can use fl4->flowi4_tos in
        flowi4_update_output().
      
      Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67e1e2f4
    • Guillaume Nault's avatar
      ipv4: Don't reset ->flowi4_scope in ip_rt_fix_tos(). · 16a28267
      Guillaume Nault authored
      
      
      All callers already initialise ->flowi4_scope with RT_SCOPE_UNIVERSE,
      either by manual field assignment, memset(0) of the whole structure or
      implicit structure initialisation of on-stack variables
      (RT_SCOPE_UNIVERSE actually equals 0).
      
      Therefore, we don't need to always initialise ->flowi4_scope in
      ip_rt_fix_tos(). We only need to reduce the scope to RT_SCOPE_LINK when
      the special RTO_ONLINK flag is present in the tos.
      
      This will allow some code simplification, like removing
      ip_rt_fix_tos(). Also, the long term idea is to remove RTO_ONLINK
      entirely by properly initialising ->flowi4_scope, instead of
      overloading ->flowi4_tos with a special flag. Eventually, this will
      allow to convert ->flowi4_tos to dscp_t.
      
      Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16a28267
    • David S. Miller's avatar
      Merge branch 'zynqmp-phy-config-optional' · cb1e6bf4
      David S. Miller authored
      
      
      Radhey Shyam Pandey says:
      
      ====================
      net: macb: Make ZynqMP SGMII phy configuration optional
      
      This patchset drop phy-names property from MACB node and also make
      SGMII Phy configuration optional. The motivation for this change
      is to support traditional usescase in which first stage bootloader
      does PS-GT configuration, and should still be supported in macb
      driver.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb1e6bf4
    • Radhey Shyam Pandey's avatar
      net: macb: In ZynqMP initialization make SGMII phy configuration optional · 29e96fe9
      Radhey Shyam Pandey authored
      
      
      In the macb binding documentation "phys" is an optional property. Make
      implementation in line with it. This change allows the traditional flow
      in which first stage bootloader does PS-GT configuration to work along
      with newer use cases in which PS-GT configuration is managed by the
      phy-zynqmp driver.
      
      It fixes below macb probe failure when macb DT node doesn't have SGMII
      phys handle.
      "macb ff0b0000.ethernet: error -ENODEV: failed to get PS-GTR PHY"
      
      Signed-off-by: default avatarRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
      Reviewed-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29e96fe9
    • Radhey Shyam Pandey's avatar
      dt-bindings: net: cdns,macb: Drop phy-names property for ZynqMP SGMII PHY · 3ac8316e
      Radhey Shyam Pandey authored
      
      
      In zynqmp SGMII initialization, there is a single PHY so remove phy-names
      property as there is no real need of having it.
      
      Signed-off-by: default avatarRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ac8316e
    • David S. Miller's avatar
      Merge branch 'ipv6-only-sock' · 42d59435
      David S. Miller authored
      
      
      Kuniyuki Iwashima says:
      
      ====================
      ipv6: Use ipv6_only_sock helper function.
      
      The first patch removes __ipv6_only_sock(), and the second replaces
      ipv6only tests with ipv6_only_sock().
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42d59435
    • Kuniyuki Iwashima's avatar
      ipv6: Use ipv6_only_sock() helper in condition. · 81ee0eb6
      Kuniyuki Iwashima authored
      
      
      This patch replaces some sk_ipv6only tests with ipv6_only_sock().
      
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.co.jp>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      81ee0eb6
    • Kuniyuki Iwashima's avatar
      ipv6: Remove __ipv6_only_sock(). · 89e9c728
      Kuniyuki Iwashima authored
      Since commit 9fe516ba
      
       ("inet: move ipv6only in sock_common"),
      ipv6_only_sock() and __ipv6_only_sock() are the same macro.  Let's
      remove the one.
      
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.co.jp>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      89e9c728