From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 472BBA04C1; Fri, 11 Sep 2020 21:25:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E4E31C225; Fri, 11 Sep 2020 21:22:32 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 328E81C19A for ; Fri, 11 Sep 2020 21:22:16 +0200 (CEST) IronPort-SDR: dri3GSs5ulr9uBOAHAWYITw5byEhAhNiY6T7riiI7qZSXk3WFnnGWpN9k+g57b/enUUssefH43 SUJ2OxUijtDw== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="146570562" X-IronPort-AV: E=Sophos;i="5.76,416,1592895600"; d="scan'208";a="146570562" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 12:22:15 -0700 IronPort-SDR: apJJ2CEated8csYqQh1L1WHOp/yxaWVYfi0XDgJ4t9lFbZwuARtABbxYYTqqFwe8hIV1TFUlfb PvGVfje52dpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,416,1592895600"; d="scan'208";a="506375716" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga005.fm.intel.com with ESMTP; 11 Sep 2020 12:22:15 -0700 From: Timothy McDaniel To: Ray Kinsella , Neil Horman Cc: dev@dpdk.org, erik.g.carrillo@intel.com, gage.eads@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com Date: Fri, 11 Sep 2020 14:18:36 -0500 Message-Id: <1599851920-16802-19-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1599851920-16802-1-git-send-email-timothy.mcdaniel@intel.com> References: <1599851920-16802-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH v4 18/22] event/dlb: add PMD's token pop public interface X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The PMD uses a public interface to allow applications to control the token pop mode. Supported token pop modes are as follows, and they impact core scheduling affinity for ldb ports. AUTO_POP: Pop the CQ tokens immediately after dequeueing. DELAYED_POP: Pop CQ tokens after (dequeue_depth - 1) events are released. Supported on load-balanced ports only. DEFERRED_POP: Pop the CQ tokens during next dequeue operation. Signed-off-by: Timothy McDaniel --- drivers/event/dlb/meson.build | 4 ++- drivers/event/dlb/rte_pmd_dlb.c | 38 +++++++++++++++++++++++++ drivers/event/dlb/rte_pmd_dlb_event_version.map | 6 ++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 drivers/event/dlb/rte_pmd_dlb.c diff --git a/drivers/event/dlb/meson.build b/drivers/event/dlb/meson.build index 6f87274..d7aeb3b 100644 --- a/drivers/event/dlb/meson.build +++ b/drivers/event/dlb/meson.build @@ -6,7 +6,9 @@ sources = files('dlb.c', 'dlb_xstats.c', 'pf/dlb_main.c', 'pf/dlb_pf.c', - 'pf/base/dlb_resource.c' + 'pf/base/dlb_resource.c', + 'rte_pmd_dlb.c', ) deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci'] +install_headers('rte_pmd_dlb.h') diff --git a/drivers/event/dlb/rte_pmd_dlb.c b/drivers/event/dlb/rte_pmd_dlb.c new file mode 100644 index 0000000..bc802d3 --- /dev/null +++ b/drivers/event/dlb/rte_pmd_dlb.c @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2020 Intel Corporation + */ + +#include "rte_eventdev.h" +#include "rte_eventdev_pmd.h" +#include "rte_pmd_dlb.h" +#include "dlb_priv.h" +#include "dlb_inline_fns.h" + +int +rte_pmd_dlb_set_token_pop_mode(uint8_t dev_id, + uint8_t port_id, + enum dlb_token_pop_mode mode) +{ + struct dlb_eventdev *dlb; + struct rte_eventdev *dev; + + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); + dev = &rte_eventdevs[dev_id]; + + dlb = dlb_pmd_priv(dev); + + if (mode >= NUM_TOKEN_POP_MODES) + return -EINVAL; + + /* The event device must be configured, but not yet started */ + if (!dlb->configured || dlb->run_state != DLB_RUN_STATE_STOPPED) + return -EINVAL; + + /* The token pop mode must be set before configuring the port */ + if (port_id >= dlb->num_ports || dlb->ev_ports[port_id].setup_done) + return -EINVAL; + + dlb->ev_ports[port_id].qm_port.token_pop_mode = mode; + + return 0; +} diff --git a/drivers/event/dlb/rte_pmd_dlb_event_version.map b/drivers/event/dlb/rte_pmd_dlb_event_version.map index 299ae63..b7b65d3 100644 --- a/drivers/event/dlb/rte_pmd_dlb_event_version.map +++ b/drivers/event/dlb/rte_pmd_dlb_event_version.map @@ -1,3 +1,9 @@ DPDK_21.0 { local: *; }; + +EXPERIMENTAL { + global: + + rte_pmd_dlb_set_token_pop_mode; +}; -- 2.6.4