From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 99FC5CF9C for ; Fri, 24 Mar 2017 17:53:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490374399; x=1521910399; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ngTrXeI3ELk/G8aY840aHqsBwRPaNfuBzMXBnSBK72A=; b=DlMj3FCJ6S6JepvbcCqTzjwK5QZbRzUDHhmqXnQYcQerBQRsAJDebLQ6 +38g8a1pyBtjAlG0qzJIxyqbgqktTw==; Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Mar 2017 09:53:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,215,1486454400"; d="scan'208";a="70349089" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by orsmga004.jf.intel.com with ESMTP; 24 Mar 2017 09:53:17 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Bruce Richardson , Harry van Haaren Date: Fri, 24 Mar 2017 16:52:59 +0000 Message-Id: <1490374395-149320-5-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490374395-149320-1-git-send-email-harry.van.haaren@intel.com> References: <489175012-101439-1-git-send-email-harry.van.haaren@intel.com> <1490374395-149320-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH v5 04/20] 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: Fri, 24 Mar 2017 16:53:20 -0000 From: Bruce Richardson Signed-off-by: Bruce Richardson Signed-off-by: Harry van Haaren --- drivers/event/sw/sw_evdev.c | 15 +++++++++++++++ drivers/event/sw/sw_evdev.h | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index 9d8517a..28a2326 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -44,6 +44,20 @@ #define SCHED_QUANTA_ARG "sched_quanta" #define CREDIT_QUANTA_ARG "credit_quanta" +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; + + return 0; +} + static void sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info) { @@ -100,6 +114,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 ab315d4..fda57df 100644 --- a/drivers/event/sw/sw_evdev.h +++ b/drivers/event/sw/sw_evdev.h @@ -35,6 +35,7 @@ #include #include +#include #define SW_DEFAULT_CREDIT_QUANTA 32 #define SW_DEFAULT_SCHED_QUANTA 128 @@ -129,7 +130,17 @@ struct sw_qid { struct sw_evdev { struct rte_eventdev_data *data; + uint32_t port_count; + uint32_t qid_count; + + /* + * max events in this instance. Cached here for performance. + * (also available in data->conf.nb_events_limit) + */ + uint32_t nb_events_limit; + int32_t sched_quanta; + uint32_t credit_update_quanta; }; -- 2.7.4