[dpdk-dev,v5,03/20] event/sw: add device capabilities function

Message ID 1490374395-149320-4-git-send-email-harry.van.haaren@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Van Haaren, Harry March 24, 2017, 4:52 p.m. UTC
  From: Bruce Richardson <bruce.richardson@intel.com>

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 <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/event/sw/sw_evdev.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
  

Comments

Jerin Jacob March 25, 2017, 10:50 a.m. UTC | #1
On Fri, Mar 24, 2017 at 04:52:58PM +0000, Harry van Haaren wrote:
> From: Bruce Richardson <bruce.richardson@intel.com>
> 
> 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 <bruce.richardson@intel.com>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>


Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

> ---
>  drivers/event/sw/sw_evdev.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
> index 4de9bc1..9d8517a 100644
> --- a/drivers/event/sw/sw_evdev.c
> +++ b/drivers/event/sw/sw_evdev.c
> @@ -44,6 +44,28 @@
>  #define SCHED_QUANTA_ARG "sched_quanta"
>  #define CREDIT_QUANTA_ARG "credit_quanta"
>  
> +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 = SW_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)
>  {
> @@ -78,6 +100,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[] = {
> -- 
> 2.7.4
>
  

Patch

diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index 4de9bc1..9d8517a 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -44,6 +44,28 @@ 
 #define SCHED_QUANTA_ARG "sched_quanta"
 #define CREDIT_QUANTA_ARG "credit_quanta"
 
+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 = SW_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)
 {
@@ -78,6 +100,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[] = {