1. 09 Jun, 2016 3 commits
  2. 16 May, 2016 2 commits
    • Amir Vadai's avatar
      net/mlx5_core: Flow counters infrastructure · 43a335e0
      Amir Vadai authored
      
      
      If a counter has the aging flag set when created, it is added to a list
      of counters that will be queried periodically from a workqueue.  query
      result and last use timestamp are cached.
      add/del counter must be very efficient since thousands of such
      operations might be issued in a second.
      There is only a single reference to counters without aging, therefore
      no need for locks.
      But, counters with aging enabled are stored in a list. In order to make
      code as lockless as possible, all the list manipulation and access to
      hardware is done from a single context - the periodic counters query
      thread.
      
      The hardware supports multiple counters per FTE, however currently we
      are using one counter for each FTE.
      
      Signed-off-by: default avatarAmir Vadai <amirva@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43a335e0
    • Amir Vadai's avatar
      net/mlx5_core: Introduce flow steering destination of type counter · bd5251db
      Amir Vadai authored
      
      
      When adding a flow steering rule with a counter, need to supply a
      destination of type MLX5_FLOW_DESTINATION_TYPE_COUNTER, with a pointer
      to a struct mlx5_fc.
      Also, MLX5_FLOW_CONTEXT_ACTION_COUNT bit should be set in the action.
      
      Signed-off-by: default avatarAmir Vadai <amirva@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd5251db
  3. 04 May, 2016 1 commit
    • Mohamad Haj Yahia's avatar
      net/mlx5: Flow steering, Add vport ACL support · efdc810b
      Mohamad Haj Yahia authored
      
      
      Update the relevant flow steering device structs and commands to
      support vport.
      Update the flow steering core API to receive vport number.
      Add ingress and egress ACL flow table name spaces.
      Add ACL flow table support:
      * ACL (Access Control List) flow table is a table that contains
      only allow/drop steering rules.
      
      * We have two types of ACL flow tables - ingress and egress.
      
      * ACLs handle traffic sent from/to E-Switch FDB table, Ingress refers to
      traffic sent from Vport to E-Switch and Egress refers to traffic sent
      from E-Switch to vport.
      
      * Ingress ACL flow table allow/drop rules is checked against traffic
      sent from VF.
      
      * Egress ACL flow table allow/drop rules is checked against traffic sent
      to VF.
      
      Signed-off-by: default avatarMohamad Haj Yahia <mohamad@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      efdc810b
  4. 29 Apr, 2016 6 commits
  5. 24 Apr, 2016 2 commits
  6. 10 Mar, 2016 4 commits
  7. 11 Jan, 2016 8 commits
  8. 11 Dec, 2015 5 commits
    • Maor Gottlieb's avatar
      net/mlx5: Use flow steering infrastructure for mlx5_en · 86d722ad
      Maor Gottlieb authored
      
      
      Expose the new flow steering API and remove the old
      one.
      
      Few changes are required:
      
      1. The Ethernet flow steering follows the existing implementation, but uses
      the new steering API. The old flow steering implementation is removed.
      
      2. Move the E-switch FDB management to use the new API.
      
      3. When driver is loaded call to mlx5_init_fs which initialize
      the flow steering tree structure, open namespaces for NIC receive
      and for E-switch FDB.
      
      4. Call to mlx5_cleanup_fs when the driver is unloaded.
      
      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>
      86d722ad
    • Maor Gottlieb's avatar
      net/mlx5_core: Flow steering tree initialization · 25302363
      Maor Gottlieb authored
      
      
      Flow steering initialization is based on static tree which
      illustrates the flow steering tree when the driver is loaded. The
      initialization considers the max supported flow table level of the device,
      a minimum of 2 kernel flow tables(vlan and mac) are required to have
      kernel flow table functionality.
      
      The tree structures when the driver is loaded:
      
      		root_namespace(receive nic)
      			  |
      		priority-0 (kernel priority)
      			  |
      		namespace(kernel namespace)
      			  |
      		priority-0 (flow tables priority)
      
      In the following patches, When the EN driver will use the flow steering
      API, it create two flow tables and their flow groups under
      priority-0(flow tables 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>
      25302363
    • Maor Gottlieb's avatar
      net/mlx5_core: Introduce flow steering API · 0c56b975
      Maor Gottlieb authored
      
      
      Introducing the following objects:
      
      mlx5_flow_root_namespace: represent the root of specific flow table
      type tree(e.g NIC receive, FDB, etc..)
      
      mlx5_flow_group: define the mask of the flow specification.
      
      fs_fte(flow steering flow table entry): defines the value of the
      flow specification.
      
      The following describes the relationships between the tree objects:
      root_namespace --> priorities -->namespaces -->
      priorities -->flow-tables --> flow-groups -->
      flow-entries --> destinations
      
      When we create new object(flow table/flow group/flow table entry), we
      call to the FW command and then we add the related sw object to the tree.
      
      When we destroy object, e.g. call to mlx5_destroy_flow_table, we use
      the tree node destructor for destroying the FW object and remove the
      node from the tree.
      
      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>
      0c56b975
    • 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
    • Maor Gottlieb's avatar
      net/mlx5_core: Add flow steering base data structures · de8575e0
      Maor Gottlieb authored
      
      
      Introducing the base data structure and its operations that are
      going to represent ConnectX-4 Flow Steering, this data structure
      is basically a tree and all Flow steering objects such as
      (Flow Table/Flow Group/FTE/etc ..) are represented as fs_node(s).
      
      fs_node is the base object which describes a basic tree node, with the
      following extra info:
          type: describes the runtime type of the node (Object).
          lock: lock this node sub-tree.
          ref_count: number of children + current references.
          remove_func: a generic destructor.
      
      fs_node types will be used and explained once the usage is added in the
      following patches.
      
      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>
      de8575e0