From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 841F01094 for ; Mon, 16 Jan 2017 16:41:13 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 16 Jan 2017 07:41:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,239,1477983600"; d="scan'208";a="213946949" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by fmsmga004.fm.intel.com with ESMTP; 16 Jan 2017 07:41:11 -0800 From: Harry van Haaren To: jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Bruce Richardson , Harry van Haaren Date: Mon, 16 Jan 2017 15:40:45 +0000 Message-Id: <1484581255-148720-6-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484581255-148720-1-git-send-email-harry.van.haaren@intel.com> References: <1484581255-148720-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH 05/15] event/sw: add configure function 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: , X-List-Received-Date: Mon, 16 Jan 2017 15:41:13 -0000 From: Bruce Richardson Signed-off-by: Bruce Richardson Signed-off-by: Harry van Haaren --- drivers/event/sw/sw_evdev.c | 17 +++++++++++++++++ drivers/event/sw/sw_evdev.h | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index d75bf50..1bdcc05 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -45,6 +45,22 @@ int sched_quanta = 128; +static int +sw_dev_configure(const struct rte_eventdev *dev) +{ + struct sw_evdev *sw = sw_pmd_priv(dev); + const struct rte_eventdev_data *data = dev->data; + const struct rte_event_dev_config *conf = &data->dev_conf; + + sw->qid_count = conf->nb_event_queues; + sw->port_count = conf->nb_event_ports; + sw->nb_events_limit = conf->nb_events_limit; + uint32_t quanta_pool = conf->nb_events_limit / SW_INFLIGHT_QUANTA_SIZE; + rte_atomic32_set(&sw->inflight_quanta, quanta_pool); + + return 0; +} + static void sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info) { @@ -91,6 +107,7 @@ static int sw_probe(const char *name, const char *params) { static const struct rte_eventdev_ops evdev_sw_ops = { + .dev_configure = sw_dev_configure, .dev_infos_get = sw_info_get, }; diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h index b6d99fd..514b0b1 100644 --- a/drivers/event/sw/sw_evdev.h +++ b/drivers/event/sw/sw_evdev.h @@ -35,6 +35,7 @@ #include #include +#include #define PMD_NAME "event_sw" @@ -46,9 +47,21 @@ #define SW_INFLIGHT_EVENTS_TOTAL 4096 /* allow for lots of over-provisioning */ #define MAX_SW_PROD_Q_DEPTH 4096 +#define SW_INFLIGHT_QUANTA_SIZE 32 struct sw_evdev { struct rte_eventdev_data *data; + + uint32_t port_count; + uint32_t qid_count; + + rte_atomic32_t inflight_quanta __rte_cache_aligned; + /* + * max events in this instance. Cached here for performance. + * (also available in data->conf.nb_events_limit) + */ + uint32_t nb_events_limit; + }; static inline struct sw_evdev * -- 2.7.4