DPDK patches and discussions
 help / color / mirror / Atom feed
From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>, Pavan Nikhilesh <pbhagavatula@marvell.com>,
	"John McNamara" <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v3 42/42] event/octeontx2: add devargs to control adapter parameters
Date: Fri, 28 Jun 2019 23:53:53 +0530	[thread overview]
Message-ID: <20190628182354.228-43-pbhagavatula@marvell.com> (raw)
In-Reply-To: <20190628182354.228-1-pbhagavatula@marvell.com>

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add devargs to control each event timer adapter i.e. TIM rings internal
parameters uniquely. The following dict format is expected
[ring-chnk_slots-disable_npa-stats_ena]. 0 represents default values.
Example:

	--dev "0002:0e:00.0,tim_ring_ctl=[2-1023-1-0]"

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/eventdevs/octeontx2.rst       | 10 +++
 drivers/event/octeontx2/otx2_tim_evdev.c | 87 +++++++++++++++++++++++-
 drivers/event/octeontx2/otx2_tim_evdev.h | 10 +++
 3 files changed, 106 insertions(+), 1 deletion(-)

diff --git a/doc/guides/eventdevs/octeontx2.rst b/doc/guides/eventdevs/octeontx2.rst
index baa866a1e..e5624ba23 100644
--- a/doc/guides/eventdevs/octeontx2.rst
+++ b/doc/guides/eventdevs/octeontx2.rst
@@ -132,6 +132,16 @@ Runtime Config Options
 
     --dev "0002:0e:00.0,tim_rings_lmt=5"
 
+- ``TIM ring control internal parameters``
+
+  When using multiple TIM rings the ``tim_ring_ctl`` devargs can be used to
+  control each TIM rings internal parameters uniquely. The following dict
+  format is expected [ring-chnk_slots-disable_npa-stats_ena]. 0 represents
+  default values.
+  For Example::
+
+    --dev "0002:0e:00.0,tim_ring_ctl=[2-1023-1-0]"
+
 Debugging Options
 ~~~~~~~~~~~~~~~~~
 
diff --git a/drivers/event/octeontx2/otx2_tim_evdev.c b/drivers/event/octeontx2/otx2_tim_evdev.c
index c312bd541..446807606 100644
--- a/drivers/event/octeontx2/otx2_tim_evdev.c
+++ b/drivers/event/octeontx2/otx2_tim_evdev.c
@@ -255,7 +255,7 @@ otx2_tim_ring_create(struct rte_event_timer_adapter *adptr)
 	struct tim_lf_alloc_req *req;
 	struct tim_lf_alloc_rsp *rsp;
 	uint64_t nb_timers;
-	int rc;
+	int i, rc;
 
 	if (dev == NULL)
 		return -ENODEV;
@@ -304,6 +304,18 @@ otx2_tim_ring_create(struct rte_event_timer_adapter *adptr)
 	tim_ring->disable_npa = dev->disable_npa;
 	tim_ring->enable_stats = dev->enable_stats;
 
+	for (i = 0; i < dev->ring_ctl_cnt ; i++) {
+		struct otx2_tim_ctl *ring_ctl = &dev->ring_ctl_data[i];
+
+		if (ring_ctl->ring == tim_ring->ring_id) {
+			tim_ring->chunk_sz = ring_ctl->chunk_slots ?
+				((uint32_t)(ring_ctl->chunk_slots + 1) *
+				 OTX2_TIM_CHUNK_ALIGNMENT) : tim_ring->chunk_sz;
+			tim_ring->enable_stats = ring_ctl->enable_stats;
+			tim_ring->disable_npa = ring_ctl->disable_npa;
+		}
+	}
+
 	tim_ring->nb_chunks = nb_timers / OTX2_TIM_NB_CHUNK_SLOTS(
 							tim_ring->chunk_sz);
 	tim_ring->nb_chunk_slots = OTX2_TIM_NB_CHUNK_SLOTS(tim_ring->chunk_sz);
@@ -528,6 +540,77 @@ otx2_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
 #define OTX2_TIM_CHNK_SLOTS	"tim_chnk_slots"
 #define OTX2_TIM_STATS_ENA	"tim_stats_ena"
 #define OTX2_TIM_RINGS_LMT	"tim_rings_lmt"
+#define OTX2_TIM_RING_CTL	"tim_ring_ctl"
+
+static void
+tim_parse_ring_param(char *value, void *opaque)
+{
+	struct otx2_tim_evdev *dev = opaque;
+	struct otx2_tim_ctl ring_ctl = {0};
+	char *tok = strtok(value, "-");
+	uint16_t *val;
+
+	val = (uint16_t *)&ring_ctl;
+
+	if (!strlen(value))
+		return;
+
+	while (tok != NULL) {
+		*val = atoi(tok);
+		tok = strtok(NULL, "-");
+		val++;
+	}
+
+	if (val != (&ring_ctl.enable_stats + 1)) {
+		otx2_err(
+		"Invalid ring param expected [ring-chunk_sz-disable_npa-enable_stats]");
+		return;
+	}
+
+	dev->ring_ctl_cnt++;
+	dev->ring_ctl_data = rte_realloc(dev->ring_ctl_data,
+			sizeof(struct otx2_tim_ctl), 0);
+	dev->ring_ctl_data[dev->ring_ctl_cnt - 1] = ring_ctl;
+}
+
+static void
+tim_parse_ring_ctl_list(const char *value, void *opaque)
+{
+	char *s = strdup(value);
+	char *start = NULL;
+	char *end = NULL;
+	char *f = s;
+
+	while (*s) {
+		if (*s == '[')
+			start = s;
+		else if (*s == ']')
+			end = s;
+
+		if (start < end && *start) {
+			*end = 0;
+			tim_parse_ring_param(start + 1, opaque);
+			start = end;
+			s = end;
+		}
+		s++;
+	}
+
+	free(f);
+}
+
+static int
+tim_parse_kvargs_dict(const char *key, const char *value, void *opaque)
+{
+	RTE_SET_USED(key);
+
+	/* Dict format [ring-chunk_sz-disable_npa-enable_stats] use '-' as ','
+	 * isn't allowed. 0 represents default.
+	 */
+	tim_parse_ring_ctl_list(value, opaque);
+
+	return 0;
+}
 
 static void
 tim_parse_devargs(struct rte_devargs *devargs, struct otx2_tim_evdev *dev)
@@ -549,6 +632,8 @@ tim_parse_devargs(struct rte_devargs *devargs, struct otx2_tim_evdev *dev)
 			   &dev->enable_stats);
 	rte_kvargs_process(kvlist, OTX2_TIM_RINGS_LMT, &parse_kvargs_value,
 			   &dev->min_ring_cnt);
+	rte_kvargs_process(kvlist, OTX2_TIM_RING_CTL,
+			   &tim_parse_kvargs_dict, &dev);
 }
 
 void
diff --git a/drivers/event/octeontx2/otx2_tim_evdev.h b/drivers/event/octeontx2/otx2_tim_evdev.h
index 5af724ef9..eec0189c1 100644
--- a/drivers/event/octeontx2/otx2_tim_evdev.h
+++ b/drivers/event/octeontx2/otx2_tim_evdev.h
@@ -111,6 +111,13 @@ struct otx2_tim_ent {
 	uint64_t wqe;
 } __rte_packed;
 
+struct otx2_tim_ctl {
+	uint16_t ring;
+	uint16_t chunk_slots;
+	uint16_t disable_npa;
+	uint16_t enable_stats;
+};
+
 struct otx2_tim_evdev {
 	struct rte_pci_device *pci_dev;
 	struct rte_eventdev *event_dev;
@@ -123,6 +130,9 @@ struct otx2_tim_evdev {
 	uint16_t chunk_slots;
 	uint16_t min_ring_cnt;
 	uint8_t enable_stats;
+	uint16_t ring_ctl_cnt;
+	struct otx2_tim_ctl *ring_ctl_data;
+	/* HW const */
 	/* MSIX offsets */
 	uint16_t tim_msixoff[OTX2_MAX_TIM_RINGS];
 };
-- 
2.22.0


  parent reply	other threads:[~2019-06-28 18:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 18:23 [dpdk-dev] [PATCH v3 00/42] OCTEONTX2 event device driver pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 01/42] event/octeontx2: add build infra and device probe pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 02/42] event/octeontx2: add init and fini for octeontx2 SSO object pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 03/42] event/octeontx2: add device capabilities function pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 04/42] event/octeontx2: add device configure function pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 05/42] event/octeontx2: add event queue config functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 06/42] event/octeontx2: allocate event inflight buffers pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 07/42] event/octeontx2: add devargs for inflight buffer count pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 08/42] event/octeontx2: add event port config functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 09/42] event/octeontx2: support linking queues to ports pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 10/42] event/octeontx2: support dequeue timeout tick conversion pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 11/42] event/octeontx2: add SSO GWS and GGRP IRQ handlers pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 12/42] event/octeontx2: add register dump functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 13/42] event/octeontx2: add xstats support pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 14/42] event/octeontx2: add SSO HW device operations pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 15/42] event/octeontx2: add worker enqueue functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 16/42] event/octeontx2: add worker dequeue functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 17/42] event/octeontx2: add octeontx2 SSO dual workslot mode pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 18/42] event/octeontx2: add SSO dual GWS HW device operations pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 19/42] event/octeontx2: add worker dual GWS enqueue functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 20/42] event/octeontx2: add worker dual GWS dequeue functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 21/42] event/octeontx2: add devargs to force legacy mode pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 22/42] event/octeontx2: add device start function pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 23/42] event/octeontx2: add devargs to control SSO GGRP QoS pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 24/42] event/octeontx2: add device stop and close functions pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 25/42] event/octeontx2: add SSO selftest pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 26/42] event/octeontx2: add event timer support pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 27/42] event/octeontx2: add timer adapter capabilities pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 28/42] event/octeontx2: create and free timer adapter pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 29/42] event/octeontx2: allow TIM to optimize config pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 30/42] event/octeontx2: add devargs to disable NPA pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 31/42] event/octeontx2: add devargs to modify chunk slots pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 32/42] event/octeontx2: add TIM IRQ handlers pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 33/42] event/octeontx2: allow adapters to resize inflight buffers pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 34/42] event/octeontx2: add timer adapter info get function pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 35/42] event/octeontx2: add TIM bucket operations pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 36/42] event/octeontx2: add event timer arm routine pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 37/42] event/octeontx2: add event timer arm timeout burst pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 38/42] event/octeontx2: add event timer cancel function pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 39/42] event/octeontx2: add event timer stats get and reset pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 40/42] event/octeontx2: add even timer adapter start and stop pbhagavatula
2019-06-28 18:23 ` [dpdk-dev] [PATCH v3 41/42] event/octeontx2: add devargs to limit timer adapters pbhagavatula
2019-06-28 18:23 ` pbhagavatula [this message]
2019-07-02  4:25 ` [dpdk-dev] [PATCH v3 00/42] OCTEONTX2 event device driver Jerin Jacob Kollanukkaran

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=20190628182354.228-43-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.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).