History

net/mlx5: Support querying max VFs from device

For ECPF with eswitch manager privilege, query the host max VF count by querying the device using query_functions command. With this enhancement: 1. flow steering entries are created only for valid vports based on the max VF count of the PF. 2. Driver only queries cap of valid vport. Eswitch requires the max VFs when doing initialization, so do sr-iov init before eswitch init.

Bodong Wang committed 7 years ago

Commit 86eec501 parent 10ee82c4 files · +34 −15Browse files

Showing the changes to include/linux (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/mlx5/driver.h +2 −5
  2. include/linux/mlx5/mlx5_ifc.h +1 −1
include/linux/mlx5/driver.h+2−5
@@ -470,6 +470,7 @@ struct mlx5_core_sriov { · 469 unmodified lines
470470 struct mlx5_vf_context *vfs_ctx;
471471 int num_vfs;
472472 int enabled_vfs;
473+ u16 max_vfs;
473474 };
474475
475476 struct mlx5_fc_stats {
@@ -1103,13 +1104,9 @@ static inline bool mlx5_ecpf_vport_exists(struct mlx5_core_dev *dev) · 627 unmodified lines
11031104 return mlx5_core_is_pf(dev) && MLX5_CAP_ESW(dev, ecpf_vport_exists);
11041105 }
11051106
1106−#define MLX5_HOST_PF_MAX_VFS (127u)
11071107 static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev)
11081108 {
1109− if (mlx5_core_is_ecpf_esw_manager(dev))
1110− return MLX5_HOST_PF_MAX_VFS;
1111− else
1112− return pci_sriov_get_totalvfs(dev->pdev);
1109+ return dev->priv.sriov.max_vfs;
11131110 }
11141111
11151112 static inline int mlx5_get_gid_table_len(u16 param)
include/linux/mlx5/mlx5_ifc.h+1−1
@@ -9711,7 +9711,7 @@ struct mlx5_ifc_host_params_context_bits { · 9710 unmodified lines
97119711 u8 reserved_at_8[0x8];
97129712 u8 host_num_of_vfs[0x10];
97139713
9714− u8 reserved_at_20[0x10];
9714+ u8 host_total_vfs[0x10];
97159715 u8 host_pci_bus[0x10];
97169716
97179717 u8 reserved_at_40[0x10];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t