• Florian Fainelli's avatar
    net: systemport: Correclty disambiguate driver instances · 1f3ccc3c
    Florian Fainelli authored
    While adding the DSA notifier, we will be sending DSA notifications with
    info->master that is going to point to a particular net_device instance.
    
    Our logic in bcm_sysport_map_queues() correctly disambiguates net_device
    instances that are not covered by our own driver, but it will not make
    sure that info->master points to a particular driver instance that we
    are interested in. In a system where e.g: two or more SYSTEMPORT
    instances are registered, this would lead in programming two or more
    times the queue mapping, completely messing with the logic which does
    the queue/port allocation and tracking.
    
    Fix this by looking at the notifier_block pointer which is unique per
    instance and allows us to go back to our driver private structure, and
    in turn to the backing net_device instance.
    
    Fixes: d1565763 ("net: systemport: Establish lower/upper queue mapping")
    Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1f3ccc3c
bcmsysport.c 69.3 KB