Skip to content
  • Vlad Buslov's avatar
    net/mlx5e: Extend mod header entry with reference counter · dd58edc3
    Vlad Buslov authored
    
    
    List of flows attached to mod header entry is used as implicit reference
    counter (mod header entry is deallocated when list becomes free) and as a
    mechanism to obtain mod header entry that flow is attached to (through list
    head). This is not safe when concurrent modification of list of flows
    attached to mod header entry is possible. Proper atomic reference counter
    is required to support concurrent access.
    
    As a preparation for extending mod header with reference counting, extract
    code that lookups and deletes mod header entry into standalone put/get
    helpers. In order to remove this dependency on external locking, extend mod
    header entry with reference counter to manage its lifetime and extend flow
    structure with direct pointer to mod header entry that flow is attached to.
    
    To remove code duplication between legacy and switchdev mode
    implementations that both support mod_hdr functionality, store mod_hdr
    table in dedicated structure used by both fdb and kernel namespaces. New
    table structure is extended with table lock by one of the following patches
    in this series. Implement helper function to get correct mod_hdr table
    depending on flow namespace.
    
    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>
    dd58edc3