Subject: Re: [PATCH V3 net-next 4/4] net: marvell: prestera: implement software MDB entries allocation

From: Jakub Kicinski <[email-masked]>
Date: Thu, 30 Jun 2022 20:23:17 -0700

On Thu, 30 Jun 2022 14:18:22 +0300 Oleksandr Mazur wrote:
> Define bridge MDB entry (software entry):
>   - entry that get's created upon receiving MDB management events
>     (create/delete), that inherently defines a software entry,
>     which can be enabled (offloaded to the HW) or disabled (removed
>     from HW).
>     This separation is done to achieve a better highlevel
>     management of HW resources - software MDB entry could exist,
>     while it's not necessarily should be configured on the HW.
>     For example: by default, the Linux behavior would not replicate
>     multicast traffic to multicast group members if there's no
>     active multicast router and thus - no actual multicast traffic
>     can be received/sent. So, until multicast router appears on the
>     system no HW configuration should be applied, although SW MDB entries
>     should be tracked.
>     Another example would be altering state of 'multicast enabled' on
>     the bridge: MC_DISABLED should invoke disabling / clearing multicast
>     groups of specified bridge on the HW, yet upon receiving 'multicast
>     enabled' event, driver should reconfigure any existing software MDB
>     groups on the HW.
>     Keeping track of software MDB entries in such way makes it possible
>     to properly react on such events.
> Define bridge MDB port entry (software entry):
>   - entry that helps keeping track (on software - driver - level) of which
>     bridge mebemer interface joined any give MDB group;
> 
> Co-developed-by: Yevhen Orlov <[email-masked]>
> Signed-off-by: Yevhen Orlov <[email-masked]>
> Signed-off-by: Oleksandr Mazur <[email-masked]>

clang says no:

drivers/net/ethernet/marvell/prestera/prestera_switchdev.c:1017:11: warning: variable 'err' is uninitialized when used here [-Wuninitialized]
                        return err;
                               ^~~
drivers/net/ethernet/marvell/prestera/prestera_switchdev.c:1012:9: note: initialize the variable 'err' to silence this warning
        int err;
               ^
                = 0