Skip to content
  • Maor Gottlieb's avatar
    net/mlx5_core: Add flow steering lookup algorithms · 5e1626c0
    Maor Gottlieb authored
    
    
    Introduce the flow steering mlx5_flow_namespace (Namespace)
    and fs_prio (Flow Steering Priority) tree nodes.
    
    Namespaces are used in order to isolate different usages or types
    of steering (for example, downstream patches will add a different
    namespaces for the NIC driver and for E-Switch FDB usages).
    
    Flow Steering Priorities are objects that describes priorities
    ranges between different flow objects under the same namespace.
    
    Example, entries in priority i are matched before entries
    in priority i+1.
    
    This patch adds the following algorithms:
    
    1) Calculate level:
    Each flow table has level(the priority between the flow tables).
    When we initialize the flow steering tree, we assign range of levels
    to each priority, therefore the level for new flow table is
    the location within the priority related to the range of the priority.
    
    2) Match between match criteria. This function is used
    for searching flow group when new flow rule is added.
    
    3) Match between match values. This function is used
    for searching flow table entry  when new flow rule is added.
    
    4) Add essential macros for traversing on a node's children.
    E.g. traversing on all the flow table of some priority
    
    Signed-off-by: default avatarMaor Gottlieb <maorg@mellanox.com>
    Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
    Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5e1626c0