1. 17 Apr, 2022 9 commits
    • Eric Dumazet's avatar
      tcp: consume incoming skb leading to a reset · d9d024f9
      Eric Dumazet authored
      Whenever tcp_validate_incoming() handles a valid RST packet,
      we should not pretend the packet was dropped.
      
      Create a special section at the end of tcp_validate_incoming()
      to handle this case.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9d024f9
    • David S. Miller's avatar
      Merge branch 'qca8k_preiv-shrink' · 7925c2d9
      David S. Miller authored
      Ansuel Smith says:
      
      ====================
      net: Reduce qca8k_priv space usage
      
      These 6 patch is a first attempt at reducting qca8k_priv space.
      The code changed a lot during times and we have many old logic
      that can be replaced with new implementation
      
      The first patch drop the tracking of MTU. We mimic what was done
      for mtk and we change MTU only when CPU port is changed.
      
      The second patch finally drop a piece of story of this driver.
      The ar8xxx_port_status struct was used by the first implementation
      of this driver to put all sort of status data for the port...
      With the evolution of DSA all that stuff got dropped till only
      the enabled state was the only part of the that struct.
      Since it's overkill to keep an array of int, we convert the variable
      to a simple u8 where we store the status of each port. This is needed
      to don't reanable ports on system resume.
      
      The third patch is a preparation for patch 4. As Vladimir explained
      in another patch, we waste a tons of space by keeping a duplicate of
      the switch dsa ops in qca8k_priv. The only reason for this is to
      dynamically set the correct mdiobus configuration (a legacy dsa one,
      or a custom dedicated one)
      To solve this problem, we just drop the phy_read/phy_write and we
      declare a custom mdiobus in any case.
      This way we can use a static dsa switch ops struct and we can drop it
      from qca8k_priv
      
      Patch 4 drop the duplicated dsa_switch_ops.
      
      Patch 5 is a fixup for mdio read error.
      
      Patch 6 is an effort to standardize how bus name are done.
      
      This series is just a start of more cleanup.
      
      The idea is to move this driver to the qca dir and split common code
      from specific code. Also the mgmt eth code still requires some love
      and can totally be optimized by recycling the same skb over time.
      
      Also while working on the MTU it was notice some problem with
      the stmmac driver and with the reloading phase that cause all
      sort of problems with qca8k.
      
      I'm sending this here just to try to keep small series instead of
      proposing monster series hard to review.
      
      v2:
      - Rework MTU patch
      v3:
      - Drop unrealated changes from patch 3
      - Add fixup patch for mdio read
      - Unify bus name for legacy and OF mdio bus
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7925c2d9
    • Ansuel Smith's avatar
      net: dsa: qca8k: unify bus id naming with legacy and OF mdio bus · 8d1af508
      Ansuel Smith authored
      Add support for multiple switch with OF mdio bus declaration.
      Unify the bus id naming and use the same logic for both legacy and OF
      mdio bus.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d1af508
    • Ansuel Smith's avatar
      net: dsa: qca8k: correctly handle mdio read error · 6cfc03b6
      Ansuel Smith authored
      Restore original way to handle mdio read error by returning 0xffff.
      This was wrongly changed when the internal_mdio_read was introduced,
      now that both legacy and internal use the same function, make sure that
      they behave the same way.
      
      Fixes: ce062a0a ("net: dsa: qca8k: fix kernel panic with legacy mdio mapping")
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6cfc03b6
    • Ansuel Smith's avatar
      net: dsa: qca8k: drop dsa_switch_ops from qca8k_priv · 2349b83a
      Ansuel Smith authored
      Now that dsa_switch_ops is not switch specific anymore, we can drop it
      from qca8k_priv and use the static ops directly for the dsa_switch
      pointer.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2349b83a
    • Ansuel Smith's avatar
      net: dsa: qca8k: rework and simplify mdiobus logic · 8255212e
      Ansuel Smith authored
      In an attempt to reduce qca8k_priv space, rework and simplify mdiobus
      logic.
      We now declare a mdiobus instead of relying on DSA phy_read/write even
      if a mdio node is not present. This is all to make the qca8k ops static
      and not switch specific. With a legacy implementation where port doesn't
      have a phy map declared in the dts with a mdio node, we declare a
      'qca8k-legacy' mdiobus. The conversion logic is used as legacy read and
      write ops are used instead of the internal one.
      Also drop the legacy_phy_port_mapping as we now declare mdiobus with ops
      that already address the workaround.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8255212e
    • Ansuel Smith's avatar
      net: dsa: qca8k: drop port_sts from qca8k_priv · 2b8fd87a
      Ansuel Smith authored
      Port_sts is a thing of the past for this driver. It was something
      present on the initial implementation of this driver and parts of the
      original struct were dropped over time. Using an array of int to store if
      a port is enabled or not to handle PM operation seems overkill. Switch
      and use a simple u8 to store the port status where each bit correspond
      to a port. (bit is set port is enabled, bit is not set, port is disabled)
      Also add some comments to better describe why we need to track port
      status.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b8fd87a
    • Ansuel Smith's avatar
      net: dsa: qca8k: drop MTU tracking from qca8k_priv · 69fd0559
      Ansuel Smith authored
      DSA set the CPU port based on the largest MTU of all the slave ports.
      Based on this we can drop the MTU array from qca8k_priv and set the
      port_change_mtu logic on DSA changing MTU of the CPU port as the switch
      have a global MTU settingfor each port.
      Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69fd0559
    • Arun Ajith S's avatar
      net/ipv6: Introduce accept_unsolicited_na knob to implement router-side changes for RFC9131 · f9a2fb73
      Arun Ajith S authored
      Add a new neighbour cache entry in STALE state for routers on receiving
      an unsolicited (gratuitous) neighbour advertisement with
      target link-layer-address option specified.
      This is similar to the arp_accept configuration for IPv4.
      A new sysctl endpoint is created to turn on this behaviour:
      /proc/sys/net/ipv6/conf/interface/accept_unsolicited_na.
      Signed-off-by: default avatarArun Ajith S <aajith@arista.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9a2fb73
  2. 15 Apr, 2022 31 commits