Representor IDs must be unique for each representor. VFs, which are
currently used, are not unique as they may repeat in combination with
different PCI controllers and PFs. On the other hand, switch port IDs
are unique, so they are a better fit for this role.
Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
struct sfc_repr_init_data {
uint16_t pf_port_id;
struct sfc_repr_init_data {
uint16_t pf_port_id;
uint16_t switch_domain_id;
efx_mport_sel_t mport_sel;
efx_pcie_interface_t intf;
uint16_t switch_domain_id;
efx_mport_sel_t mport_sel;
efx_pcie_interface_t intf;
}
ret = sfc_repr_proxy_add_port(repr_data->pf_port_id,
}
ret = sfc_repr_proxy_add_port(repr_data->pf_port_id,
dev->data->port_id,
&repr_data->mport_sel);
if (ret != 0) {
dev->data->port_id,
&repr_data->mport_sel);
if (ret != 0) {
dev->process_private = sr;
srs->pf_port_id = repr_data->pf_port_id;
dev->process_private = sr;
srs->pf_port_id = repr_data->pf_port_id;
- srs->repr_id = repr_data->repr_id;
+ srs->repr_id = srs->switch_port_id;
srs->switch_domain_id = repr_data->switch_domain_id;
dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
srs->switch_domain_id = repr_data->switch_domain_id;
dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
fail_alloc_sr:
(void)sfc_repr_proxy_del_port(repr_data->pf_port_id,
fail_alloc_sr:
(void)sfc_repr_proxy_del_port(repr_data->pf_port_id,
fail_create_port:
fail_mae_assign_switch_port:
fail_create_port:
fail_mae_assign_switch_port:
if (dev == NULL) {
memset(&repr_data, 0, sizeof(repr_data));
repr_data.pf_port_id = parent->data->port_id;
if (dev == NULL) {
memset(&repr_data, 0, sizeof(repr_data));
repr_data.pf_port_id = parent->data->port_id;
- repr_data.repr_id = entity->vf;
repr_data.switch_domain_id = switch_domain_id;
repr_data.mport_sel = *mport_sel;
repr_data.intf = entity->intf;
repr_data.switch_domain_id = switch_domain_id;
repr_data.mport_sel = *mport_sel;
repr_data.intf = entity->intf;