DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [PATCH] event/octeontx2: relax memory requirement for event timers
@ 2020-01-07 13:17 pbhagavatula
  2020-01-15 11:47 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: pbhagavatula @ 2020-01-07 13:17 UTC (permalink / raw)
  To: jerinj, Pavan Nikhilesh; +Cc: dev

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Relax memory requirement for event timers when internal mempool used is
octeontx2 mempool.
Add debug log to print the memory used.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/octeontx2/otx2_tim_evdev.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/event/octeontx2/otx2_tim_evdev.c b/drivers/event/octeontx2/otx2_tim_evdev.c
index b275c6922..cd0dcde24 100644
--- a/drivers/event/octeontx2/otx2_tim_evdev.c
+++ b/drivers/event/octeontx2/otx2_tim_evdev.c
@@ -327,7 +327,11 @@ otx2_tim_ring_create(struct rte_event_timer_adapter *adptr)
 			tim_optimze_bkt_param(tim_ring);
 	}
 
-	tim_ring->nb_chunks = tim_ring->nb_chunks * tim_ring->nb_bkts;
+	if (tim_ring->disable_npa)
+		tim_ring->nb_chunks = tim_ring->nb_chunks * tim_ring->nb_bkts;
+	else
+		tim_ring->nb_chunks = tim_ring->nb_chunks + tim_ring->nb_bkts;
+
 	/* Create buckets. */
 	tim_ring->bkt = rte_zmalloc("otx2_tim_bucket", (tim_ring->nb_bkts) *
 				    sizeof(struct otx2_tim_bkt),
@@ -376,6 +380,11 @@ otx2_tim_ring_create(struct rte_event_timer_adapter *adptr)
 			 RTE_EVENT_TYPE_TIMER);
 	sso_xae_reconfigure(dev->event_dev);
 
+	otx2_tim_dbg("Total memory used %"PRIu64"MB\n",
+			(uint64_t)(((tim_ring->nb_chunks * tim_ring->chunk_sz)
+			+ (tim_ring->nb_bkts * sizeof(struct otx2_tim_bkt))) /
+			BIT_ULL(20)));
+
 	return rc;
 
 chnk_mem_err:
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] event/octeontx2: relax memory requirement for event timers
  2020-01-07 13:17 [dpdk-dev] [PATCH] event/octeontx2: relax memory requirement for event timers pbhagavatula
@ 2020-01-15 11:47 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2020-01-15 11:47 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: Jerin Jacob, dpdk-dev

On Tue, Jan 7, 2020 at 6:47 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Relax memory requirement for event timers when internal mempool used is
> octeontx2 mempool.
> Add debug log to print the memory used.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Applied to dpdk-next-eventdev/master. Thanks.

> ---
>  drivers/event/octeontx2/otx2_tim_evdev.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/event/octeontx2/otx2_tim_evdev.c b/drivers/event/octeontx2/otx2_tim_evdev.c
> index b275c6922..cd0dcde24 100644
> --- a/drivers/event/octeontx2/otx2_tim_evdev.c
> +++ b/drivers/event/octeontx2/otx2_tim_evdev.c
> @@ -327,7 +327,11 @@ otx2_tim_ring_create(struct rte_event_timer_adapter *adptr)
>                         tim_optimze_bkt_param(tim_ring);
>         }
>
> -       tim_ring->nb_chunks = tim_ring->nb_chunks * tim_ring->nb_bkts;
> +       if (tim_ring->disable_npa)
> +               tim_ring->nb_chunks = tim_ring->nb_chunks * tim_ring->nb_bkts;
> +       else
> +               tim_ring->nb_chunks = tim_ring->nb_chunks + tim_ring->nb_bkts;
> +
>         /* Create buckets. */
>         tim_ring->bkt = rte_zmalloc("otx2_tim_bucket", (tim_ring->nb_bkts) *
>                                     sizeof(struct otx2_tim_bkt),
> @@ -376,6 +380,11 @@ otx2_tim_ring_create(struct rte_event_timer_adapter *adptr)
>                          RTE_EVENT_TYPE_TIMER);
>         sso_xae_reconfigure(dev->event_dev);
>
> +       otx2_tim_dbg("Total memory used %"PRIu64"MB\n",
> +                       (uint64_t)(((tim_ring->nb_chunks * tim_ring->chunk_sz)
> +                       + (tim_ring->nb_bkts * sizeof(struct otx2_tim_bkt))) /
> +                       BIT_ULL(20)));
> +
>         return rc;
>
>  chnk_mem_err:
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 13:17 [dpdk-dev] [PATCH] event/octeontx2: relax memory requirement for event timers pbhagavatula
2020-01-15 11:47 ` Jerin Jacob

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git