From: Mingxia Liu <mingxia.liu@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, beilei.xing@intel.com,
Mingxia Liu <mingxia.liu@intel.com>
Subject: [PATCH v2] net/idpf: fix error path processing
Date: Fri, 30 Jun 2023 18:54:02 +0000 [thread overview]
Message-ID: <20230630185402.13307-1-mingxia.liu@intel.com> (raw)
In-Reply-To: <20230626140606.490871-1-mingxia.liu@intel.com>
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(-)
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
next prev parent reply other threads:[~2023-06-30 10:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 14:06 [PATCH] net/idpf: refine idpf_dev_vport_init() function Mingxia Liu
2023-06-30 8:13 ` Zhang, Qi Z
2023-06-30 8:14 ` Zhang, Qi Z
2023-06-30 10:46 ` Liu, Mingxia
2023-06-30 18:54 ` Mingxia Liu [this message]
2023-07-03 2:19 ` [PATCH v2] net/idpf: fix error path processing Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230630185402.13307-1-mingxia.liu@intel.com \
--to=mingxia.liu@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).