1. 10 Mar, 2022 31 commits
  2. 09 Mar, 2022 9 commits
    • Vladimir Oltean's avatar
      net: tcp: fix shim definition of tcp_inbound_md5_hash · 24055bb8
      Vladimir Oltean authored
      When CONFIG_TCP_MD5SIG isn't enabled, there is a compilation bug due to
      the fact that the static inline definition of tcp_inbound_md5_hash() has
      an unexpected semicolon. Remove it.
      
      Fixes: 1330b6ef ("skb: make drop reason booleanable")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20220309122012.668986-1-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      24055bb8
    • Lukas Bulwahn's avatar
      MAINTAINERS: rectify entry for REALTEK RTL83xx SMI DSA ROUTER CHIPS · 7f415828
      Lukas Bulwahn authored
      Commit 429c83c7 ("dt-bindings: net: dsa: realtek: convert to YAML
      schema, add MDIO") converts realtek-smi.txt to realtek.yaml, but missed to
      adjust its reference in MAINTAINERS.
      
      Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a
      broken reference.
      
      Repair this file reference in REALTEK RTL83xx SMI DSA ROUTER CHIPS.
      Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarAlvin Šipraga <alsi@bang-olufsen.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f415828
    • Horatiu Vultur's avatar
      net: lan966x: Add spinlock for frame transmission from CPU. · 0dbdf819
      Horatiu Vultur authored
      The registers used to inject a frame to one of the ports is shared
      between all the net devices. Therefore, there can be race conditions for
      accessing the registers when two processes send frames at the same time
      on different ports.
      
      To fix this, add a spinlock around the function
      'lan966x_port_ifh_xmit()'.
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0dbdf819
    • Changcheng Deng's avatar
      net: ethernet: sun: use min_t() to make code cleaner · 2c9ec169
      Changcheng Deng authored
      Use min_t() in order to make code cleaner.
      Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarChangcheng Deng <deng.changcheng@zte.com.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c9ec169
    • Dimitris Michailidis's avatar
      net/fungible: CONFIG_FUN_CORE needs SBITMAP · 40bb09c8
      Dimitris Michailidis authored
      fun_core.ko uses sbitmaps and needs to select SBITMAP.
      Fixes below errors:
      
      ERROR: modpost: "__sbitmap_queue_get"
      [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined!
      ERROR: modpost: "sbitmap_finish_wait"
      [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined!
      ERROR: modpost: "sbitmap_queue_clear"
      [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined!
      ERROR: modpost: "sbitmap_prepare_to_wait"
      [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined!
      ERROR: modpost: "sbitmap_queue_init_node"
      [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined!
      ERROR: modpost: "sbitmap_queue_wake_all"
      [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined!
      
      v2: correct "Fixes" SHA
      
      Fixes: 749efb1e ("net/fungible: Kconfig, Makefiles, and MAINTAINERS")
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40bb09c8
    • Dimitris Michailidis's avatar
      net/fungible: Fix local_memory_node error · cdba2490
      Dimitris Michailidis authored
      Stephen Rothwell reported the following failure on powerpc:
      
      ERROR: modpost: ".local_memory_node"
      [drivers/net/ethernet/fungible/funeth/funeth.ko] undefined!
      
      AFAICS this is because local_memory_node() is a non-inline non-exported
      function when CONFIG_HAVE_MEMORYLESS_NODES=y. It is also the wrong API
      to get a CPU's memory node. Use cpu_to_mem() in the two spots it's used.
      
      Fixes: ee6373dd ("net/funeth: probing and netdev ops")
      Fixes: db37bc17 ("net/funeth: add the data path")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarDimitris Michailidis <dmichail@fungible.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cdba2490
    • Jakub Kicinski's avatar
      skb: make drop reason booleanable · 1330b6ef
      Jakub Kicinski authored
      We have a number of cases where function returns drop/no drop
      decision as a boolean. Now that we want to report the reason
      code as well we have to pass extra output arguments.
      
      We can make the reason code evaluate correctly as bool.
      
      I believe we're good to reorder the reasons as they are
      reported to user space as strings.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1330b6ef
    • David S. Miller's avatar
      Merge branch 'dsa-next-fixups' · 11633199
      David S. Miller authored
      Vladimir Oltean says:
      
      ====================
      Incremental fixups for DSA unicast filtering
      
      There are some bugs I've discovered in the recently merged "DSA unicast
      filtering" series:
      https://patchwork.kernel.org/project/netdevbpf/cover/20220302191417.1288145-1-vladimir.oltean@nxp.com/
      
      First bug is the dereference of an uninitialized list (dp->fdbs) when
      the "initial" tag protocol is placed in the device tree for the Felix
      switch driver. This is a scenario I hadn't tested. It is handled by
      patches 1-3.
      
      Second bug is actually a sum of bugs that canceled each other out during
      my previous testing. The MAC address change of a DSA slave interface
      breaks termination for the other slave interfaces. But this actually
      does not happen if the slave interface whose address is changing is
      down. And even when up, traffic termination is still not broken because
      we fail to properly disable host flooding. Patches 4-6 handle this for
      the Felix driver (the only one benefiting from unicast filtering so far).
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      11633199
    • Vladimir Oltean's avatar
      net: dsa: felix: avoid early deletion of host FDB entries · 7e580490
      Vladimir Oltean authored
      The Felix driver declares FDB isolation but puts all standalone ports in
      VID 0. This is mostly problem-free as discussed with Alvin here:
      https://patchwork.kernel.org/project/netdevbpf/cover/20220302191417.1288145-1-vladimir.oltean@nxp.com/#24763870
      
      however there is one catch. DSA still thinks that FDB entries are
      installed on the CPU port as many times as there are user ports, and
      this is problematic when multiple user ports share the same MAC address.
      
      Consider the default case where all user ports inherit their MAC address
      from the DSA master, and then the user runs:
      
      ip link set swp0 address 00:01:02:03:04:05
      
      The above will make dsa_slave_set_mac_address() call
      dsa_port_standalone_host_fdb_add() for 00:01:02:03:04:05 in port 0's
      standalone database, and dsa_port_standalone_host_fdb_del() for the old
      address of swp0, again in swp0's standalone database.
      
      Both the ->port_fdb_add() and ->port_fdb_del() will be propagated down
      to the felix driver, which will end up deleting the old MAC address from
      the CPU port. But this is still in use by other user ports, so we end up
      breaking unicast termination for them.
      
      There isn't a problem in the fact that DSA keeps track of host
      standalone addresses in the individual database of each user port: some
      drivers like sja1105 need this. There also isn't a problem in the fact
      that some drivers choose the same VID/FID for all standalone ports.
      It is just that the deletion of these host addresses must be delayed
      until they are known to not be in use any longer, and only the driver
      has this knowledge. Since DSA keeps these addresses in &cpu_dp->fdbs and
      &cpu_db->mdbs, it is just a matter of walking over those lists and see
      whether the same MAC address is present on the CPU port in the port db
      of another user port.
      
      I have considered reusing the generic dsa_port_walk_fdbs() and
      dsa_port_walk_mdbs() schemes for this, but locking makes it difficult.
      In the ->port_fdb_add() method and co, &dp->addr_lists_lock is held, but
      dsa_port_walk_fdbs() also acquires that lock. Also, even assuming that
      we introduce an unlocked variant of the address iterator, we'd still
      need some relatively complex data structures, and a void *ctx in the
      dsa_fdb_walk_cb_t which we don't currently pass, such that drivers are
      able to figure out, after iterating, whether the same MAC address is or
      isn't present in the port db of another port.
      
      All the above, plus the fact that I expect other drivers to follow the
      same model as felix where all standalone ports use the same FID, made me
      conclude that a generic method provided by DSA is necessary:
      dsa_fdb_present_in_other_db() and the mdb equivalent. Felix calls this
      from the ->port_fdb_del() handler for the CPU port, when the database
      was classified to either a port db, or a LAG db.
      
      For symmetry, we also call this from ->port_fdb_add(), because if the
      address was installed once, then installing it a second time serves no
      purpose: it's already in hardware in VID 0 and it affects all standalone
      ports.
      
      This change moves dsa_db_equal() from switch.c to dsa.c, since it now
      has one more caller.
      
      Fixes: 54c31984 ("net: mscc: ocelot: enforce FDB isolation when VLAN-unaware")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e580490