Subject: Re: [PATCH net-next v4 03/24] switchdev: convert STP update to swdev attr set

From: Florian Fainelli <[email-masked]>
Date: Mon, 13 Apr 2015 12:22:27 -0700

On 12/04/15 23:16, [email-masked] wrote:
> From: Scott Feldman <[email-masked]>
> 
> STP update is just a writable port attribute, so convert swdev_port_stp_update
> to an attr set.
> 
> For rocker, support prepare-commit transaction model for setting STP state.
> This requires rocker to preallocate memory needed for the commit up front in
> the prepare phase.  Since rtnl_lock is held between prepare-commit, store the
> allocated memory on a queue hanging off of the rocker_port.  Also, in prepare
> phase, do everything right up to calling into HW.  The same code paths are
> tranversed in the driver for both prepare and commit phases.  In some cases,
> any state modified in the prepare phase must be reverted before returning
> so the commit phase makes the same decisions.

I now better understand the reason for introducing both the object and
transactional model, but that is really a dramatic change in the API
complexity now, and unfortunately this is reflected in the drivers using
it...

Can we try to classify switches by their underlying control/transport
bus, essentially sleeping vs. non-sleeping I/O operations and provide a
good enough abstraction from there which avoids drivers like rocker to
have to maintain a list of transactions?
-- 
Florian