lkml.org 
[lkml]   [2023]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 2/7] net: mscc: ocelot: remove struct ocelot_mm_state :: lock
On Sat, Apr 15, 2023 at 08:05:46PM +0300, Vladimir Oltean wrote:
> Unfortunately, the workarounds for the hardware bugs make it pointless
> to keep fine-grained locking for the MAC Merge state of each port.
>
> Our vsc9959_cut_through_fwd() implementation requires
> ocelot->fwd_domain_lock to be held, in order to serialize with changes
> to the bridging domains and to port speed changes (which affect which
> ports can be cut-through). Simultaneously, the traffic classes which can
> be cut-through cannot be preemptible at the same time, and this will
> depend on the MAC Merge layer state (which changes from threaded
> interrupt context).
>
> Since vsc9959_cut_through_fwd() would have to hold the mm->lock of all
> ports for a correct and race-free implementation with respect to
> ocelot_mm_irq(), in practice it means that any time a port's mm->lock is
> held, it would potentially block holders of ocelot->fwd_domain_lock.
>
> In the interest of simple locking rules, make all MAC Merge layer state
> changes (and preemptible traffic class changes) be serialized by the
> ocelot->fwd_domain_lock.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>

\
 
 \ /
  Last update: 2023-04-17 14:54    [W:0.149 / U:22.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site