[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a370b7c1-d4b6-7fee-0405-d3e9f9c9837b@gmail.com>
Date: Fri, 22 Oct 2021 09:32:47 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
UNGLinuxDriver@...rochip.com, DENG Qingfang <dqfext@...il.com>,
Kurt Kanzenbach <kurt@...utronix.de>,
Hauke Mehrtens <hauke@...ke-m.de>,
Woojung Huh <woojung.huh@...rochip.com>,
Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
George McCollister <george.mccollister@...il.com>,
John Crispin <john@...ozen.org>,
Aleksander Jan Bajkowski <olek2@...pl>,
Egil Hjelmeland <privat@...l-hjelmeland.no>,
Oleksij Rempel <o.rempel@...gutronix.de>,
Prasanna Vengateshan <prasanna.vengateshan@...rochip.com>,
Ansuel Smith <ansuelsmth@...il.com>,
Alvin Šipraga <alsi@...g-olufsen.dk>
Subject: Re: [PATCH v2 net-next 4/9] net: dsa: b53: serialize access to the
ARL table
On 10/22/21 7:16 AM, Vladimir Oltean wrote:
> The b53 driver performs non-atomic transactions to the ARL table when
> adding, deleting and reading FDB and MDB entries.
>
> Traditionally these were all serialized by the rtnl_lock(), but now it
> is possible that DSA calls ->port_fdb_add and ->port_fdb_del without
> holding that lock.
>
> So the driver must have its own serialization logic. Add a mutex and
> hold it from all entry points (->port_fdb_{add,del,dump},
> ->port_mdb_{add,del}).
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
Only if you need to spin a v2, small nit below:
[snip]
> + if (ret) {
> + mutex_unlock(&priv->arl_mutex);
> return ret;
I would be tempted to create an out label and have all of those tests
goto that label in case of error, just so there is a single place where
we unlock the arl_mutex.
Thanks!
--
Florian
Powered by blists - more mailing lists