Commit ea32690
net: dsa: sja1105: serialize sja1105_port_mcast_flood() with other FDB accesses
sja1105_fdb_add() runs from the dsa_owq, and sja1105_port_mcast_flood()
runs from switchdev_deferred_process_work(). Prior to the blamed commit,
they used to be indirectly serialized through the rtnl_lock(), which
no longer holds true because dsa_owq dropped that.
So, it is now possible that we traverse the static config BLK_IDX_L2_LOOKUP
elements concurrently compared to when we change them, in
sja1105_static_fdb_change(). That is not ideal, since it might result in
data corruption.
Introduce a mutex which serializes accesses to the hardware FDB and to
the static config elements for the L2 Address Lookup table.
I can't find a good reason to add locking around sja1105_fdb_dump().
I'll add it later if needed.
Fixes: 0faf890 ("net: dsa: drop rtnl_lock from dsa_slave_switchdev_event_work")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 7cef293 commit ea32690
2 files changed
+45
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1798 | 1798 | | |
1799 | 1799 | | |
1800 | 1800 | | |
| 1801 | + | |
1801 | 1802 | | |
1802 | 1803 | | |
1803 | 1804 | | |
| |||
1812 | 1813 | | |
1813 | 1814 | | |
1814 | 1815 | | |
1815 | | - | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
1816 | 1821 | | |
1817 | 1822 | | |
1818 | | - | |
1819 | | - | |
1820 | | - | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
1821 | 1826 | | |
1822 | 1827 | | |
1823 | 1828 | | |
| |||
1837 | 1842 | | |
1838 | 1843 | | |
1839 | 1844 | | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1840 | 1859 | | |
1841 | 1860 | | |
1842 | 1861 | | |
| |||
1899 | 1918 | | |
1900 | 1919 | | |
1901 | 1920 | | |
| 1921 | + | |
| 1922 | + | |
1902 | 1923 | | |
1903 | 1924 | | |
1904 | 1925 | | |
| |||
1912 | 1933 | | |
1913 | 1934 | | |
1914 | 1935 | | |
1915 | | - | |
| 1936 | + | |
1916 | 1937 | | |
1917 | 1938 | | |
1918 | 1939 | | |
| |||
1924 | 1945 | | |
1925 | 1946 | | |
1926 | 1947 | | |
1927 | | - | |
| 1948 | + | |
1928 | 1949 | | |
1929 | 1950 | | |
1930 | 1951 | | |
1931 | 1952 | | |
1932 | | - | |
| 1953 | + | |
1933 | 1954 | | |
1934 | 1955 | | |
| 1956 | + | |
| 1957 | + | |
1935 | 1958 | | |
1936 | 1959 | | |
1937 | 1960 | | |
| |||
2955 | 2978 | | |
2956 | 2979 | | |
2957 | 2980 | | |
2958 | | - | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
2959 | 2984 | | |
2960 | 2985 | | |
2961 | 2986 | | |
| |||
2968 | 2993 | | |
2969 | 2994 | | |
2970 | 2995 | | |
2971 | | - | |
| 2996 | + | |
| 2997 | + | |
2972 | 2998 | | |
2973 | 2999 | | |
2974 | 3000 | | |
2975 | 3001 | | |
2976 | 3002 | | |
2977 | 3003 | | |
2978 | 3004 | | |
2979 | | - | |
2980 | | - | |
2981 | | - | |
2982 | | - | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
2983 | 3012 | | |
2984 | 3013 | | |
2985 | 3014 | | |
| |||
3349 | 3378 | | |
3350 | 3379 | | |
3351 | 3380 | | |
| 3381 | + | |
3352 | 3382 | | |
3353 | 3383 | | |
3354 | 3384 | | |
| |||
0 commit comments