• Vlad Buslov's avatar
    net/mlx5e: Change flow flags type to unsigned long · 226f2ca3
    Vlad Buslov authored
    To remove dependency on rtnl lock and allow concurrent modification of
    'flags' field of tc flow structure, change flow flag type to unsigned long
    and use atomic bit ops for reading and changing the flags. Implement
    auxiliary functions for setting, resetting and getting specific flag, and
    for checking most often used flag values.
    
    Always set flags with smp_mb__before_atomic() to ensure that all
    mlx5e_tc_flow are updated before concurrent readers can read new flags
    value. Rearrange all code paths to actually set flow->rule[] pointers
    before setting the OFFLOADED flag. On read side, use smp_mb__after_atomic()
    when accessing flags to ensure that offload-related flow fields are only
    read after the flags.
    Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
    Reviewed-by: default avatarJianbo Liu <jianbol@mellanox.com>
    Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    226f2ca3
en_main.c 136 KB