Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Florian Fainelli
On 12/12/2020 4:49 PM, Vladimir Oltean wrote: > On Sun, Dec 13, 2020 at 01:34:10AM +0100, Andrew Lunn wrote: >> On Sun, Dec 13, 2020 at 12:14:19AM +, Vladimir Oltean wrote: >>> On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: >> And you need some way to cleanup the allocated

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Vladimir Oltean
On Sun, Dec 13, 2020 at 01:34:10AM +0100, Andrew Lunn wrote: > On Sun, Dec 13, 2020 at 12:14:19AM +, Vladimir Oltean wrote: > > On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: > > > > > And you need some way to cleanup the allocated memory when the commit > > > > > never happens be

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Andrew Lunn
On Sun, Dec 13, 2020 at 12:14:19AM +, Vladimir Oltean wrote: > On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: > > > > And you need some way to cleanup the allocated memory when the commit > > > > never happens because some other layer has said No! > > > > > > So this would be a fa

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Vladimir Oltean
On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: > > > And you need some way to cleanup the allocated memory when the commit > > > never happens because some other layer has said No! > > > > So this would be a fatal problem with the switchdev transactional model > > if I am not misunder

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Andrew Lunn
On Sat, Dec 12, 2020 at 10:18:59PM +, Vladimir Oltean wrote: > On Sat, Dec 12, 2020 at 11:06:41PM +0100, Andrew Lunn wrote: > > > + /* Complication created by the fact that addition has two phases, but > > > + * deletion only has one phase, and we need reference counting. > > > + * The strate

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Vladimir Oltean
On Sat, Dec 12, 2020 at 11:06:41PM +0100, Andrew Lunn wrote: > > + /* Complication created by the fact that addition has two phases, but > > +* deletion only has one phase, and we need reference counting. > > +* The strategy is to do the memory allocation in the prepare phase, > > +*

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Andrew Lunn
> + /* Complication created by the fact that addition has two phases, but > + * deletion only has one phase, and we need reference counting. > + * The strategy is to do the memory allocation in the prepare phase, > + * but initialize the refcount in the commit phase. > + * >

[PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Vladimir Oltean
Currently any DSA switch that is strict when implementing the mdb operations prints these benign errors after the addresses expire, with at least 2 ports bridged: [ 286.013814] mscc_felix :00:00.5 swp3: failed (err=-2) to del object (id=3) The reason has to do with this piece of code: