All of lore.kernel.org
 help / color / mirror / Atom feed
From: Devendra Singh Rawat <dsinghrawat@marvell.com>
To: Ophir Munk <ophirmu@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Alok Prasad <palok@marvell.com>
Cc: Ophir Munk <ophirmu@mellanox.com>, Matan Azrad <matan@nvidia.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Lior Margalit <lmargalit@nvidia.com>
Subject: RE: [EXT] [RFC] lib: set/get max memzone segments
Date: Wed, 19 Apr 2023 13:42:21 +0000	[thread overview]
Message-ID: <CO6PR18MB4452CB1FD8A9651261E03F46B6629@CO6PR18MB4452.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20230419083634.2027689-1-ophirmu@nvidia.com>


>diff --git a/drivers/net/qede/base/bcm_osal.c
>b/drivers/net/qede/base/bcm_osal.c
>index 2c59397..f195f2c 100644
>--- a/drivers/net/qede/base/bcm_osal.c
>+++ b/drivers/net/qede/base/bcm_osal.c
>@@ -47,10 +47,26 @@ void osal_poll_mode_dpc(osal_int_ptr_t
>hwfn_cookie)  }
>
> /* Array of memzone pointers */
>-static const struct rte_memzone
>*ecore_mz_mapping[RTE_MAX_MEMZONE];
>+static const struct rte_memzone **ecore_mz_mapping;
> /* Counter to track current memzone allocated */  static uint16_t
>ecore_mz_count;
>
>+int ecore_mz_mapping_alloc(void)
>+{
>+	ecore_mz_mapping = rte_malloc("ecore_mz_map", 0,
>+		rte_memzone_max_get() * sizeof(struct rte_memzone *));

Second parameter of rte_malloc() should be size and Third parameter should be alignment 0 in this case.

Check 
https://doc.dpdk.org/api/rte__malloc_8h.html#a247c99e8d36300c52729c9ee58c2b489

>diff --git a/drivers/net/qede/base/bcm_osal.h
>b/drivers/net/qede/base/bcm_osal.h
>index 67e7f75..97e261d 100644
>--- a/drivers/net/qede/base/bcm_osal.h
>+++ b/drivers/net/qede/base/bcm_osal.h
>@@ -477,4 +477,7 @@ enum dbg_status
>	qed_dbg_alloc_user_data(struct ecore_hwfn *p_hwfn,
> 	qed_dbg_alloc_user_data(p_hwfn, user_data_ptr)  #define
>OSAL_DB_REC_OCCURRED(p_hwfn) nothing
>
>+int ecore_mz_mapping_alloc(void);
>+void ecore_mz_mapping_free(void);
>+
> #endif /* __BCM_OSAL_H */
>diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
>index 0303903..f116e86 100644
>--- a/drivers/net/qede/qede_main.c
>+++ b/drivers/net/qede/qede_main.c
>@@ -78,6 +78,12 @@ qed_probe(struct ecore_dev *edev, struct
>rte_pci_device *pci_dev,
> 		return rc;
> 	}
>
>+	rc = ecore_mz_mapping_alloc();

ecore_mz_mapping_alloc() should be called prior to calling ecore_hw_prepare().

>+	if (rc) {
>+		DP_ERR(edev, "mem zones array allocation failed\n");
>+		return rc;
>+	}
>+
> 	return rc;
> }
>
>@@ -721,6 +727,7 @@ static void qed_remove(struct ecore_dev *edev)
> 	if (!edev)
> 		return;
>
>+	ecore_mz_mapping_free();
> 	ecore_hw_remove(edev);
> }

ecore_mz_mapping_free() should be called after ecore_hw_remove();


  parent reply	other threads:[~2023-04-19 13:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  8:36 [RFC] lib: set/get max memzone segments Ophir Munk
2023-04-19  8:48 ` Ophir Munk
2023-04-19 13:42 ` Devendra Singh Rawat [this message]
2023-04-24 21:07   ` [EXT] " Ophir Munk
2023-04-19 14:42 ` Stephen Hemminger
2023-04-24 21:43   ` Ophir Munk
2023-04-19 14:51 ` Tyler Retzlaff
2023-04-20  7:43   ` Thomas Monjalon
2023-04-20 18:20     ` Tyler Retzlaff
2023-04-21  8:34       ` Thomas Monjalon
2023-04-21 11:08         ` Morten Brørup
2023-04-21 14:57           ` Thomas Monjalon
2023-04-21 15:19             ` Morten Brørup
2023-04-25 16:38               ` Ophir Munk
2023-04-25 13:46   ` Ophir Munk
2023-04-25 16:40 ` [RFC V2] " Ophir Munk
2023-05-03  7:26   ` [PATCH V3] " Ophir Munk
2023-05-03 21:41     ` Morten Brørup
2023-05-25  6:47       ` Ophir Munk
2023-05-04  7:27     ` David Marchand
2023-05-25  6:35       ` Ophir Munk
2023-05-18 15:54     ` Burakov, Anatoly
2023-05-25  6:43       ` Ophir Munk
2023-05-24 22:25     ` [PATCH v4] " Ophir Munk
2023-05-25 14:53       ` Burakov, Anatoly
2023-05-30 11:37         ` Ophir Munk
2023-05-26  9:55       ` David Marchand
2023-05-28 12:09         ` [EXT] " Alok Prasad
2023-05-30 13:32       ` Thomas Monjalon
2023-05-31  7:56         ` Ophir Munk
2023-05-31  7:52       ` [PATCH V5] " Ophir Munk
2023-05-31  8:41         ` [PATCH V6] " Ophir Munk
2023-06-05  8:52           ` [PATCH V7] " Ophir Munk
2023-06-05 10:50             ` [PATCH V8] " Ophir Munk
2023-06-05 16:50               ` Thomas Monjalon

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=CO6PR18MB4452CB1FD8A9651261E03F46B6629@CO6PR18MB4452.namprd18.prod.outlook.com \
    --to=dsinghrawat@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=lmargalit@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=ophirmu@mellanox.com \
    --cc=ophirmu@nvidia.com \
    --cc=palok@marvell.com \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.