1. 08 Apr, 2022 10 commits
  2. 07 Apr, 2022 2 commits
    • Volodymyr Mytnyk's avatar
      prestera: acl: add action hw_stats support · e8bd7025
      Volodymyr Mytnyk authored
      Currently, when user adds a tc action and the action gets offloaded,
      the user expects the HW stats to be counted also. This limits the
      amount of supported offloaded filters, as HW counter resources may
      be quite limited. Without counter assigned, the HW is capable to
      carry much more filters.
      
      To resolve the issue above, the following types of HW stats are
      offloaded and supported by the driver:
      
      any       - current default, user does not care about the type.
      delayed   - polled from HW periodically.
      disabled  - no HW stats needed.
      immediate - not supported.
      
      Example:
        tc filter add dev PORT ingress proto ip flower skip_sw ip_proto 0x11 \
          action drop
        tc filter add dev PORT ingress proto ip flower skip_sw ip_proto 0x12 \
          action drop hw_stats disabled
        tc filter add dev sw1p1 ingress proto ip flower skip_sw ip_proto 0x14 \
          action drop hw_stats delayed
      Signed-off-by: default avatarVolodymyr Mytnyk <vmytnyk@marvell.com>
      Link: https://lore.kernel.org/r/1649164814-18731-1-git-send-email-volodymyr.mytnyk@plvision.euSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e8bd7025
    • Niels Dossche's avatar
      ipv6: fix locking issues with loops over idev->addr_list · 51454ea4
      Niels Dossche authored
      idev->addr_list needs to be protected by idev->lock. However, it is not
      always possible to do so while iterating and performing actions on
      inet6_ifaddr instances. For example, multiple functions (like
      addrconf_{join,leave}_anycast) eventually call down to other functions
      that acquire the idev->lock. The current code temporarily unlocked the
      idev->lock during the loops, which can cause race conditions. Moving the
      locks up is also not an appropriate solution as the ordering of lock
      acquisition will be inconsistent with for example mc_lock.
      
      This solution adds an additional field to inet6_ifaddr that is used
      to temporarily add the instances to a temporary list while holding
      idev->lock. The temporary list can then be traversed without holding
      idev->lock. This change was done in two places. In addrconf_ifdown, the
      list_for_each_entry_safe variant of the list loop is also no longer
      necessary as there is no deletion within that specific loop.
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarNiels Dossche <dossche.niels@gmail.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Link: https://lore.kernel.org/r/20220403231523.45843-1-dossche.niels@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      51454ea4
  3. 06 Apr, 2022 27 commits
  4. 05 Apr, 2022 1 commit
    • Johannes Berg's avatar
      net: ensure net_todo_list is processed quickly · 0b5c21bb
      Johannes Berg authored
      In [1], Will raised a potential issue that the cfg80211 code,
      which does (from a locking perspective)
      
        rtnl_lock()
        wiphy_lock()
        rtnl_unlock()
      
      might be suspectible to ABBA deadlocks, because rtnl_unlock()
      calls netdev_run_todo(), which might end up calling rtnl_lock()
      again, which could then deadlock (see the comment in the code
      added here for the scenario).
      
      Some back and forth and thinking ensued, but clearly this can't
      happen if the net_todo_list is empty at the rtnl_unlock() here.
      Clearly, the code here cannot actually put an entry on it, and
      all other users of rtnl_unlock() will empty it since that will
      always go through netdev_run_todo(), emptying the list.
      
      So the only other way to get there would be to add to the list
      and then unlock the RTNL without going through rtnl_unlock(),
      which is only possible through __rtnl_unlock(). However, this
      isn't exported and not used in many places, and none of them
      seem to be able to unregister before using it.
      
      Therefore, add a WARN_ON() in the code to ensure this invariant
      won't be broken, so that the cfg80211 (or any similar) code
      stays safe.
      
      [1] https://lore.kernel.org/r/Yjzpo3TfZxtKPMAG@google.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Link: https://lore.kernel.org/r/20220404113847.0ee02e4a70da.Ic73d206e217db20fd22dcec14fe5442ca732804b@changeidSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0b5c21bb