1. 13 Aug, 2019 12 commits
  2. 03 Aug, 2019 21 commits
  3. 01 Aug, 2019 7 commits
    • Jon Maloy's avatar
      tipc: reduce risk of wakeup queue starvation · 7c5b4205
      Jon Maloy authored
      In commit 365ad353 ("tipc: reduce risk of user starvation during
      link congestion") we allowed senders to add exactly one list of extra
      buffers to the link backlog queues during link congestion (aka
      "oversubscription"). However, the criteria for when to stop adding
      wakeup messages to the input queue when the overload abates is
      inaccurate, and may cause starvation problems during very high load.
      
      Currently, we stop adding wakeup messages after 10 total failed attempts
      where we find that there is no space left in the backlog queue for a
      certain importance level. The counter for this is accumulated across all
      levels, which may lead the algorithm to leave the loop prematurely,
      although there may still be plenty of space available at some levels.
      The result is sometimes that messages near the wakeup queue tail are not
      added to the input queue as they should be.
      
      We now introduce a more exact algorithm, where we keep adding wakeup
      messages to a level as long as the backlog queue has free slots for
      the corresponding level, and stop at the moment there are no more such
      slots or when there are no more wakeup messages to dequeue.
      
      Fixes: 365ad353 ("tipc: reduce risk of user starvation during link congestion")
      Reported-by: default avatarTung Nguyen <tung.q.nguyen@dektech.com.au>
      Acked-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c5b4205
    • David S. Miller's avatar
      Merge branch 'net-dsa-mv88e6xxx-avoid-some-redundant-VTU-operations' · f7571cde
      David S. Miller authored
      Vivien Didelot says:
      
      ====================
      net: dsa: mv88e6xxx: avoid some redundant VTU operations
      
      The mv88e6xxx driver currently uses a mv88e6xxx_vtu_get wrapper to get a
      single entry and uses a boolean to eventually initialize a fresh one.
      
      However the fresh entry is only needed in one place and mv88e6xxx_vtu_getnext
      is simple enough to call it directly. Doing so makes the code easier to read,
      especially for the return code expected by switchdev to honor software VLANs.
      
      In addition to not loading the VTU again when an entry is already correctly
      programmed, this also allows to avoid programming the broadcast entries
      again when updating a port's membership, from e.g. tagged to untagged.
      
      This patch series removes the mv88e6xxx_vtu_get wrapper in favor of direct
      calls to mv88e6xxx_vtu_getnext, and also renames the _mv88e6xxx_port_vlan_add
      and _mv88e6xxx_port_vlan_del helpers using an old underscore prefix convention.
      
      In case the port's membership is already correctly programmed in hardware,
      the following debug message may be printed:
      
          [  745.989884] mv88e6085 2188000.ethernet-1:00: p4: already a member of VLAN 42
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7571cde
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_add · b1ac6fb4
      Vivien Didelot authored
      Wrapping mv88e6xxx_vtu_getnext makes the code less easy to read and
      _mv88e6xxx_port_vlan_add is the only function requiring the preparation
      of a new VLAN entry.
      
      To simplify things up, remove the mv88e6xxx_vtu_get wrapper and
      explicit the VLAN lookup in _mv88e6xxx_port_vlan_add. This rework
      also avoids programming the broadcast entries again when changing a
      port's membership, e.g. from tagged to untagged.
      
      At the same time, rename the helper using an old underscore convention.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1ac6fb4
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_del · 52109892
      Vivien Didelot authored
      Wrapping mv88e6xxx_vtu_getnext makes the code less easy to read.
      Explicit the call to mv88e6xxx_vtu_getnext in _mv88e6xxx_port_vlan_del
      and the return value expected by switchdev in case of software VLANs.
      
      At the same time, rename the helper using an old underscore convention.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52109892
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: call vtu_getnext directly in db load/purge · 5ef8d249
      Vivien Didelot authored
      mv88e6xxx_vtu_getnext is simple enough to call it directly in the
      mv88e6xxx_port_db_load_purge function and explicit the return code
      expected by switchdev for software VLANs when an hardware VLAN does
      not exist.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ef8d249
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: explicit entry passed to vtu_getnext · 425d2d37
      Vivien Didelot authored
      mv88e6xxx_vtu_getnext interprets two members from the input
      mv88e6xxx_vtu_entry structure: the (excluded) vid member to start
      the iteration from, and the valid argument specifying whether the VID
      must be written or not (only required once at the start of a loop).
      
      Explicit the assignation of these two fields right before calling
      mv88e6xxx_vtu_getnext, as it is done in the mv88e6xxx_vtu_get wrapper.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      425d2d37
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: lock mutex in vlan_prepare · 7095a4c4
      Vivien Didelot authored
      Lock the mutex in the mv88e6xxx_port_vlan_prepare function
      called by the DSA stack, instead of doing it in the internal
      mv88e6xxx_port_check_hw_vlan helper.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7095a4c4