From: Viacheslav Galaktionov Date: Mon, 11 Oct 2021 14:48:55 +0000 (+0300) Subject: net/sfc: use switch port ID as representor ID X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=96a46ead5b9c3f544703237eb69ba6e2df603f5a;p=dpdk.git net/sfc: use switch port ID as representor ID 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 Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c index a9dab6f28c..2500b14cb0 100644 --- a/drivers/net/sfc/sfc_repr.c +++ b/drivers/net/sfc/sfc_repr.c @@ -899,7 +899,6 @@ static const struct eth_dev_ops sfc_repr_dev_ops = { struct sfc_repr_init_data { uint16_t pf_port_id; - uint16_t repr_id; uint16_t switch_domain_id; efx_mport_sel_t mport_sel; efx_pcie_interface_t intf; @@ -957,7 +956,7 @@ sfc_repr_eth_dev_init(struct rte_eth_dev *dev, void *init_params) } ret = sfc_repr_proxy_add_port(repr_data->pf_port_id, - repr_data->repr_id, + srs->switch_port_id, dev->data->port_id, &repr_data->mport_sel); if (ret != 0) { @@ -984,7 +983,7 @@ sfc_repr_eth_dev_init(struct rte_eth_dev *dev, void *init_params) 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; @@ -1012,7 +1011,7 @@ fail_mac_addrs: fail_alloc_sr: (void)sfc_repr_proxy_del_port(repr_data->pf_port_id, - repr_data->repr_id); + srs->switch_port_id); fail_create_port: fail_mae_assign_switch_port: @@ -1065,7 +1064,6 @@ sfc_repr_create(struct rte_eth_dev *parent, 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;