diff mbox series

[v5,04/35] event/cnxk: add device capabilities function

Message ID 20210504002726.525-5-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers show
Series Marvell CNXK Event device Driver | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Bhagavatula May 4, 2021, 12:26 a.m. UTC
From: Shijith Thotton <sthotton@marvell.com>

Add the info_get function to return details on the queues, flow,
prioritization capabilities, etc. which this device has.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/cnxk/cnxk_eventdev.c | 24 ++++++++++++++++++++++++
 drivers/event/cnxk/cnxk_eventdev.h |  4 ++++
 2 files changed, 28 insertions(+)
diff mbox series

Patch

diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c
index 7ea782eaa..3a7053af6 100644
--- a/drivers/event/cnxk/cnxk_eventdev.c
+++ b/drivers/event/cnxk/cnxk_eventdev.c
@@ -4,6 +4,30 @@ 
 
 #include "cnxk_eventdev.h"
 
+void
+cnxk_sso_info_get(struct cnxk_sso_evdev *dev,
+		  struct rte_event_dev_info *dev_info)
+{
+
+	dev_info->min_dequeue_timeout_ns = dev->min_dequeue_timeout_ns;
+	dev_info->max_dequeue_timeout_ns = dev->max_dequeue_timeout_ns;
+	dev_info->max_event_queues = dev->max_event_queues;
+	dev_info->max_event_queue_flows = (1ULL << 20);
+	dev_info->max_event_queue_priority_levels = 8;
+	dev_info->max_event_priority_levels = 1;
+	dev_info->max_event_ports = dev->max_event_ports;
+	dev_info->max_event_port_dequeue_depth = 1;
+	dev_info->max_event_port_enqueue_depth = 1;
+	dev_info->max_num_events = dev->max_num_events;
+	dev_info->event_dev_cap = RTE_EVENT_DEV_CAP_QUEUE_QOS |
+				  RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED |
+				  RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES |
+				  RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK |
+				  RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT |
+				  RTE_EVENT_DEV_CAP_NONSEQ_MODE |
+				  RTE_EVENT_DEV_CAP_CARRY_FLOW_ID;
+}
+
 int
 cnxk_sso_init(struct rte_eventdev *event_dev)
 {
diff --git a/drivers/event/cnxk/cnxk_eventdev.h b/drivers/event/cnxk/cnxk_eventdev.h
index 74d0990fa..9745bfd3e 100644
--- a/drivers/event/cnxk/cnxk_eventdev.h
+++ b/drivers/event/cnxk/cnxk_eventdev.h
@@ -17,6 +17,8 @@ 
 
 struct cnxk_sso_evdev {
 	struct roc_sso sso;
+	uint8_t max_event_queues;
+	uint8_t max_event_ports;
 	uint8_t is_timeout_deq;
 	uint8_t nb_event_queues;
 	uint8_t nb_event_ports;
@@ -35,5 +37,7 @@  cnxk_sso_pmd_priv(const struct rte_eventdev *event_dev)
 int cnxk_sso_init(struct rte_eventdev *event_dev);
 int cnxk_sso_fini(struct rte_eventdev *event_dev);
 int cnxk_sso_remove(struct rte_pci_device *pci_dev);
+void cnxk_sso_info_get(struct cnxk_sso_evdev *dev,
+		       struct rte_event_dev_info *dev_info);
 
 #endif /* __CNXK_EVENTDEV_H__ */