1. 19 Jul, 2022 1 commit
    • Horatiu Vultur's avatar
      net: lan966x: Fix taking rtnl_lock while holding spin_lock · 45533a53
      Horatiu Vultur authored
      When the HW deletes an entry in MAC table then it generates an
      interrupt. The SW will go through it's own list of MAC entries and if it
      is not found then it would notify the listeners about this. The problem
      is that when the SW will go through it's own list it would take a spin
      lock(lan966x->mac_lock) and when it notifies that the entry is deleted.
      But to notify the listeners it taking the rtnl_lock which is illegal.
      
      This is fixed by instead of notifying right away that the entry is
      deleted, move the entry on a temp list and once, it checks all the
      entries then just notify that the entries from temp list are deleted.
      
      Fixes: 5ccd66e0 ("net: lan966x: add support for interrupts from analyzer")
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      45533a53
  2. 18 Jul, 2022 36 commits
  3. 16 Jul, 2022 1 commit
    • Kuniyuki Iwashima's avatar
      tcp/udp: Make early_demux back namespacified. · 11052589
      Kuniyuki Iwashima authored
      Commit e21145a9 ("ipv4: namespacify ip_early_demux sysctl knob") made
      it possible to enable/disable early_demux on a per-netns basis.  Then, we
      introduced two knobs, tcp_early_demux and udp_early_demux, to switch it for
      TCP/UDP in commit dddb64bc ("net: Add sysctl to toggle early demux for
      tcp and udp").  However, the .proc_handler() was wrong and actually
      disabled us from changing the behaviour in each netns.
      
      We can execute early_demux if net.ipv4.ip_early_demux is on and each proto
      .early_demux() handler is not NULL.  When we toggle (tcp|udp)_early_demux,
      the change itself is saved in each netns variable, but the .early_demux()
      handler is a global variable, so the handler is switched based on the
      init_net's sysctl variable.  Thus, netns (tcp|udp)_early_demux knobs have
      nothing to do with the logic.  Whether we CAN execute proto .early_demux()
      is always decided by init_net's sysctl knob, and whether we DO it or not is
      by each netns ip_early_demux knob.
      
      This patch namespacifies (tcp|udp)_early_demux again.  For now, the users
      of the .early_demux() handler are TCP and UDP only, and they are called
      directly to avoid retpoline.  So, we can remove the .early_demux() handler
      from inet6?_protos and need not dereference them in ip6?_rcv_finish_core().
      If another proto needs .early_demux(), we can restore it at that time.
      
      Fixes: dddb64bc ("net: Add sysctl to toggle early demux for tcp and udp")
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Link: https://lore.kernel.org/r/20220713175207.7727-1-kuniyu@amazon.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      11052589
  4. 15 Jul, 2022 2 commits