Skip to content
  • Jarno Rajahalme's avatar
    mirror: Allow concurrent lookups. · 4f678069
    Jarno Rajahalme authored
    
    
    Handler threads use a selection of mirror functions with the
    assumption that the data referred to is RCU protected, while the
    implementation has not provided for this, which can lead to an OVS
    crash.
    
    This patch fixes this by making the mbundle lookup RCU-safe by using
    cmap instead of hmap and postponing mbundle memory free, as wells as
    postponing the frees of the mirrors and the vlan bitmaps of each
    mirror.
    
    Note that mirror stats update is still not accurate if multiple
    threads do it simultaneously.
    
    A less complete version of this patch (using cmap and RCU postpone
    just for the mbridge itself) was tested by Yunjian Wang and was found
    to fix the observed crash when running a script that adds and deletes
    a port repeatedly.
    
    Reported-by: default avatarYunjian Wang <wangyunjian@huawei.com>
    Signed-off-by: default avatarJarno Rajahalme <jarno@ovn.org>
    4f678069