• Alexandra Winter's avatar
    s390/qeth: implement ndo_bridge_setlink for learning_sync · 521c65b6
    Alexandra Winter authored
    Documentation/networking/switchdev.txt and 'man bridge' indicate that the
    learning_sync bridge attribute is used to control whether a given
    device will sync MAC addresses learned on its device port to a master
    bridge FDB, where they will show up as 'extern_learn offload'. So we map
    qeth_l2_dev2br_an_set() to the learning_sync bridge link attribute.
    
    Turning off learning_sync will flush all extern_learn entries from the
    bridge fdb and all pending events from the card's work queue.
    
    When the hardware interface goes offline with learning_sync on
    (e.g. for HW recovery), all extern_learn entries will be flushed from the
    bridge fdb and all pending events from the card's work queue. When the
    interface goes online again, it will send new notifications for all then
    valid MACs. learning_sync attribute can not be modified while interface is
    offline. See
    'commit e6e771b3 ("s390/qeth: detach netdevice while card is offline")'
    
    An alternative implementation would be to always offload the 'learning'
    attribute of a software bridge to the hardware interface attached to it
    and thus implicitly enable fdb notification. This was not chosen for 2
    reasons:
    1) In our case the software bridge is NOT a representation of a hardware
    switch. It is just connected to a smart NIC that is able to inform
    about the addresses attached to it. It is not necessarily using source
    MAC learning for this and other bridgeports can be attached to other
    NICs with different properties.
    2) We want a means to enable this notification explicitly. There may be
    cases where a bridgeport is set to 'learning', but we do not want to
    enable the notification.
    Signed-off-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
    Reviewed-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    521c65b6
qeth_l2_main.c 65.2 KB