DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: jerin.jacob@caviumnetworks.com,
	santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 08/10] event/octeontx: add option to use fpavf as chunk pool
Date: Sat, 17 Feb 2018 03:06:58 +0530	[thread overview]
Message-ID: <20180216213700.3415-9-pbhagavatula@caviumnetworks.com> (raw)
In-Reply-To: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com>

Add compile-time configurable option to force TIMvf to use Octeontx
FPAvf pool manager as its chunk pool.
When FPAvf is used as pool manager the TIMvf automatically frees the
chunks to FPAvf through gpool-id.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 config/common_base                    |  1 +
 drivers/event/octeontx/timvf_evdev.c  | 23 +++++++++++++++++++++++
 drivers/event/octeontx/timvf_evdev.h  |  3 +++
 drivers/event/octeontx/timvf_worker.h | 35 +++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+)

diff --git a/config/common_base b/config/common_base
index ad03cf433..00010de92 100644
--- a/config/common_base
+++ b/config/common_base
@@ -562,6 +562,7 @@ CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV=y
 # Compile PMD for octeontx sso event device
 #
 CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=y
+CONFIG_RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF=n
 
 #
 # Compile PMD for OPDL event device
diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c
index ffdfbb387..386eaa08f 100644
--- a/drivers/event/octeontx/timvf_evdev.c
+++ b/drivers/event/octeontx/timvf_evdev.c
@@ -162,10 +162,27 @@ timvf_ring_start(const struct rte_event_timer_adapter *adptr)
 		1ull << 48 |
 		1ull << 47 |
 		1ull << 44 |
+#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
+		1ull << 43 |
+#endif
 		(timr->meta.nb_bkts - 1);
 
 	rctrl.rctrl2 = (uint64_t)(TIM_CHUNK_SIZE / 16) << 40;
 
+#ifdef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
+	uintptr_t pool;
+	pool = (uintptr_t)((struct rte_mempool *)
+			timr->meta.chunk_pool)->pool_id;
+	ret = octeontx_fpa_bufpool_gpool(pool);
+	if (ret < 0) {
+		timvf_log_dbg("Unable to get gaura id");
+		ret = -ENOMEM;
+		goto error;
+	}
+	timvf_write64((uint64_t)ret,
+			(uint8_t *)timr->vbar0 + TIM_VRING_AURA);
+#endif
+
 	timvf_write64((uint64_t)timr->meta.bkt,
 			(uint8_t *)timr->vbar0 + TIM_VRING_BASE);
 	if (timvf_ring_conf_set(&rctrl, timr->tim_ring_id)) {
@@ -296,9 +313,15 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr)
 		return -ENOMEM;
 	}
 
+#ifdef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
+	ret = rte_mempool_set_ops_byname(timr->meta.chunk_pool,
+			"octeontx_fpavf", NULL);
+	timvf_log_dbg("Giving back chunks to fpa gaura : %d", ret);
+#else
 	ret = rte_mempool_set_ops_byname(timr->meta.chunk_pool,
 			RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL);
 	timvf_log_dbg("Not giving back chunks to fpa");
+#endif
 
 	if (ret != 0) {
 		timvf_log_err("Unable to set chunkpool ops.");
diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h
index 5e526a36a..02bd99a34 100644
--- a/drivers/event/octeontx/timvf_evdev.h
+++ b/drivers/event/octeontx/timvf_evdev.h
@@ -24,6 +24,9 @@
 #include <rte_reciprocal.h>
 
 #include <octeontx_mbox.h>
+#ifdef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
+#include <octeontx_fpavf.h>
+#endif
 
 #define timvf_log(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, otx_logtype_timvf, \
diff --git a/drivers/event/octeontx/timvf_worker.h b/drivers/event/octeontx/timvf_worker.h
index 320eb6ac1..c3f37372a 100644
--- a/drivers/event/octeontx/timvf_worker.h
+++ b/drivers/event/octeontx/timvf_worker.h
@@ -144,6 +144,7 @@ timr_bkt_clr_nent(struct tim_mem_bucket *bktp)
 	return __atomic_and_fetch((uint64_t *)&bktp->w1, v, __ATOMIC_ACQ_REL);
 }
 
+#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
 static inline __hot struct tim_mem_entry*
 timr_clr_bkt(struct timvf_ring *timr, struct tim_mem_bucket *bkt)
 {
@@ -159,6 +160,7 @@ timr_clr_bkt(struct timvf_ring *timr, struct tim_mem_bucket *bkt)
 	}
 	return (struct tim_mem_entry *)bkt->first_chunk;
 }
+#endif
 
 /* Burst mode functions */
 static inline int __hot
@@ -241,7 +243,16 @@ timvf_add_entry_brst(struct timvf_ring *timr, const uint16_t rel_bkt,
 				bkt->first_chunk = (uint64_t) chunk;
 			}
 		} else {
+#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
 			chunk = timr_clr_bkt(timr, bkt);
+#else
+			if (unlikely(rte_mempool_get(timr->meta.chunk_pool,
+							(void **)&chunk))) {
+				timr_bkt_set_rem(bkt, 0);
+				tim[index]->state = RTE_EVENT_TIMER_ERROR;
+				return -ENOMEM;
+			}
+#endif
 			bkt->first_chunk = (uint64_t) chunk;
 		}
 		*(uint64_t *)(chunk + nb_chunk_slots) = 0;
@@ -355,7 +366,18 @@ timvf_add_entry_sp(struct timvf_ring *timr, const uint32_t rel_bkt,
 			}
 			*(uint64_t *)(chunk + nb_chunk_slots) = 0;
 		} else {
+#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
 			chunk = timr_clr_bkt(timr, bkt);
+#else
+			if (unlikely(rte_mempool_get(timr->meta.chunk_pool,
+							(void **)&chunk))) {
+				timr_bkt_set_rem(bkt, 0);
+				tim->impl_opaque[0] =
+					tim->impl_opaque[1] = 0;
+				tim->state = RTE_EVENT_TIMER_ERROR;
+				return -ENOMEM;
+			}
+#endif
 			*(uint64_t *)(chunk + nb_chunk_slots) = 0;
 			bkt->first_chunk = (uint64_t) chunk;
 		}
@@ -438,7 +460,20 @@ timvf_add_entry_mp(struct timvf_ring *timr, const uint32_t rel_bkt,
 				}
 				*(uint64_t *)(chunk + nb_chunk_slots) = 0;
 			} else {
+#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF
 				chunk = timr_clr_bkt(timr, bkt);
+#else
+				if (unlikely(rte_mempool_get(
+							timr->meta.chunk_pool,
+							(void **)&chunk))) {
+					timr_bkt_set_rem(bkt, 0);
+					timr_bkt_dec_lock(bkt);
+					tim->impl_opaque[0] =
+						tim->impl_opaque[1] = 0;
+					tim->state = RTE_EVENT_TIMER_ERROR;
+					return -ENOMEM;
+				}
+#endif
 				*(uint64_t *)(chunk + nb_chunk_slots) = 0;
 				bkt->first_chunk = (uint64_t) chunk;
 			}
-- 
2.16.1

  parent reply	other threads:[~2018-02-16 21:37 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16 21:36 [dpdk-dev] [PATCH 0/9] event/octeontx: add event timer adapter driver Pavan Nikhilesh
2018-02-16 21:36 ` [dpdk-dev] [PATCH 01/10] eal: add API to align variable to previous power of 2 Pavan Nikhilesh
2018-02-17  4:49   ` Jerin Jacob
2018-02-16 21:36 ` [dpdk-dev] [PATCH 02/10] mempool/octeontx: probe timvf PCIe devices Pavan Nikhilesh
2018-02-17  4:54   ` Jerin Jacob
2018-02-19  9:19     ` Pavan Nikhilesh
2018-02-16 21:36 ` [dpdk-dev] [PATCH 03/10] event/octeontx: add support to create and free timer adapter Pavan Nikhilesh
2018-02-16 21:36 ` [dpdk-dev] [PATCH 04/10] event/octeontx: add support to start and stop timer device Pavan Nikhilesh
2018-02-16 21:36 ` [dpdk-dev] [PATCH 05/10] event/octeontx: add support for arm and cancel Pavan Nikhilesh
2018-02-16 21:36 ` [dpdk-dev] [PATCH 06/10] event/octeontx: add single producer timer arm variant Pavan Nikhilesh
2018-03-07 19:41   ` Carrillo, Erik G
2018-02-16 21:36 ` [dpdk-dev] [PATCH 07/10] event/octeontx: optimize timer adapter resolution parameters Pavan Nikhilesh
2018-02-17  5:06   ` Jerin Jacob
2018-02-19  9:34     ` Pavan Nikhilesh
2018-02-16 21:36 ` Pavan Nikhilesh [this message]
2018-02-18 11:42   ` [dpdk-dev] [PATCH 08/10] event/octeontx: add option to use fpavf as chunk pool santosh
2018-02-19  9:15     ` Pavan Nikhilesh
2018-02-23 20:17   ` Carrillo, Erik G
2018-02-26 19:25     ` Pavan Nikhilesh
2018-02-16 21:36 ` [dpdk-dev] [PATCH 09/10] event/octeontx: add timer adapter SW traversal routine Pavan Nikhilesh
2018-02-17  5:01   ` Jerin Jacob
2018-02-16 21:37 ` [dpdk-dev] [PATCH 10/10] maintainers: claim responsibility for octeontx timvf Pavan Nikhilesh
2018-02-17  5:03   ` Jerin Jacob
2018-03-14 13:52 ` [dpdk-dev] [PATCH v2 00/11] event/octeontx: add event timer adapter driver Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 01/11] mempool/octeontx: probe timvf PCIe devices Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 02/11] usertools: add Cavium TIM as an event device Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 03/11] event/octeontx: add support to create and free timer adapter Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 04/11] event/octeontx: add support to start and stop timer device Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 05/11] event/octeontx: add multiproducer timer arm and cancel Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 06/11] event/octeontx: add single producer timer arm variant Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 07/11] event/octeontx: add burst mode for timer arm Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 08/11] event/octeontx: optimize timer adapter resolution parameters Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 09/11] event/octeontx: add option to use fpavf as chunk pool Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 10/11] doc: update eventdev OcteonTx documentation Pavan Nikhilesh
2018-03-14 13:52   ` [dpdk-dev] [PATCH v2 11/11] maintainers: claim responsibility for octeontx timvf Pavan Nikhilesh
2018-04-03 15:05 ` [dpdk-dev] [PATCH v3 00/12] event/octeontx: add event timer adapter driver Pavan Nikhilesh
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 01/12] mempool/octeontx: probe timvf PCIe devices Pavan Nikhilesh
2018-04-08  2:19     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 02/12] usertools: add Cavium TIM as an event device Pavan Nikhilesh
2018-04-08  3:23     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 03/12] event/octeontx: add support to create and free timer adapter Pavan Nikhilesh
2018-04-08  7:39     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 04/12] event/octeontx: add support to start and stop timer device Pavan Nikhilesh
2018-04-08  7:47     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 05/12] event/octeontx: add event timer stats get and reset Pavan Nikhilesh
2018-04-04  1:59     ` Carrillo, Erik G
2018-04-08  7:52     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 06/12] event/octeontx: add multiproducer timer arm and cancel Pavan Nikhilesh
2018-04-08  7:59     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 07/12] event/octeontx: add single producer timer arm variant Pavan Nikhilesh
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 08/12] event/octeontx: add burst mode for timer arm Pavan Nikhilesh
2018-04-04  2:15     ` Carrillo, Erik G
2018-04-08  8:06     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 09/12] event/octeontx: optimize timer adapter resolution parameters Pavan Nikhilesh
2018-04-08  8:09     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 10/12] event/octeontx: add option to use fpavf as chunk pool Pavan Nikhilesh
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 11/12] doc: update eventdev OcteonTx documentation Pavan Nikhilesh
2018-04-04  2:19     ` Carrillo, Erik G
2018-04-08  8:13     ` Jerin Jacob
2018-04-03 15:05   ` [dpdk-dev] [PATCH v3 12/12] maintainers: claim responsibility for octeontx timvf Pavan Nikhilesh
2018-04-08  8:15     ` Jerin Jacob
2018-04-08  2:55   ` [dpdk-dev] [PATCH v3 00/12] event/octeontx: add event timer adapter driver Jerin Jacob
2018-04-08  8:58     ` Pavan Nikhilesh
2018-04-09 21:00 ` [dpdk-dev] [PATCH v4 00/11] " Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 01/11] usertools: add Cavium TIM as an event device Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 02/11] event/octeontx: add support to probe timvf PCIe devices Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 03/11] event/octeontx: add support to create and free timer adapter Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 04/11] event/octeontx: add support to start and stop timer device Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 05/11] event/octeontx: add event timer stats get and reset Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 06/11] event/octeontx: add multiproducer timer arm and cancel Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 07/11] event/octeontx: add single producer timer arm variant Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 08/11] event/octeontx: add burst mode for timer arm Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 09/11] event/octeontx: optimize timer adapter resolution parameters Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 10/11] event/octeontx: add option to use fpavf as chunk pool Pavan Nikhilesh
2018-04-09 21:00   ` [dpdk-dev] [PATCH v4 11/11] doc: update eventdev OcteonTx documentation Pavan Nikhilesh
2018-04-12 12:30   ` [dpdk-dev] [PATCH v4 00/11] event/octeontx: add event timer adapter driver Jerin Jacob

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=20180216213700.3415-9-pbhagavatula@caviumnetworks.com \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=santosh.shukla@caviumnetworks.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).