[PATCH v2] net/idpf: fix error path processing
Mingxia Liu
mingxia.liu at intel.com
Fri Jun 30 20:54:02 CEST 2023
This patch moves vport info updating lines to the last,
in order to fix reverting missing in the error handle.
Fixes: 5e0f60527e5b ("net/idpf: remove vport req and recv info from adapter")
Signed-off-by: Mingxia Liu <mingxia.liu at intel.com>
---
drivers/net/idpf/idpf_ethdev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 4b7cc81550..6d9a53c94c 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -1277,10 +1277,6 @@ idpf_dev_vport_init(struct rte_eth_dev *dev, void *init_params)
goto err;
}
- adapter->vports[param->idx] = vport;
- adapter->cur_vports |= RTE_BIT32(param->devarg_id);
- adapter->cur_vport_nb++;
-
dev->data->mac_addrs = rte_zmalloc(NULL, RTE_ETHER_ADDR_LEN, 0);
if (dev->data->mac_addrs == NULL) {
PMD_INIT_LOG(ERR, "Cannot allocate mac_addr memory.");
@@ -1291,6 +1287,10 @@ idpf_dev_vport_init(struct rte_eth_dev *dev, void *init_params)
rte_ether_addr_copy((struct rte_ether_addr *)vport->default_mac_addr,
&dev->data->mac_addrs[0]);
+ adapter->vports[param->idx] = vport;
+ adapter->cur_vports |= RTE_BIT32(param->devarg_id);
+ adapter->cur_vport_nb++;
+
return 0;
err_mac_addrs:
--
2.34.1
More information about the dev
mailing list