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 76CCEA04C1; Fri, 11 Sep 2020 22:33:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68AF51C240; Fri, 11 Sep 2020 22:30:40 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 61A8B1C139 for ; Fri, 11 Sep 2020 22:30:09 +0200 (CEST) IronPort-SDR: OFe84XO2vSlwOmImqUGj3OIZPTo0bzNqxFaczveOCDRVysPH445+lSpxMgPs7AOo4D1yR75kkl 6+5UrVs9Kt+w== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="156244389" X-IronPort-AV: E=Sophos;i="5.76,417,1592895600"; d="scan'208";a="156244389" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 13:30:08 -0700 IronPort-SDR: +Xs4QipM7i53fXT3raMm/ieURQm4Dp5TwNyS6dD9SVic63WKkuPhQdHa2rODrtXe43JgLG0c7F Hh3kjIvn01LA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,417,1592895600"; d="scan'208";a="481453676" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga005.jf.intel.com with ESMTP; 11 Sep 2020 13:30:06 -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 15:26:23 -0500 Message-Id: <1599855987-25976-19-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1599855987-25976-1-git-send-email-timothy.mcdaniel@intel.com> References: <1599855987-25976-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH 18/22] event/dlb2: 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/dlb2/meson.build | 5 ++- drivers/event/dlb2/rte_pmd_dlb2.c | 39 +++++++++++++++++++++++ drivers/event/dlb2/rte_pmd_dlb2_event_version.map | 6 ++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 drivers/event/dlb2/rte_pmd_dlb2.c diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build index 492452e..4549a75 100644 --- a/drivers/event/dlb2/meson.build +++ b/drivers/event/dlb2/meson.build @@ -1,3 +1,4 @@ + # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019-2020 Intel Corporation @@ -6,7 +7,9 @@ sources = files('dlb2.c', 'dlb2_xstats.c', 'pf/dlb2_main.c', 'pf/dlb2_pf.c', - 'pf/base/dlb2_resource.c' + 'pf/base/dlb2_resource.c', + 'rte_pmd_dlb2.c' ) deps += ['mbuf', 'mempool', 'ring', 'bus_vdev', 'pci', 'bus_pci'] +install_headers('rte_pmd_dlb2.h') \ No newline at end of file diff --git a/drivers/event/dlb2/rte_pmd_dlb2.c b/drivers/event/dlb2/rte_pmd_dlb2.c new file mode 100644 index 0000000..b09b585 --- /dev/null +++ b/drivers/event/dlb2/rte_pmd_dlb2.c @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2020 Intel Corporation + */ + +#include +#include + +#include "rte_pmd_dlb2.h" +#include "dlb2_priv.h" +#include "dlb2_inline_fns.h" + +int +rte_pmd_dlb2_set_token_pop_mode(uint8_t dev_id, + uint8_t port_id, + enum dlb2_token_pop_mode mode) +{ + struct dlb2_eventdev *dlb2; + struct rte_eventdev *dev; + + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); + dev = &rte_eventdevs[dev_id]; + + dlb2 = dlb2_pmd_priv(dev); + + if (mode >= NUM_TOKEN_POP_MODES) + return -EINVAL; + + /* The event device must be configured, but not yet started */ + if (!dlb2->configured || dlb2->run_state != DLB2_RUN_STATE_STOPPED) + return -EINVAL; + + /* The token pop mode must be set before configuring the port */ + if (port_id >= dlb2->num_ports || dlb2->ev_ports[port_id].setup_done) + return -EINVAL; + + dlb2->ev_ports[port_id].qm_port.token_pop_mode = mode; + + return 0; +} diff --git a/drivers/event/dlb2/rte_pmd_dlb2_event_version.map b/drivers/event/dlb2/rte_pmd_dlb2_event_version.map index 299ae63..84b81a4 100644 --- a/drivers/event/dlb2/rte_pmd_dlb2_event_version.map +++ b/drivers/event/dlb2/rte_pmd_dlb2_event_version.map @@ -1,3 +1,9 @@ DPDK_21.0 { local: *; }; + +EXPERIMENTAL { + global: + + rte_pmd_dlb2_set_token_pop_mode; +}; -- 2.6.4