diff options
| author | Thierry Reding <treding@nvidia.com> | 2026-04-30 10:17:32 +0200 |
|---|---|---|
| committer | Thierry Reding <treding@nvidia.com> | 2026-04-30 10:17:32 +0200 |
| commit | 356a194f49f6c9e19f08f6435c23ed18eb828585 (patch) | |
| tree | a2083d996146e7e0ff2279f9211c11936fffdabe | |
| parent | 90cf8d60697d9b5e7f9af6c150f298f27b5c4ceb (diff) | |
| parent | 02c54621e81ccdc1907e2d735bcda751f2caade1 (diff) | |
| download | linux-next-356a194f49f6c9e19f08f6435c23ed18eb828585.tar.gz | |
Merge branch 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git
| -rw-r--r-- | drivers/infiniband/hw/mlx5/counters.c | 4 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c | 7 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 36 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 42 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/sf/mlx5_ifc_vhca_event.h | 8 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 7 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c | 2 | ||||
| -rw-r--r-- | include/linux/mlx5/eswitch.h | 2 | ||||
| -rw-r--r-- | include/linux/mlx5/mlx5_ifc.h | 73 | ||||
| -rw-r--r-- | include/linux/mlx5/vport.h | 4 |
12 files changed, 130 insertions, 59 deletions
diff --git a/drivers/infiniband/hw/mlx5/counters.c b/drivers/infiniband/hw/mlx5/counters.c index 5b4482dd62743..5a79e834ddea0 100644 --- a/drivers/infiniband/hw/mlx5/counters.c +++ b/drivers/infiniband/hw/mlx5/counters.c @@ -697,7 +697,7 @@ static void mlx5_ib_fill_counters(struct mlx5_ib_dev *dev, u32 port_num) { bool is_vport = is_mdev_switchdev_mode(dev->mdev) && - port_num != MLX5_VPORT_PF; + port_num != MLX5_VPORT_HOST_PF; const struct mlx5_ib_counter *names; int j = 0, i, size; @@ -802,7 +802,7 @@ static int __mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev, struct mlx5_ib_counters *cnts, u32 port_num) { bool is_vport = is_mdev_switchdev_mode(dev->mdev) && - port_num != MLX5_VPORT_PF; + port_num != MLX5_VPORT_HOST_PF; u32 num_counters, num_op_counters = 0, size; size = is_vport ? ARRAY_SIZE(vport_basic_q_cnts) : diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c index e1d11326af1bb..8a79764345e7e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c @@ -13,7 +13,8 @@ mlx5_esw_get_port_parent_id(struct mlx5_core_dev *dev, struct netdev_phys_item_i static bool mlx5_esw_devlink_port_supported(struct mlx5_eswitch *esw, u16 vport_num) { - return (mlx5_core_is_ecpf(esw->dev) && vport_num == MLX5_VPORT_PF) || + return (mlx5_core_is_ecpf(esw->dev) && + vport_num == MLX5_VPORT_HOST_PF) || mlx5_eswitch_is_vf_vport(esw, vport_num) || mlx5_core_is_ec_vf_vport(esw->dev, vport_num); } @@ -35,7 +36,7 @@ static void mlx5_esw_offloads_pf_vf_devlink_port_attrs_set(struct mlx5_eswitch * if (external) controller_num = dev->priv.eswitch->offloads.host_number + 1; - if (vport_num == MLX5_VPORT_PF) { + if (vport_num == MLX5_VPORT_HOST_PF) { memcpy(dl_port->attrs.switch_id.id, ppid.id, ppid.id_len); dl_port->attrs.switch_id.id_len = ppid.id_len; devlink_port_attrs_pci_pf_set(dl_port, controller_num, pfnum, external); @@ -216,7 +217,7 @@ int mlx5_esw_offloads_devlink_port_register(struct mlx5_eswitch *esw, struct mlx if (err) goto rate_err; - if (vport_num == MLX5_VPORT_PF) { + if (vport_num == MLX5_VPORT_HOST_PF) { err = mlx5_esw_devlink_port_res_register(esw, &dl_port->dl_port); if (err) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c index da10e04777cf7..8b12c3ae0cf79 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec.c @@ -209,7 +209,7 @@ static int esw_ipsec_vf_offload_set_bytype(struct mlx5_eswitch *esw, struct mlx5 struct mlx5_core_dev *dev = esw->dev; int err; - if (vport->vport == MLX5_VPORT_PF) + if (vport->vport == MLX5_VPORT_HOST_PF) return -EOPNOTSUPP; if (type == MLX5_ESW_VPORT_IPSEC_CRYPTO_OFFLOAD) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 8ec52498be3f1..66a773a998768 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -926,7 +926,7 @@ int mlx5_esw_vport_enable(struct mlx5_eswitch *esw, struct mlx5_vport *vport, /* Sync with current vport context */ vport->enabled_events = enabled_events; vport->enabled = true; - if (vport->vport != MLX5_VPORT_PF && + if (vport->vport != MLX5_VPORT_HOST_PF && (vport->info.ipsec_crypto_enabled || vport->info.ipsec_packet_enabled)) esw->enabled_ipsec_vf_count++; @@ -979,7 +979,7 @@ void mlx5_esw_vport_disable(struct mlx5_eswitch *esw, struct mlx5_vport *vport) MLX5_CAP_GEN(esw->dev, vhca_resource_manager)) mlx5_esw_vport_vhca_id_unmap(esw, vport); - if (vport->vport != MLX5_VPORT_PF && + if (vport->vport != MLX5_VPORT_HOST_PF && (vport->info.ipsec_crypto_enabled || vport->info.ipsec_packet_enabled)) esw->enabled_ipsec_vf_count--; @@ -1045,6 +1045,7 @@ const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev) static int mlx5_esw_host_functions_enabled_query(struct mlx5_eswitch *esw) { const u32 *query_host_out; + void *host_params; if (!mlx5_core_is_ecpf_esw_manager(esw->dev)) return 0; @@ -1053,9 +1054,11 @@ static int mlx5_esw_host_functions_enabled_query(struct mlx5_eswitch *esw) if (IS_ERR(query_host_out)) return PTR_ERR(query_host_out); + host_params = MLX5_ADDR_OF(query_esw_functions_out, + query_host_out, net_function_params); esw->esw_funcs.host_funcs_disabled = - MLX5_GET(query_esw_functions_out, query_host_out, - host_params_context.host_pf_not_exist); + MLX5_GET(host_params_context, host_params, + host_pf_not_exist); kvfree(query_host_out); return 0; @@ -1318,7 +1321,7 @@ int mlx5_esw_host_pf_enable_hca(struct mlx5_core_dev *dev) if (!mlx5_core_is_ecpf(dev) || !mlx5_esw_allowed(esw)) return 0; - vport = mlx5_eswitch_get_vport(esw, MLX5_VPORT_PF); + vport = mlx5_eswitch_get_vport(esw, MLX5_VPORT_HOST_PF); if (IS_ERR(vport)) return PTR_ERR(vport); @@ -1344,7 +1347,7 @@ int mlx5_esw_host_pf_disable_hca(struct mlx5_core_dev *dev) if (!mlx5_core_is_ecpf(dev) || !mlx5_esw_allowed(esw)) return 0; - vport = mlx5_eswitch_get_vport(esw, MLX5_VPORT_PF); + vport = mlx5_eswitch_get_vport(esw, MLX5_VPORT_HOST_PF); if (IS_ERR(vport)) return PTR_ERR(vport); @@ -1372,7 +1375,7 @@ mlx5_eswitch_enable_pf_vf_vports(struct mlx5_eswitch *esw, /* Enable PF vport */ if (pf_needed && mlx5_esw_host_functions_enabled(esw->dev)) { - ret = mlx5_eswitch_load_pf_vf_vport(esw, MLX5_VPORT_PF, + ret = mlx5_eswitch_load_pf_vf_vport(esw, MLX5_VPORT_HOST_PF, enabled_events); if (ret) return ret; @@ -1427,7 +1430,7 @@ ecpf_err: mlx5_esw_host_pf_disable_hca(esw->dev); pf_hca_err: if (pf_needed && mlx5_esw_host_functions_enabled(esw->dev)) - mlx5_eswitch_unload_pf_vf_vport(esw, MLX5_VPORT_PF); + mlx5_eswitch_unload_pf_vf_vport(esw, MLX5_VPORT_HOST_PF); return ret; } @@ -1454,7 +1457,7 @@ void mlx5_eswitch_disable_pf_vf_vports(struct mlx5_eswitch *esw) if ((mlx5_core_is_ecpf_esw_manager(esw->dev) || esw->mode == MLX5_ESWITCH_LEGACY) && mlx5_esw_host_functions_enabled(esw->dev)) - mlx5_eswitch_unload_pf_vf_vport(esw, MLX5_VPORT_PF); + mlx5_eswitch_unload_pf_vf_vport(esw, MLX5_VPORT_HOST_PF); } static void mlx5_eswitch_get_devlink_param(struct mlx5_eswitch *esw) @@ -1479,6 +1482,7 @@ static void mlx5_eswitch_get_devlink_param(struct mlx5_eswitch *esw) static void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, int num_vfs) { + void *host_params; const u32 *out; if (num_vfs < 0) @@ -1493,8 +1497,10 @@ mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, int num_vfs) if (IS_ERR(out)) return; - esw->esw_funcs.num_vfs = MLX5_GET(query_esw_functions_out, out, - host_params_context.host_num_of_vfs); + host_params = MLX5_ADDR_OF(query_esw_functions_out, out, + net_function_params); + esw->esw_funcs.num_vfs = MLX5_GET(host_params_context, host_params, + host_num_of_vfs); if (mlx5_core_ec_sriov_enabled(esw->dev)) esw->esw_funcs.num_ec_vfs = num_vfs; @@ -1831,7 +1837,7 @@ static int mlx5_query_hca_cap_host_pf(struct mlx5_core_dev *dev, void *out) MLX5_SET(query_hca_cap_in, in, opcode, MLX5_CMD_OP_QUERY_HCA_CAP); MLX5_SET(query_hca_cap_in, in, op_mod, opmod); - MLX5_SET(query_hca_cap_in, in, function_id, MLX5_VPORT_PF); + MLX5_SET(query_hca_cap_in, in, function_id, MLX5_VPORT_HOST_PF); MLX5_SET(query_hca_cap_in, in, other_function, true); return mlx5_cmd_exec_inout(dev, query_hca_cap, in, out); } @@ -1923,10 +1929,10 @@ static int mlx5_esw_vports_init(struct mlx5_eswitch *esw) xa_init(&esw->vports); if (mlx5_esw_host_functions_enabled(dev)) { - err = mlx5_esw_vport_alloc(esw, idx, MLX5_VPORT_PF); + err = mlx5_esw_vport_alloc(esw, idx, MLX5_VPORT_HOST_PF); if (err) goto err; - if (esw->first_host_vport == MLX5_VPORT_PF) + if (esw->first_host_vport == MLX5_VPORT_HOST_PF) xa_set_mark(&esw->vports, idx, MLX5_ESW_VPT_HOST_FN); idx++; for (i = 0; i < mlx5_core_max_vfs(dev); i++) { @@ -2207,7 +2213,7 @@ bool mlx5_eswitch_is_vf_vport(struct mlx5_eswitch *esw, u16 vport_num) bool mlx5_eswitch_is_pf_vf_vport(struct mlx5_eswitch *esw, u16 vport_num) { - return vport_num == MLX5_VPORT_PF || + return vport_num == MLX5_VPORT_HOST_PF || mlx5_eswitch_is_vf_vport(esw, vport_num); } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index 8f4c47975c58f..2fd601bd102f4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -687,7 +687,7 @@ static inline bool mlx5_esw_is_owner(struct mlx5_eswitch *esw, u16 vport_num, static inline u16 mlx5_eswitch_first_host_vport_num(struct mlx5_core_dev *dev) { return mlx5_core_is_ecpf_esw_manager(dev) ? - MLX5_VPORT_PF : MLX5_VPORT_FIRST_VF; + MLX5_VPORT_HOST_PF : MLX5_VPORT_FIRST_HOST_VF; } static inline bool mlx5_eswitch_is_funcs_handler(const struct mlx5_core_dev *dev) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 9e2ae217c2247..69ddf56e2fc94 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -1216,9 +1216,10 @@ static int esw_add_fdb_peer_miss_rules(struct mlx5_eswitch *esw, if (mlx5_core_is_ecpf_esw_manager(peer_dev) && mlx5_esw_host_functions_enabled(peer_dev)) { - peer_vport = mlx5_eswitch_get_vport(peer_esw, MLX5_VPORT_PF); + peer_vport = mlx5_eswitch_get_vport(peer_esw, + MLX5_VPORT_HOST_PF); esw_set_peer_miss_rule_source_port(esw, peer_esw, spec, - MLX5_VPORT_PF); + MLX5_VPORT_HOST_PF); flow = mlx5_add_flow_rules(mlx5_eswitch_get_slow_fdb(esw), spec, &flow_act, &dest, 1); @@ -1300,7 +1301,8 @@ add_ecpf_flow_err: if (mlx5_core_is_ecpf_esw_manager(peer_dev) && mlx5_esw_host_functions_enabled(peer_dev)) { - peer_vport = mlx5_eswitch_get_vport(peer_esw, MLX5_VPORT_PF); + peer_vport = mlx5_eswitch_get_vport(peer_esw, + MLX5_VPORT_HOST_PF); mlx5_del_flow_rules(flows[peer_vport->index]); } add_pf_flow_err: @@ -1342,7 +1344,8 @@ static void esw_del_fdb_peer_miss_rules(struct mlx5_eswitch *esw, if (mlx5_core_is_ecpf_esw_manager(peer_dev) && mlx5_esw_host_functions_enabled(peer_dev)) { - peer_vport = mlx5_eswitch_get_vport(peer_esw, MLX5_VPORT_PF); + peer_vport = mlx5_eswitch_get_vport(peer_esw, + MLX5_VPORT_HOST_PF); mlx5_del_flow_rules(flows[peer_vport->index]); } @@ -3658,6 +3661,7 @@ static void esw_offloads_steering_cleanup(struct mlx5_eswitch *esw) static void esw_vfs_changed_event_handler(struct mlx5_eswitch *esw) { bool host_pf_disabled; + void *host_params; u16 new_num_vfs; const u32 *out; @@ -3665,10 +3669,12 @@ static void esw_vfs_changed_event_handler(struct mlx5_eswitch *esw) if (IS_ERR(out)) return; - new_num_vfs = MLX5_GET(query_esw_functions_out, out, - host_params_context.host_num_of_vfs); - host_pf_disabled = MLX5_GET(query_esw_functions_out, out, - host_params_context.host_pf_disabled); + host_params = MLX5_ADDR_OF(query_esw_functions_out, out, + net_function_params); + new_num_vfs = MLX5_GET(host_params_context, host_params, + host_num_of_vfs); + host_pf_disabled = MLX5_GET(host_params_context, host_params, + host_pf_disabled); if (new_num_vfs == esw->esw_funcs.num_vfs || host_pf_disabled) goto free; @@ -3768,6 +3774,7 @@ int mlx5_esw_funcs_changed_handler(struct notifier_block *nb, static int mlx5_esw_host_number_init(struct mlx5_eswitch *esw) { const u32 *query_host_out; + void *host_params; if (!mlx5_core_is_ecpf_esw_manager(esw->dev)) return 0; @@ -3777,8 +3784,10 @@ static int mlx5_esw_host_number_init(struct mlx5_eswitch *esw) return PTR_ERR(query_host_out); /* Mark non local controller with non zero controller number. */ - esw->offloads.host_number = MLX5_GET(query_esw_functions_out, query_host_out, - host_params_context.host_number); + host_params = MLX5_ADDR_OF(query_esw_functions_out, + query_host_out, net_function_params); + esw->offloads.host_number = MLX5_GET(host_params_context, + host_params, host_number); kvfree(query_host_out); return 0; } @@ -4463,7 +4472,7 @@ static bool mlx5_eswitch_vport_has_rep(const struct mlx5_eswitch *esw, u16 vport_num) { /* Currently, only ECPF based device has representor for host PF. */ - if (vport_num == MLX5_VPORT_PF && + if (vport_num == MLX5_VPORT_HOST_PF && (!mlx5_core_is_ecpf_esw_manager(esw->dev) || !mlx5_esw_host_functions_enabled(esw->dev))) return false; @@ -4817,9 +4826,10 @@ int mlx5_devlink_pf_port_fn_state_get(struct devlink_port *port, { struct mlx5_vport *vport = mlx5_devlink_port_vport_get(port); const u32 *query_out; + void *host_params; bool pf_disabled; - if (vport->vport != MLX5_VPORT_PF) { + if (vport->vport != MLX5_VPORT_HOST_PF) { NL_SET_ERR_MSG_MOD(extack, "State get is not supported for VF"); return -EOPNOTSUPP; } @@ -4831,8 +4841,10 @@ int mlx5_devlink_pf_port_fn_state_get(struct devlink_port *port, if (IS_ERR(query_out)) return PTR_ERR(query_out); - pf_disabled = MLX5_GET(query_esw_functions_out, query_out, - host_params_context.host_pf_disabled); + host_params = MLX5_ADDR_OF(query_esw_functions_out, query_out, + net_function_params); + pf_disabled = MLX5_GET(host_params_context, host_params, + host_pf_disabled); *opstate = pf_disabled ? DEVLINK_PORT_FN_OPSTATE_DETACHED : DEVLINK_PORT_FN_OPSTATE_ATTACHED; @@ -4848,7 +4860,7 @@ int mlx5_devlink_pf_port_fn_state_set(struct devlink_port *port, struct mlx5_vport *vport = mlx5_devlink_port_vport_get(port); struct mlx5_core_dev *dev; - if (vport->vport != MLX5_VPORT_PF) { + if (vport->vport != MLX5_VPORT_HOST_PF) { NL_SET_ERR_MSG_MOD(extack, "State set is not supported for VF"); return -EOPNOTSUPP; } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/mlx5_ifc_vhca_event.h b/drivers/net/ethernet/mellanox/mlx5/core/sf/mlx5_ifc_vhca_event.h index 4fc870140d710..487c94b562030 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/mlx5_ifc_vhca_event.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/mlx5_ifc_vhca_event.h @@ -4,14 +4,6 @@ #ifndef __MLX5_IFC_VHCA_EVENT_H__ #define __MLX5_IFC_VHCA_EVENT_H__ -enum mlx5_ifc_vhca_state { - MLX5_VHCA_STATE_INVALID = 0x0, - MLX5_VHCA_STATE_ALLOCATED = 0x1, - MLX5_VHCA_STATE_ACTIVE = 0x2, - MLX5_VHCA_STATE_IN_USE = 0x3, - MLX5_VHCA_STATE_TEARDOWN_REQUEST = 0x4, -}; - struct mlx5_ifc_vhca_state_context_bits { u8 arm_change_event[0x1]; u8 reserved_at_1[0xb]; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c index bf6f631cf2ce0..6eb6026eadd62 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -274,6 +274,7 @@ void mlx5_sriov_detach(struct mlx5_core_dev *dev) static u16 mlx5_get_max_vfs(struct mlx5_core_dev *dev) { u16 host_total_vfs; + void *host_params; const u32 *out; if (mlx5_core_is_ecpf_esw_manager(dev)) { @@ -284,8 +285,10 @@ static u16 mlx5_get_max_vfs(struct mlx5_core_dev *dev) */ if (IS_ERR(out)) goto done; - host_total_vfs = MLX5_GET(query_esw_functions_out, out, - host_params_context.host_total_vfs); + host_params = MLX5_ADDR_OF(query_esw_functions_out, out, + net_function_params); + host_total_vfs = MLX5_GET(host_params_context, host_params, + host_total_vfs); kvfree(out); return host_total_vfs; } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c index d8e382b9fa61e..6dc3b11b79269 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c @@ -50,7 +50,7 @@ static int hws_vport_add_gvmi(struct mlx5hws_context *ctx, u16 vport) static bool hws_vport_is_esw_mgr_vport(struct mlx5hws_context *ctx, u16 vport) { return ctx->caps->is_ecpf ? vport == MLX5_VPORT_ECPF : - vport == MLX5_VPORT_PF; + vport == MLX5_VPORT_HOST_PF; } int mlx5hws_vport_get_gvmi(struct mlx5hws_context *ctx, u16 vport, u16 *vport_gvmi) diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h index 67256e776566c..3b29a3c6794da 100644 --- a/include/linux/mlx5/eswitch.h +++ b/include/linux/mlx5/eswitch.h @@ -217,7 +217,7 @@ static inline bool is_mdev_switchdev_mode(struct mlx5_core_dev *dev) static inline u16 mlx5_eswitch_manager_vport(struct mlx5_core_dev *dev) { return mlx5_core_is_ecpf_esw_manager(dev) ? - MLX5_VPORT_ECPF : MLX5_VPORT_PF; + MLX5_VPORT_ECPF : MLX5_VPORT_HOST_PF; } #endif diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 49f3ad4b1a7c5..6a675f918c40a 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1935,7 +1935,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 max_flow_counter_31_16[0x10]; u8 max_wqe_sz_sq_dc[0x10]; - u8 reserved_at_2e0[0x7]; + u8 query_host_net_function_num_max[0x5]; + u8 reserved_at_2e5[0x2]; u8 max_qp_mcg[0x19]; u8 reserved_at_300[0x10]; @@ -2027,7 +2028,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_max_current_mc_list[0x5]; u8 reserved_at_3f8[0x1]; u8 silent_mode_query[0x1]; - u8 reserved_at_3fa[0x1]; + u8 query_host_net_function_v1[0x1]; u8 log_max_current_uc_list[0x5]; u8 general_obj_types[0x40]; @@ -8452,7 +8453,9 @@ struct mlx5_ifc_enable_hca_in_bits { u8 op_mod[0x10]; u8 embedded_cpu_function[0x1]; - u8 reserved_at_41[0xf]; + u8 reserved_at_41[0x2]; + u8 function_id_type[0x1]; + u8 reserved_at_44[0xc]; u8 function_id[0x10]; u8 reserved_at_60[0x20]; @@ -8497,7 +8500,9 @@ struct mlx5_ifc_disable_hca_in_bits { u8 op_mod[0x10]; u8 embedded_cpu_function[0x1]; - u8 reserved_at_41[0xf]; + u8 reserved_at_41[0x2]; + u8 function_id_type[0x1]; + u8 reserved_at_44[0xc]; u8 function_id[0x10]; u8 reserved_at_60[0x20]; @@ -12700,6 +12705,54 @@ struct mlx5_ifc_host_params_context_bits { u8 reserved_at_80[0x180]; }; +enum mlx5_ifc_vhca_state { + MLX5_VHCA_STATE_INVALID = 0x0, + MLX5_VHCA_STATE_ALLOCATED = 0x1, + MLX5_VHCA_STATE_ACTIVE = 0x2, + MLX5_VHCA_STATE_IN_USE = 0x3, + MLX5_VHCA_STATE_TEARDOWN_REQUEST = 0x4, +}; + +enum { + MLX5_PCI_PF_TYPE_EXTERNAL_HOST_PF = 0x0, + MLX5_PCI_PF_TYPE_SATELLITE_PF = 0x1, +}; + +struct mlx5_ifc_network_function_params_bits { + u8 host_number[0x8]; + u8 pci_pf_type[0x4]; + u8 reserved_at_c[0x4]; + u8 pci_num_vfs[0x10]; + + u8 pci_total_vfs[0x10]; + u8 pci_bus[0x8]; + u8 pci_device_function[0x8]; + + u8 vhca_id[0x10]; + u8 vhca_state[0x4]; + u8 reserved_at_54[0xc]; + + u8 reserved_at_60[0xa]; + u8 esw_vport_manual[0x1]; + u8 pci_bus_assigned[0x1]; + u8 pci_vf_info_valid[0x1]; + u8 reserved_at_6d[0x13]; + + u8 pci_vf_stride[0x10]; + u8 pci_first_vf_offset[0x10]; + + u8 reserved_at_a0[0x160]; +}; + +union mlx5_ifc_net_function_params_bits { + struct mlx5_ifc_host_params_context_bits host_params_context; + struct mlx5_ifc_network_function_params_bits network_function_params; +}; + +enum { + MLX5_QUERY_ESW_FUNC_OP_MOD_LAYOUT_V1 = BIT(14), +}; + struct mlx5_ifc_query_esw_functions_in_bits { u8 opcode[0x10]; u8 reserved_at_10[0x10]; @@ -12716,12 +12769,16 @@ struct mlx5_ifc_query_esw_functions_out_bits { u8 syndrome[0x20]; - u8 reserved_at_40[0x40]; + u8 reserved_at_40[0x20]; - struct mlx5_ifc_host_params_context_bits host_params_context; + u8 net_function_num[0x8]; + u8 reserved_at_68[0x18]; - u8 reserved_at_280[0x180]; - u8 host_sf_enable[][0x40]; + union { + u8 reserved_at_80[0x380]; + DECLARE_FLEX_ARRAY(union mlx5_ifc_net_function_params_bits, + net_function_params); + }; }; struct mlx5_ifc_sf_partition_bits { diff --git a/include/linux/mlx5/vport.h b/include/linux/mlx5/vport.h index dfa2fe32217af..90641f67da468 100644 --- a/include/linux/mlx5/vport.h +++ b/include/linux/mlx5/vport.h @@ -51,8 +51,8 @@ enum { /* Vport number for each function must keep unchanged */ enum { - MLX5_VPORT_PF = 0x0, - MLX5_VPORT_FIRST_VF = 0x1, + MLX5_VPORT_HOST_PF = 0x0, + MLX5_VPORT_FIRST_HOST_VF = 0x1, MLX5_VPORT_ECPF = 0xfffe, MLX5_VPORT_UPLINK = 0xffff }; |
