DPDK patches and discussions
 help / color / mirror / Atom feed
From: Abdullah Sevincer <abdullah.sevincer@intel.com>
To: dev@dpdk.org
Cc: jerinj@marvell.com, rashmi.shetty@intel.com,
	pravin.pathak@intel.com, mike.ximing.chen@intel.com,
	timothy.mcdaniel@intel.com, shivani.doneria@intel.com,
	tirthendu.sarkar@intel.com,
	Abdullah Sevincer <abdullah.sevincer@intel.com>
Subject: [PATCH v4 3/3] event/dlb2: optimize credit allocations
Date: Mon, 26 Sep 2022 20:42:04 -0500	[thread overview]
Message-ID: <20220927014204.1401746-3-abdullah.sevincer@intel.com> (raw)
In-Reply-To: <20220927014204.1401746-1-abdullah.sevincer@intel.com>

This commit implements the changes required for using suggested
port type hint feature. Each port uses different credit quanta
based on port type specified using port configuration flags.

Each port has separate quanta defined in dlb2_priv.h
Producer and consumer ports will need larger quanta value to reduce number
of credit calls they make. Workers can use small quanta as they mostly
work out of locally cached credits and don't request/return credits often.

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
---
 drivers/event/dlb2/dlb2.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 4dd1d55ddc..164ebbcfe2 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -1965,8 +1965,8 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,
 {
 	struct dlb2_eventdev *dlb2;
 	struct dlb2_eventdev_port *ev_port;
-	int ret;
 	uint32_t hw_credit_quanta, sw_credit_quanta;
+	int ret;
 
 	if (dev == NULL || port_conf == NULL) {
 		DLB2_LOG_ERR("Null parameter\n");
@@ -2067,6 +2067,24 @@ dlb2_eventdev_port_setup(struct rte_eventdev *dev,
 	ev_port->inflight_credits = 0;
 	ev_port->dlb2 = dlb2; /* reverse link */
 
+	/* Default for worker ports */
+	sw_credit_quanta = dlb2->sw_credit_quanta;
+	hw_credit_quanta = dlb2->hw_credit_quanta;
+
+	if (port_conf->event_port_cfg & RTE_EVENT_PORT_CFG_HINT_PRODUCER) {
+		/* Producer type ports. Mostly enqueue */
+		sw_credit_quanta = DLB2_SW_CREDIT_P_QUANTA_DEFAULT;
+		hw_credit_quanta = DLB2_SW_CREDIT_P_BATCH_SZ;
+	}
+	if (port_conf->event_port_cfg & RTE_EVENT_PORT_CFG_HINT_CONSUMER) {
+		/* Consumer type ports. Mostly dequeue */
+		sw_credit_quanta = DLB2_SW_CREDIT_C_QUANTA_DEFAULT;
+		hw_credit_quanta = DLB2_SW_CREDIT_C_BATCH_SZ;
+	}
+	ev_port->credit_update_quanta = sw_credit_quanta;
+	ev_port->qm_port.hw_credit_quanta = hw_credit_quanta;
+
+
 	/* Tear down pre-existing port->queue links */
 	if (dlb2->run_state == DLB2_RUN_STATE_STOPPED)
 		dlb2_port_link_teardown(dlb2, &dlb2->ev_ports[ev_port_id]);
-- 
2.25.1


  parent reply	other threads:[~2022-09-27  1:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-20  0:59 [PATCH 0/3] DLB2 Performance Optimizations Timothy McDaniel
2022-08-20  0:59 ` [PATCH 1/3] event/dlb2: add producer port probing optimization Timothy McDaniel
2022-09-03 13:16   ` Jerin Jacob
2022-09-26 22:55   ` [PATCH v3 " Abdullah Sevincer
2022-09-26 22:55     ` [PATCH v3 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-26 22:55     ` [PATCH v3 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-27  1:42   ` [PATCH v4 1/3] event/dlb2: add producer port probing optimization Abdullah Sevincer
2022-09-27  1:42     ` [PATCH v4 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-27  1:42     ` Abdullah Sevincer [this message]
2022-09-28 14:45     ` [PATCH v4 1/3] event/dlb2: add producer port probing optimization Jerin Jacob
2022-09-28 19:11     ` [PATCH v5 " Abdullah Sevincer
2022-09-28 19:11     ` [PATCH v5 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-28 19:19     ` [PATCH v6 1/3] event/dlb2: add producer port probing optimization Abdullah Sevincer
2022-09-28 19:19       ` [PATCH v6 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-28 19:19       ` [PATCH v6 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-28 20:28     ` [PATCH v7 1/3] event/dlb2: add producer port probing optimization Abdullah Sevincer
2022-09-28 20:28       ` [PATCH v7 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-28 20:28       ` [PATCH v7 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-29  1:32     ` [PATCH v8 1/3] event/dlb2: add producer port probing optimization Abdullah Sevincer
2022-09-29  1:32       ` [PATCH v8 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-29  1:32       ` [PATCH v8 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-29  2:48       ` [PATCH v8 1/3] event/dlb2: add producer port probing optimization Sevincer, Abdullah
2022-09-29  3:46     ` [PATCH v9 " Abdullah Sevincer
2022-09-29  3:46       ` [PATCH v9 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-29  3:46       ` [PATCH v9 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-29  5:03   ` [PATCH v10 1/3] event/dlb2: add producer port probing optimization Abdullah Sevincer
2022-09-29  5:03     ` [PATCH v10 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-29  5:03     ` [PATCH v10 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-29 15:26   ` [PATCH v11 1/3] event/dlb2: add producer port probing optimization Abdullah Sevincer
2022-09-29 15:26     ` [PATCH v11 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-29 15:26     ` [PATCH v11 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-29 23:58   ` [PATCH v12 1/3] event/dlb2: add producer port probing optimization Abdullah Sevincer
2022-09-29 23:58     ` [PATCH v12 2/3] event/dlb2: add fence bypass option for producer ports Abdullah Sevincer
2022-09-29 23:59     ` [PATCH v12 3/3] event/dlb2: optimize credit allocations Abdullah Sevincer
2022-09-30  8:28     ` [PATCH v12 1/3] event/dlb2: add producer port probing optimization Jerin Jacob
2022-08-20  0:59 ` [PATCH 2/3] event/dlb2: add fence bypass option for producer ports Timothy McDaniel
2022-08-20  0:59 ` [PATCH 3/3] event/dlb2: optimize credit allocations Timothy McDaniel

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=20220927014204.1401746-3-abdullah.sevincer@intel.com \
    --to=abdullah.sevincer@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=mike.ximing.chen@intel.com \
    --cc=pravin.pathak@intel.com \
    --cc=rashmi.shetty@intel.com \
    --cc=shivani.doneria@intel.com \
    --cc=timothy.mcdaniel@intel.com \
    --cc=tirthendu.sarkar@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).