History

net/mlx5: Don't handle VF func change if host PF is disabled

When ECPF eswitch manager is at offloads mode, it monitors functions changed event from host PF side and acts according to the number of VFs enabled/disabled. As ECPF and host PF work in two independent hosts, it's possible that host PF OS reboots but ECPF system is still kept on and continues monitoring events from host PF. When kernel from host PF side is booting, PCI iov driver does sriov_init and compute_max_vf_buses by iterating over all valid num of VFs. This triggers FLR and generates functions changed events, even though host PF HCA is not enabled at this time. However, ECPF is not aware of this information, and still handles these events as usual. ECPF system will see massive number of reps are created, but destroyed immediately once creation finished. To eliminate this noise, a bit is added to host parameter context to indicate host PF is disabled. ECPF will not handle the VF changed event if this bit is set.

Bodong Wang committed 7 years ago

Commit 5ccf2771 parent 7e26dac2 files · +6 −2Browse files

Unified · Split

2 files
  1. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +4 −1
  2. include/linux/mlx5/mlx5_ifc.h +2 −1
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+4−1
@@ -2026,6 +2026,7 @@ static void esw_functions_changed_event_handler(struct work_struct *work) · 2025 unmodified lines
2026 u32 out[MLX5_ST_SZ_DW(query_esw_functions_out)] = {};2026 u32 out[MLX5_ST_SZ_DW(query_esw_functions_out)] = {};
2027 struct mlx5_host_work *host_work;2027 struct mlx5_host_work *host_work;
2028 struct mlx5_eswitch *esw;2028 struct mlx5_eswitch *esw;
2029 bool host_pf_disabled;
2029 u16 num_vfs = 0;2030 u16 num_vfs = 0;
2030 int err;2031 int err;
2031 2032
@@ -2035,7 +2036,9 @@ static void esw_functions_changed_event_handler(struct work_struct *work) · 3 unmodified lines
2035 err = mlx5_esw_query_functions(esw->dev, out, sizeof(out));2036 err = mlx5_esw_query_functions(esw->dev, out, sizeof(out));
2036 num_vfs = MLX5_GET(query_esw_functions_out, out,2037 num_vfs = MLX5_GET(query_esw_functions_out, out,
2037 host_params_context.host_num_of_vfs);2038 host_params_context.host_num_of_vfs);
2038 if (err || num_vfs == esw->esw_funcs.num_vfs)2039 host_pf_disabled = MLX5_GET(query_esw_functions_out, out,
2040 host_params_context.host_pf_disabled);
2041 if (err || host_pf_disabled || num_vfs == esw->esw_funcs.num_vfs)
2039 goto out;2042 goto out;
2040 2043
2041 /* Number of VFs can only change from "0 to x" or "x to 0". */2044 /* Number of VFs can only change from "0 to x" or "x to 0". */
include/linux/mlx5/mlx5_ifc.h+2−1
@@ -9823,7 +9823,8 @@ struct mlx5_ifc_mtrc_ctrl_bits { · 9822 unmodified lines
9823 9823
9824struct mlx5_ifc_host_params_context_bits {9824struct mlx5_ifc_host_params_context_bits {
9825 u8 host_number[0x8];9825 u8 host_number[0x8];
9826 u8 reserved_at_8[0x8];9826 u8 reserved_at_8[0x7];
9827 u8 host_pf_disabled[0x1];
9827 u8 host_num_of_vfs[0x10];9828 u8 host_num_of_vfs[0x10];
9828 9829
9829 u8 host_total_vfs[0x10];9830 u8 host_total_vfs[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