1. 28 Jun, 2019 29 commits
  2. 27 Jun, 2019 11 commits
    • David S. Miller's avatar
      Merge tag 'blk-dim-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · d7ee2878
      David S. Miller authored
      Saeed Mamameed says:
      
      ====================
      Generic DIM
      
      From: Tal Gilboa and Yamin Fridman
      
      Implement net DIM over a generic DIM library, add RDMA DIM
      
      dim.h lib exposes an implementation of the DIM algorithm for
      dynamically-tuned interrupt moderation for networking interfaces.
      
      We want a similar functionality for other protocols, which might need to
      optimize interrupts differently. Main motivation here is DIM for NVMf
      storage protocol.
      
      Current DIM implementation prioritizes reducing interrupt overhead over
      latency. Also, in order to reduce DIM's own overhead, the algorithm might
      take some time to identify it needs to change profiles. While this is
      acceptable for networking, it might not work well on other scenarios.
      
      Here we propose a new structure to DIM. The idea is to allow a slightly
      modified functionality without the risk of breaking Net DIM behavior for
      netdev. We verified there are no degradations in current DIM behavior with
      the modified solution.
      
      Suggested solution:
      - Common logic is implemented in lib/dim/dim.c
      - Net DIM (existing) logic is implemented in lib/dim/net_dim.c, which uses
        the common logic in dim.c
      - Any new DIM logic will be implemented in "lib/dim/new_dim.c".
        This new implementation will expose modified versions of profiles,
        dim_step() and dim_decision().
      - DIM API is declared in include/linux/dim.h for all implementations.
      
      Pros for this solution are:
      - Zero impact on existing net_dim implementation and usage
      - Relatively more code reuse (compared to two separate solutions)
      - Increased extensibility
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7ee2878
    • Christian Lamparter's avatar
      net: dsa: qca8k: introduce reset via gpio feature · a653f2f5
      Christian Lamparter authored
      The QCA8337(N) has a RESETn signal on Pin B42 that
      triggers a chip reset if the line is pulled low.
      The datasheet says that: "The active low duration
      must be greater than 10 ms".
      
      This can hopefully fix some of the issues related
      to pin strapping in OpenWrt for the EA8500 which
      suffers from detection issues after a SoC reset.
      
      Please note that the qca8k_probe() function does
      currently require to read the chip's revision
      register for identification purposes.
      Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a653f2f5
    • Christian Lamparter's avatar
      dt-bindings: net: dsa: qca8k: document reset-gpios property · e7dd8a89
      Christian Lamparter authored
      This patch documents the qca8k's reset-gpios property that
      can be used if the QCA8337N ends up in a bad state during
      reset.
      Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7dd8a89
    • David Ahern's avatar
      ipv6: Convert gateway validation to use fib6_info · b2c709cc
      David Ahern authored
      Gateway validation does not need a dst_entry, it only needs the fib
      entry to validate the gateway resolution and egress device. So,
      convert ip6_nh_lookup_table from ip6_pol_route to fib6_table_lookup
      and ip6_route_check_nh to use fib6_lookup over rt6_lookup.
      
      ip6_pol_route is a call to fib6_table_lookup and if successful a call
      to fib6_select_path. From there the exception cache is searched for an
      entry or a dst_entry is created to return to the caller. The exception
      entry is not relevant for gateway validation, so what matters are the
      calls to fib6_table_lookup and then fib6_select_path.
      
      Similarly, rt6_lookup can be replaced with a call to fib6_lookup with
      RT6_LOOKUP_F_IFACE set in flags. Again, the exception cache search is
      not relevant, only the lookup with path selection. The primary difference
      in the lookup paths is the use of rt6_select with fib6_lookup versus
      rt6_device_match with rt6_lookup. When you remove complexities in the
      rt6_select path, e.g.,
      1. saddr is not set for gateway validation, so RT6_LOOKUP_F_HAS_SADDR
         is not relevant
      2. rt6_check_neigh is not called so that removes the RT6_NUD_FAIL_DO_RR
         return and round-robin logic.
      
      the code paths are believed to be equivalent for the given use case -
      validate the gateway and optionally given the device. Furthermore, it
      aligns the validation with onlink code path and the lookup path actually
      used for rx and tx.
      
      Adjust the users, ip6_route_check_nh_onlink and ip6_route_check_nh to
      handle a fib6_info vs a rt6_info when performing validation checks.
      
      Existing selftests fib-onlink-tests.sh and fib_tests.sh are used to
      verify the changes.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarWei Wang <weiwan@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2c709cc
    • David S. Miller's avatar
      Merge branch 'FDB-VLAN-and-PTP-fixes-for-SJA1105-DSA' · 5b1bf3f6
      David S. Miller authored
      Vladimir Oltean says:
      
      ====================
      FDB, VLAN and PTP fixes for SJA1105 DSA
      
      This patchset is an assortment of fixes for the net-next version of the
      sja1105 DSA driver:
      - Avoid a kernel panic when the driver fails to probe or unregisters
      - Finish Arnd Bermann's idea of compiling PTP support as part of the
        main DSA driver and not separately
      - Better handling of initial port-based VLAN as well as VLANs for
        dsa_8021q FDB entries
      - Fix address learning for the SJA1105 P/Q/R/S family
      - Make static FDB entries persistent across switch resets
      - Fix reporting of statically-added FDB entries in 'bridge fdb show'
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b1bf3f6
    • Vladimir Oltean's avatar
      net: dsa: sja1105: Implement is_static for FDB entries on E/T · d7637782
      Vladimir Oltean authored
      The first generation switches don't tell us through the dynamic config
      interface whether the dumped FDB entries are static or not (the LOCKEDS
      bit from P/Q/R/S).
      
      However, now that we're keeping a mirror of all 'bridge fdb' commands in
      the static config, this is an opportunity to compare a dumped FDB entry
      to the driver's private database.  After all, what makes an entry static
      is that *we* added it.
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7637782
    • Vladimir Oltean's avatar
      net: dsa: sja1105: Use correct dsa_8021q VIDs for FDB commands · b3ee526a
      Vladimir Oltean authored
      A FDB entry means that "frames that match this VID and DMAC must be
      forwarded to this port".
      
      In the case of dsa_8021q however, the VID is not a single one (and
      neither two, as my previous patch assumed). The VID can be set either by
      the CPU port (1 tx_vid), or by any of the other front-panel port (n-1
      rx_vid's).
      
      Fixes: 93647594 ("net: dsa: sja1105: Hide the dsa_8021q VLANs from the bridge fdb command")
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3ee526a
    • Vladimir Oltean's avatar
      net: dsa: sja1105: Populate is_static for FDB entries on P/Q/R/S · 17ae6555
      Vladimir Oltean authored
      The reason why this wasn't tackled earlier is that I had hoped I
      understood the user manual wrong.  But unfortunately hacks are required
      in order to retrieve the static/dynamic nature of FDB entries on SJA1105
      P/Q/R/S, since this info is stored in the writeback buffer of the
      dynamic config command.
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      17ae6555
    • Vladimir Oltean's avatar
      net: dsa: sja1105: Add a high-level overview of the dynamic config interface · 4a950786
      Vladimir Oltean authored
      When trying to add support for LOCKEDS (static FDB entries) on SJA1105
      P/Q/R/S, at first I didn't remember how the abstraction I created
      worked, and actually thought it works by mistake.
      
      To avoid other people staring at the code and not making much sense out
      of it, add some comments at the top of the file.
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a950786
    • Vladimir Oltean's avatar
      net: dsa: sja1105: Back up static FDB entries in kernel memory · 60f6053f
      Vladimir Oltean authored
      After commit 8456721d ("net: dsa: sja1105: Add support for
      configuring address ageing time"), we started to reset the switch rather
      often (each time the bridge core changes the ageing time on a switch
      port).
      
      The unfortunate reality is that SJA1105 doesn't have any {cold, warm,
      whatever} reset mode in which it accepts a new configuration stream
      without flushing the FDB.  Instead, in its world, the FDB *is* an
      optional part of the static configuration.
      
      So we play its game, and do what we also do for VLANs: for each 'bridge
      fdb' command, we add the FDB entry through the dynamic interface, and we
      append the in-kernel static config memory with info that we're going to
      use later, when the next reset command is going to be issued.
      
      The result is that 'bridge fdb' commands are now persistent (dynamically
      learned entries are lost, but that's ok).
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60f6053f
    • Vladimir Oltean's avatar
      net: dsa: sja1105: Make P/Q/R/S learn MAC addresses · 6c56e167
      Vladimir Oltean authored
      At the end of the commit 1da73821 ("net: dsa: sja1105: Add FDB
      operations for P/Q/R/S series") message, I said that:
      
          At the moment only FDB entries installed statically through 'bridge fdb'
          are visible in the dump callback - the dynamically learned ones are
          still under investigation.
      
      It looks like the reason why they were not visible in 'bridge fdb' was
      that they were never learned - always flooded.
      
      SJA1105 P/Q/R/S manual says about the MAXADDRP[port] field:
      
          Specify the maximum number of MAC address dynamically learned from
          the respective port. It is used to limit the number of learned MAC
          addresses per port.
      
      It looks like not providing a value in the static config (aka providing
      zeroes) is enough for it to not store the learned addresses in the FDB.
      
      For now we divide the 1024 entry FDB "equally" amongst the 5 ports. This
      may be revisited if the situation calls for that - for now I'm happy
      that learning works.
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c56e167