[v2] net/idpf: fix error path processing
Checks
Commit Message
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@intel.com>
---
drivers/net/idpf/idpf_ethdev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
> -----Original Message-----
> From: Mingxia Liu <mingxia.liu@intel.com>
> Sent: Saturday, July 1, 2023 2:54 AM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Liu, Mingxia <mingxia.liu@intel.com>
> Subject: [PATCH v2] net/idpf: fix error path processing
>
> 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")
>
Added Cc: stable@dpdk.org
> Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
@@ -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: