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 E0E2F4404F; Wed, 12 Jun 2024 17:07:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2D2C4113D; Wed, 12 Jun 2024 17:03:47 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 61B91410ED for ; Wed, 12 Jun 2024 17:03:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204626; x=1749740626; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vO4qgKDTmNiWpdkyJpW/m6fCzCjVybCcDBy/2WTtaKo=; b=Mj3O4DSo9q5f/17SP5IX28olx3COYvtlSTmFdK4bg876ap2wsO5GJOgM /Dtr4oTMTI0QdLkB/un/9ddgzRdcNY0BNWQkxumn43euwHTcoDdL/BSlf 8k2T+tZgb8d+d1wTujO72U7neBA6TbeXnzKMf+yhwxW9DdjcVe+lkhIUg AFVOcOGtNxMMIHMYMxh6twPkskxsiO2hFjG5vDJ/1k07azZ4JPcWizkFS XGPg49BUBvA37IMIojpdF0EV7FiGWlz5zhzXAK0B0g3ySxi7sK8WgeXnd vSoDXbtVJQgyRe0TcWIBNju4VxwD+re8EX2aRs6qyTSgByLmaVhJrY4+k g==; X-CSE-ConnectionGUID: Lle2gnS+RDO16czjzctnug== X-CSE-MsgGUID: nNdCxv/QQJW52SPH2lMDbg== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459184" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459184" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:03:43 -0700 X-CSE-ConnectionGUID: EHHsgdJwQaOr2gahWaPO+g== X-CSE-MsgGUID: SnWzjmcYRgOQyRaB1NfPaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39924929" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:03:42 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: ian.stokes@intel.com, bruce.richardson@intel.com, Michal Swiatkowski Subject: [PATCH v2 017/148] net/ice/base: alloc port_info only once Date: Wed, 12 Jun 2024 16:00:11 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@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 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 9b08a10022..f88ced7a5d 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