From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1622BA034C; Sat, 20 Aug 2022 03:00:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48C9F427F4; Sat, 20 Aug 2022 03:00:12 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 56B5140E2D for ; Sat, 20 Aug 2022 03:00:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660957207; x=1692493207; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DWZdkggUafsu/28Y1+GX8uAAVhQssxQoSl71O5daW3M=; b=PZoAL6E5ie211kkeMF5YvJ91E3ioU/WONxbh97L9M09K6Pv/yhkLEu9M afM3Mnz5NmNN8YWoODKuFe4w3E9PvChtDZ5RN5ahEd3w73JicKF+jX0FC 0AzyrrC2tjitCasMLZvwUswTKLpch/jSwIwUpwBXdSBUFNYpo2Ck37g/t W3f+nzqPpP62fJ5pmm9LgruNmC7swBezO5NRb0ugQUFCm9f/txWu5K/2b wfxPhMFg4anrnflkcCa8iM/n4gCU55b3mphTR+5E3Qqm35PfjEoZUDlIf ioaqEp+B1RWwUsbJglO9CwHiNOBlAy3y9/J71DuYO3bwAGTgpJ3EmgeTO w==; X-IronPort-AV: E=McAfee;i="6500,9779,10444"; a="357119061" X-IronPort-AV: E=Sophos;i="5.93,249,1654585200"; d="scan'208";a="357119061" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2022 18:00:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,249,1654585200"; d="scan'208";a="668803548" Received: from txanpdk03.an.intel.com ([10.123.117.78]) by fmsmga008.fm.intel.com with ESMTP; 19 Aug 2022 18:00:04 -0700 From: Timothy McDaniel To: jerinj@marvell.com Cc: dev@dpdk.org Subject: [PATCH 3/3] event/dlb2: optimize credit allocations Date: Fri, 19 Aug 2022 19:59:57 -0500 Message-Id: <20220820005957.2986689-4-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220820005957.2986689-1-timothy.mcdaniel@intel.com> References: <20220820005957.2986689-1-timothy.mcdaniel@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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: Timothy McDaniel --- drivers/event/dlb2/dlb2.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c index 76f51736c4..438184bb27 100644 --- a/drivers/event/dlb2/dlb2.c +++ b/drivers/event/dlb2/dlb2.c @@ -1945,8 +1945,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"); @@ -2047,6 +2047,23 @@ 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.23.0