1. 30 Jun, 2018 9 commits
  2. 29 Jun, 2018 5 commits
  3. 28 Jun, 2018 15 commits
  4. 27 Jun, 2018 6 commits
  5. 26 Jun, 2018 5 commits
    • Alex Vesker's avatar
      net/mlx5: Fix command interface race in polling mode · d412c31d
      Alex Vesker authored
      The command interface can work in two modes: Events and Polling.
      In the general case, each time we invoke a command, a work is
      queued to handle it.
      
      When working in events, the interrupt handler completes the
      command execution. On the other hand, when working in polling
      mode, the work itself completes it.
      
      Due to a bug in the work handler, a command could have been
      completed by the interrupt handler, while the work handler
      hasn't finished yet, causing the it to complete once again
      if the command interface mode was changed from Events to
      polling after the interrupt handler was called.
      
      mlx5_unload_one()
              mlx5_stop_eqs()
                      // Destroy the EQ before cmd EQ
                      ...cmd_work_handler()
                              write_doorbell()
                              --> EVENT_TYPE_CMD
                                      mlx5_cmd_comp_handler() // First free
                                              free_ent(cmd, ent->idx)
                                              complete(&ent->done)
      
              <-- mlx5_stop_eqs //cmd was complete
                      // move to polling before destroying the last cmd EQ
                      mlx5_cmd_use_polling()
                              cmd->mode = POLL;
      
                      --> cmd_work_handler (continues)
                              if (cmd->mode == POLL)
                                      mlx5_cmd_comp_handler() // Double free
      
      The solution is to store the cmd->mode before writing the doorbell.
      
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Signed-off-by: default avatarAlex Vesker <valex@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      d412c31d
    • Alex Vesker's avatar
      net/mlx5: Fix incorrect raw command length parsing · 603b7bcf
      Alex Vesker authored
      The NULL character was not set correctly for the string containing
      the command length, this caused failures reading the output of the
      command due to a random length. The fix is to initialize the output
      length string.
      
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Signed-off-by: default avatarAlex Vesker <valex@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      603b7bcf
    • Shay Agroskin's avatar
      net/mlx5: Fix wrong size allocation for QoS ETC TC regitster · d14fcb8d
      Shay Agroskin authored
      The driver allocates wrong size (due to wrong struct name) when issuing
      a query/set request to NIC's register.
      
      Fixes: d8880795 ("net/mlx5e: Implement DCBNL IEEE max rate")
      Signed-off-by: default avatarShay Agroskin <shayag@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      d14fcb8d
    • Eli Cohen's avatar
      net/mlx5: Fix required capability for manipulating MPFS · f8119804
      Eli Cohen authored
      Manipulating of the MPFS requires eswitch manager capabilities.
      
      Fixes: eeb66cdb ('net/mlx5: Separate between E-Switch and MPFS')
      Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
      Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      f8119804
    • Eli Cohen's avatar
      net/mlx5: E-Switch, Disallow vlan/spoofcheck setup if not being esw manager · a8d70a05
      Eli Cohen authored
      In smartnic env, if the host (PF) driver is not an e-switch manager, we
      are not allowed to apply eswitch ports setups such as vlan (VST),
      spoof-checks, min/max rate or state.
      
      Make sure we are eswitch manager when coming to issue these callbacks
      and err otherwise.
      
      Also fix the definition of ESW_ALLOWED to rely on eswitch_manager
      capability and on the vport_group_manger.
      
      Operations on the VF nic vport context, such as setting a mac or reading
      the vport counters are allowed to the PF in this scheme.
      
      The modify nic vport guid code was modified to omit checking the
      nic_vport_node_guid_modify eswitch capability.
      The reason for doing so is that modifying node guid requires vport group
      manager capability, and there's no need to check further capabilities.
      
      1. set_vf_vlan     - disallowed
      2. set_vf_spoofchk - disallowed
      3. set_vf_mac      - allowed
      4. get_vf_config   - allowed
      5. set_vf_trust    - disallowed
      6. set_vf_rate     - disallowed
      7. get_vf_stat     - allowed
      8. set_vf_link_state - disallowed
      
      Fixes: f942380c ('net/mlx5: E-Switch, Vport ingress/egress ACLs rules for spoofchk')
      Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
      Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Tested-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      a8d70a05