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;
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) :
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);
}
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);
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)
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) {
/* 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++;
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--;
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);
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);
/* 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;
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;
}
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)
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);
}
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++) {
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);
}
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)
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);
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:
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]);
}
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;
const u32 *query_out;
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;
}
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;
}
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)
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
/* 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
};