From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BE26142D94; Fri, 30 Jun 2023 12:35:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9702B406B6; Fri, 30 Jun 2023 12:35:31 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A3F58406B5 for ; Fri, 30 Jun 2023 12:35:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688121329; x=1719657329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IqWVu2412ID3TNLmVHFDvrsgFXJofO5zFuDQVPDCvhc=; b=MBIM+nKWiBWYUOiHak9BP6jlkt1ORBr2EKFUhqtsQEg8nlP3ufIydfiu i+O8kqOEt7tb6EHCDHRJALiIbSV3rPMNgfbx4bHswckvv2J+hoeDvsCwQ LnOD5EphsnJQisi06OxI4ByrLEiBxALB5rm9MXYebcKGaio91YXwkzpCE UwkprSZ+EMZzeKpFPN1uJ+iwYZ+OQR9vRrdJcza0gbiVAIJUkXT4+Cbl/ A36SeJE0+ymgs03FcMuadZnIKwB9hZc9CR/MStxpcasCLv4i7UM96mKEz WL7fjpVdS0XPRl46hZBLJuAftuUAThY4M8woLgE/Sauz7DjB712zs/VCJ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10756"; a="393092494" X-IronPort-AV: E=Sophos;i="6.01,170,1684825200"; d="scan'208";a="393092494" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2023 03:35:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10756"; a="717766748" X-IronPort-AV: E=Sophos;i="6.01,170,1684825200"; d="scan'208";a="717766748" Received: from dpdk-mingxial-ice.sh.intel.com ([10.67.110.210]) by orsmga002.jf.intel.com with ESMTP; 30 Jun 2023 03:35:27 -0700 From: Mingxia Liu To: dev@dpdk.org Cc: jingjing.wu@intel.com, beilei.xing@intel.com, Mingxia Liu Subject: [PATCH v2] net/idpf: fix error path processing Date: Fri, 30 Jun 2023 18:54:02 +0000 Message-Id: <20230630185402.13307-1-mingxia.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230626140606.490871-1-mingxia.liu@intel.com> References: <20230626140606.490871-1-mingxia.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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