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 D912EA0548; Tue, 11 Oct 2022 20:58:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7093F42BAE; Tue, 11 Oct 2022 20:57:31 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 6A12242B7E; Tue, 11 Oct 2022 20:57:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665514644; x=1697050644; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8wW1tE4nirSg94hNkjAPXW93KtYQGTnmVBq7lACKmQw=; b=nFPv0fiyd2fL9v6uXXAD37l9QlCMQK+wMYhq5KhyVn36FFU6sQaDviw2 zjHtfba+XSa+7GoDtRGdx5d8Dronw0N5v3laFDEFHbPkuCMmW5pkxQDdM pfQztcsAqdQmxDFv36iJwuhcm3zAOVXm0AaxCW+j/l4CEQH8Limbm93A2 egL+J7YJk4GI9GzGxMz1kohdVY7c1hbXD9wdJXH4OLDhsLCsl24iBaNHD 8uRAjx4KbBWP/ee5I1uADLYR0HPbFqanlq2TUeA0fJfpz/mivjogRKKlG PS+dNzJ0FwLsPPyUxf4yY+gvMdAonimWv3UhryN2YronPOs7ORpC/Kub7 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="284981629" X-IronPort-AV: E=Sophos;i="5.95,177,1661842800"; d="scan'208";a="284981629" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 11:57:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="604261533" X-IronPort-AV: E=Sophos;i="5.95,177,1661842800"; d="scan'208";a="604261533" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orsmga006.jf.intel.com with ESMTP; 11 Oct 2022 11:57:23 -0700 From: Hernan Vargas To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com, maxime.coquelin@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas , stable@dpdk.org Subject: [PATCH v3 08/30] baseband/acc100: allocate ring/queue mem when NULL Date: Tue, 11 Oct 2022 19:53:24 -0700 Message-Id: <20221012025346.204394-9-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221012025346.204394-1-hernan.vargas@intel.com> References: <20221012025346.204394-1-hernan.vargas@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 Allocate info ring, tail pointers and HARQ layout memory for a device only if it hasn't already been allocated. Fixes: 06531464151 ("baseband/acc100: support interrupt") Cc: stable@dpdk.org Signed-off-by: Hernan Vargas --- drivers/baseband/acc/rte_acc100_pmd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index c1446b3721..c0184b8174 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -406,7 +406,8 @@ allocate_info_ring(struct rte_bbdev *dev) else reg_addr = &vf_reg_addr; /* Allocate InfoRing */ - d->info_ring = rte_zmalloc_socket("Info Ring", + if (d->info_ring == NULL) + d->info_ring = rte_zmalloc_socket("Info Ring", ACC_INFO_RING_NUM_ENTRIES * sizeof(*d->info_ring), RTE_CACHE_LINE_SIZE, dev->data->socket_id); @@ -498,7 +499,8 @@ acc100_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id) acc_reg_write(d, reg_addr->ring_size, value); /* Configure tail pointer for use when SDONE enabled */ - d->tail_ptrs = rte_zmalloc_socket( + if (d->tail_ptrs == NULL) + d->tail_ptrs = rte_zmalloc_socket( dev->device->driver->name, ACC100_NUM_QGRPS * ACC100_NUM_AQS * sizeof(uint32_t), RTE_CACHE_LINE_SIZE, socket_id); @@ -530,7 +532,8 @@ acc100_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id) /* Continue */ } - d->harq_layout = rte_zmalloc_socket("HARQ Layout", + if (d->harq_layout == NULL) + d->harq_layout = rte_zmalloc_socket("HARQ Layout", ACC_HARQ_LAYOUT * sizeof(*d->harq_layout), RTE_CACHE_LINE_SIZE, dev->data->socket_id); if (d->harq_layout == NULL) { -- 2.37.1