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
470 struct mlx5_vf_context *vfs_ctx;470 struct mlx5_vf_context *vfs_ctx;
471 int num_vfs;471 int num_vfs;
472 int enabled_vfs;472 int enabled_vfs;
473 u16 max_vfs;
473};474};
474 475
475struct mlx5_fc_stats {476struct mlx5_fc_stats {
@@ -1103,13 +1104,9 @@ static inline bool mlx5_ecpf_vport_exists(struct mlx5_core_dev *dev) · 627 unmodified lines
1103 return mlx5_core_is_pf(dev) && MLX5_CAP_ESW(dev, ecpf_vport_exists);1104 return mlx5_core_is_pf(dev) && MLX5_CAP_ESW(dev, ecpf_vport_exists);
1104}1105}
1105 1106
1106#define MLX5_HOST_PF_MAX_VFS (127u)
1107static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev)1107static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev)
1108{1108{
1109 if (mlx5_core_is_ecpf_esw_manager(dev))1109 return dev->priv.sriov.max_vfs;
1110 return MLX5_HOST_PF_MAX_VFS;
1111 else
1112 return pci_sriov_get_totalvfs(dev->pdev);
1113}1110}
1114 1111
1115static inline int mlx5_get_gid_table_len(u16 param)1112static 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
9711 u8 reserved_at_8[0x8];9711 u8 reserved_at_8[0x8];
9712 u8 host_num_of_vfs[0x10];9712 u8 host_num_of_vfs[0x10];
9713 9713
9714 u8 reserved_at_20[0x10];9714 u8 host_total_vfs[0x10];
9715 u8 host_pci_bus[0x10];9715 u8 host_pci_bus[0x10];
9716 9716
9717 u8 reserved_at_40[0x10];9717 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