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 25FC7454EF; Tue, 25 Jun 2024 13:17:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 197E542DC9; Tue, 25 Jun 2024 13:15:48 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 96FCC427AD for ; Tue, 25 Jun 2024 13:15:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314125; x=1750850125; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fsIOYCzLyOW43072ppOmjr6NmvR3dDT4P6c+sqr1d/8=; b=TVQiODdgCcmfniIztTrwwpmS4NbzfiYJLxUPoRhdOosAEih8H7eoFXOO k0b3RsA4cRF7vio3e/q0STPk7WyKH/REYchljSBy9El+twmAtdH9k8kh+ 5MYY49Z1RXqzrB2va4YOIbbTLTNUtOKjnPwJR3WNf/iQvNRv7gcdYykip T+ghnj4ywqACzxMt3i45ZQFxLiwtalxEd9vmNNRK9TWg6SqPl/cmdDOSE AeVH52gsmpFoA20InpbylRv/v9z9nd613GQds3YeH4iY44DboJtFzEtLc aSUOJKlHnYdcByDq1UTEYt7tMu6HJskHyzalmUFBpygikaoT+SMGGHtg7 g==; X-CSE-ConnectionGUID: 9dtN4yEWTXC1p9Aa5SnuaQ== X-CSE-MsgGUID: kfv51qloQ3q9YFcutgIzkA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080098" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080098" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:15:25 -0700 X-CSE-ConnectionGUID: Cbt8QLuZScqkREKg/PNYGA== X-CSE-MsgGUID: W8qvzDOiQMKsQta95MfN0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43718977" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:15:24 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Michal Swiatkowski , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 016/129] net/ice/base: alloc port_info only once Date: Tue, 25 Jun 2024 12:12:21 +0100 Message-ID: <8ddf3c5d56357e3378312ff413a3f1c0638818fb.1719313663.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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 From: Michal Swiatkowski When devlink reload is called port_info should stay. Check if it wasn't already allocated before doing allocation. Signed-off-by: Michal Swiatkowski Signed-off-by: Anatoly Burakov --- drivers/net/ice/base/ice_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index ebbe8cde1d..914096d1a6 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -1006,7 +1006,8 @@ int ice_init_hw(struct ice_hw *hw) if (status) goto err_unroll_cqinit; - hw->port_info = (struct ice_port_info *) + if (!hw->port_info) + hw->port_info = (struct ice_port_info *) ice_malloc(hw, sizeof(*hw->port_info)); if (!hw->port_info) { status = ICE_ERR_NO_MEMORY; -- 2.43.0