net: introduce iterators over synced hw addresses
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 11 Sep 2022 01:06:57 +0000 (04:06 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 20 Sep 2022 08:32:35 +0000 (10:32 +0200)
commitdb01868bf2e919a10551066d54cf4bef5dd5a01e
tree3ed696046a184f780804245f7116762b0cb607f5
parent42e53b447cf890b10b4872c967e9f81fd2b06067
net: introduce iterators over synced hw addresses

Some network drivers use __dev_mc_sync()/__dev_uc_sync() and therefore
program the hardware only with addresses with a non-zero sync_cnt.

Some of the above drivers also need to save/restore the address
filtering lists when certain events happen, and they need to walk
through the struct net_device :: uc and struct net_device :: mc lists.
But these lists contain unsynced addresses too.

To keep the appearance of an elementary form of data encapsulation,
provide iterators through these lists that only look at entries with a
non-zero sync_cnt, instead of filtering entries out from device drivers.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/linux/netdevice.h