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 36EED1094 for ; Mon, 16 Jan 2017 16:41:12 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 16 Jan 2017 07:41:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,239,1477983600"; d="scan'208";a="213946945" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by fmsmga004.fm.intel.com with ESMTP; 16 Jan 2017 07:41:10 -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:44 +0000 Message-Id: <1484581255-148720-5-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 04/15] event/sw: add function to return device capabilities 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 Add in the info_get function to return details on the queues, flow, prioritization capabilities, etc. that this device has. Signed-off-by: Bruce Richardson Signed-off-by: Harry van Haaren --- drivers/event/sw/sw_evdev.c | 23 +++++++++++++++++++++++ drivers/event/sw/sw_evdev.h | 11 +++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index 29762b8..d75bf50 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -45,6 +45,28 @@ int sched_quanta = 128; +static void +sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info) +{ + RTE_SET_USED(dev); + + static const struct rte_event_dev_info evdev_sw_info = { + .driver_name = PMD_NAME, + .max_event_queues = RTE_EVENT_MAX_QUEUES_PER_DEV, + .max_event_queue_flows = SW_QID_NUM_FIDS, + .max_event_queue_priority_levels = SW_Q_PRIORITY_MAX, + .max_event_priority_levels = SW_IQS_MAX, + .max_event_ports = SW_PORTS_MAX, + .max_event_port_dequeue_depth = MAX_SW_CONS_Q_DEPTH, + .max_event_port_enqueue_depth = MAX_SW_PROD_Q_DEPTH, + .max_num_events = SW_INFLIGHT_EVENTS_TOTAL, + .event_dev_cap = (RTE_EVENT_DEV_CAP_QUEUE_QOS | + RTE_EVENT_DEV_CAP_EVENT_QOS), + }; + + *info = evdev_sw_info; +} + static int assign_numa_node(const char *key __rte_unused, const char *value, void *opaque) { @@ -69,6 +91,7 @@ static int sw_probe(const char *name, const char *params) { static const struct rte_eventdev_ops evdev_sw_ops = { + .dev_infos_get = sw_info_get, }; static const char *const args[] = { NUMA_NODE_ARG, SCHED_QUANTA_ARG, NULL }; diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h index 1400417..b6d99fd 100644 --- a/drivers/event/sw/sw_evdev.h +++ b/drivers/event/sw/sw_evdev.h @@ -36,6 +36,17 @@ #include #include +#define PMD_NAME "event_sw" + +#define SW_QID_NUM_FIDS 16384 +#define SW_IQS_MAX 4 +#define SW_Q_PRIORITY_MAX 255 +#define SW_PORTS_MAX 64 +#define MAX_SW_CONS_Q_DEPTH 128 +#define SW_INFLIGHT_EVENTS_TOTAL 4096 +/* allow for lots of over-provisioning */ +#define MAX_SW_PROD_Q_DEPTH 4096 + struct sw_evdev { struct rte_eventdev_data *data; }; -- 2.7.4