1. 12 Apr, 2021 3 commits
  2. 08 Apr, 2021 13 commits
  3. 07 Apr, 2021 11 commits
  4. 04 Apr, 2021 4 commits
    • Leon Romanovsky's avatar
      net/mlx5: Implement sriov_get_vf_total_msix/count() callbacks · e71b75f7
      Leon Romanovsky authored
      The mlx5 implementation executes a firmware command on the PF to change
      the configuration of the selected VF.
      
      Link: https://lore.kernel.org/linux-pci/20210314124256.70253-5-leon@kernel.orgAcked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      e71b75f7
    • Leon Romanovsky's avatar
      net/mlx5: Dynamically assign MSI-X vectors count · 604774ad
      Leon Romanovsky authored
      The number of MSI-X vectors is a PCI property visible through lspci. The
      field is read-only and configured by the device. The mlx5 devices work in
      a static or dynamic assignment mode.
      
      Static assignment means that all newly created VFs have a preset number of
      MSI-X vectors determined by device configuration parameters. This can
      result in some VFs having too many or too few MSI-X vectors. Till now this
      has been the only means of fine-tuning the MSI-X vector count and it was
      acceptable for small numbers of VFs.
      
      With dynamic assignment the inefficiency of having a fixed number of MSI-X
      vectors can be avoided with each VF having exactly the required
      vectors. Userspace will provide this information while provisioning the VF
      for use, based on the intended use. For instance if being used with a VM,
      the MSI-X vector count might be matched to the CPU count of the VM.
      
      For compatibility mlx5 continues to start up with MSI-X vector assignment,
      but the kernel can now access a larger dynamic vector pool and assign more
      vectors to created VFs.
      
      Link: https://lore.kernel.org/linux-pci/20210314124256.70253-4-leon@kernel.orgAcked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      604774ad
    • Leon Romanovsky's avatar
      net/mlx5: Add dynamic MSI-X capabilities bits · 0b989c1e
      Leon Romanovsky authored
      These new fields declare the number of MSI-X vectors that is possible to
      allocate on the VF through PF configuration.
      
      Value must be in range defined by min_dynamic_vf_msix_table_size and
      max_dynamic_vf_msix_table_size.
      
      The driver should continue to query its MSI-X table through PCI
      configuration header.
      
      Link: https://lore.kernel.org/linux-pci/20210314124256.70253-3-leon@kernel.orgAcked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      0b989c1e
    • Leon Romanovsky's avatar
      PCI/IOV: Add sysfs MSI-X vector assignment interface · c3d5c2d9
      Leon Romanovsky authored
      A typical cloud provider SR-IOV use case is to create many VFs for use by
      guest VMs. The VFs may not be assigned to a VM until a customer requests a
      VM of a certain size, e.g., number of CPUs. A VF may need MSI-X vectors
      proportional to the number of CPUs in the VM, but there is no standard way
      to change the number of MSI-X vectors supported by a VF.
      
      Some Mellanox ConnectX devices support dynamic assignment of MSI-X vectors
      to SR-IOV VFs. This can be done by the PF driver after VFs are enabled,
      and it can be done without affecting VFs that are already in use. The
      hardware supports a limited pool of MSI-X vectors that can be assigned to
      the PF or to individual VFs.  This is device-specific behavior that
      requires support in the PF driver.
      
      Add a read-only "sriov_vf_total_msix" sysfs file for the PF and a writable
      "sriov_vf_msix_count" file for each VF. Management software may use these
      to learn how many MSI-X vectors are available and to dynamically assign
      them to VFs before the VFs are passed through to a VM.
      
      If the PF driver implements the ->sriov_get_vf_total_msix() callback,
      "sriov_vf_total_msix" contains the total number of MSI-X vectors available
      for distribution among VFs.
      
      If no driver is bound to the VF, writing "N" to "sriov_vf_msix_count" uses
      the PF driver ->sriov_set_msix_vec_count() callback to assign "N" MSI-X
      vectors to the VF.  When a VF driver subsequently reads the MSI-X Message
      Control register, it will see the new Table Size "N".
      
      Link: https://lore.kernel.org/linux-pci/20210314124256.70253-2-leon@kernel.orgAcked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      c3d5c2d9
  5. 01 Apr, 2021 9 commits