Skip to content
  1. Aug 08, 2017
  2. Aug 07, 2017
    • Rabie Loulou's avatar
      net/mlx5: Increase the maximum flow counters supported · a8ffcc74
      Rabie Loulou authored
      
      
      Read new NIC capability field which represnts 16 MSBs of the max flow
      counters number supported (max_flow_counter_31_16).
      
      Backward compatibility with older firmware is preserved, the modified
      driver reads max_flow_counter_31_16 as 0 from the older firmware and
      uses up to 64K counters.
      
      Changed flow counter id from 16 bits to 32 bits. Backward compatibility
      with older firmware is preserved as we kept the 16 LSBs of the counter
      id in place and added 16 MSBs from reserved field.
      
      Changed the background bulk reading of flow counters to work in chunks
      of at most 32K counters, to make sure we don't attempt to allocate very
      large buffers.
      
      Signed-off-by: default avatarRabie Loulou <rabiel@mellanox.com>
      Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      a8ffcc74
    • Rabie Loulou's avatar
      net/mlx5: Fix counter list hardware structure · 61690e09
      Rabie Loulou authored
      The counter list hardware structure doesn't contain a clear and
      num_of_counters fields, remove them.
      
      These wrong fields were never used by the driver hence no other driver
      changes.
      
      Fixes: a351a1b0
      
       ("net/mlx5: Introduce bulk reading of flow counters")
      Signed-off-by: default avatarRabie Loulou <rabiel@mellanox.com>
      Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      61690e09
    • Erez Shitrit's avatar
      net/mlx5: Delay events till ib registration ends · 97834eba
      Erez Shitrit authored
      When mlx5_ib registers itself to mlx5_core as an interface, it will
      call mlx5_add_device which will call mlx5_ib interface add callback,
      in case the latter successfully returns, only then mlx5_core will add
      it to the interface list and async events will be forwarded to mlx5_ib.
      Between mlx5_ib interface add callback and mlx5_core adding the mlx5_ib
      interface to its devices list, arriving mlx5_core events can be missed
      by the new mlx5_ib registering interface.
      
      In other words:
      thread 1: mlx5_ib: mlx5_register_interface(dev)
      thread 1: mlx5_core: mlx5_add_device(dev)
      thread 1: mlx5_core: ctx = dev->add => (mlx5_ib)->mlx5_ib_add
      thread 2: mlx5_core_event: **new event arrives, forward to dev_list
      thread 1: mlx5_core: add_ctx_to_dev_list(ctx)
      /* previous event was missed by the new interface.*/
      It is ok to miss events before dev->add (mlx5_ib)->mlx5_ib_add_device
      but not after.
      
      We fix this race by accumulating the events that come between the
      ib_register_device (inside mlx5_add_device->(dev->add)) till the adding
      to the list completes and fire them to the new registering interface
      after that.
      
      Fixes: f1ee87fe
      
       ("net/mlx5: Organize device list API in one place")
      Signed-off-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      97834eba
    • Saeed Mahameed's avatar
      net/mlx5: Add CONFIG_MLX5_ESWITCH Kconfig · e80541ec
      Saeed Mahameed authored
      
      
      Allow to selectively build the driver with or without sriov eswitch, VF
      representors and TC offloads.
      
      Also remove the need of two ndo ops structures (sriov & basic)
      and keep only one unified ndo ops, compile out VF SRIOV ndos when not
      needed (MLX5_ESWITCH=n), and for VF netdev calling those ndos will result
      in returning -EPERM.
      
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Cc: Jes Sorensen <jsorensen@fb.com>
      Cc: kernel-team@fb.com
      e80541ec