From: Pavan Nikhilesh <pbhagavat...@marvell.com>

Add CN20K event port profile switch.

Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com>
---
 drivers/event/cnxk/cn20k_eventdev.c |  1 +
 drivers/event/cnxk/cn20k_worker.c   | 11 +++++++++++
 drivers/event/cnxk/cn20k_worker.h   |  1 +
 3 files changed, 13 insertions(+)

diff --git a/drivers/event/cnxk/cn20k_eventdev.c 
b/drivers/event/cnxk/cn20k_eventdev.c
index 56e3eb87fb..53b0b43199 100644
--- a/drivers/event/cnxk/cn20k_eventdev.c
+++ b/drivers/event/cnxk/cn20k_eventdev.c
@@ -124,6 +124,7 @@ cn20k_sso_fp_fns_set(struct rte_eventdev *event_dev)
        if (dev->deq_tmo_ns)
                event_dev->dequeue_burst = cn20k_sso_hws_tmo_deq_burst;
 
+       event_dev->profile_switch = cn20k_sso_hws_profile_switch;
 #else
        RTE_SET_USED(event_dev);
 #endif
diff --git a/drivers/event/cnxk/cn20k_worker.c 
b/drivers/event/cnxk/cn20k_worker.c
index 2dcde0b444..2c723523d2 100644
--- a/drivers/event/cnxk/cn20k_worker.c
+++ b/drivers/event/cnxk/cn20k_worker.c
@@ -383,6 +383,17 @@ cn20k_sso_hws_enq_fwd_burst(void *port, const struct 
rte_event ev[], uint16_t nb
        return 1;
 }
 
+int __rte_hot
+cn20k_sso_hws_profile_switch(void *port, uint8_t profile)
+{
+       struct cn20k_sso_hws *ws = port;
+
+       ws->gw_wdata &= ~(0xFFUL);
+       ws->gw_wdata |= (profile + 1);
+
+       return 0;
+}
+
 uint16_t __rte_hot
 cn20k_sso_hws_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
 {
diff --git a/drivers/event/cnxk/cn20k_worker.h 
b/drivers/event/cnxk/cn20k_worker.h
index 8dc60a06ec..447f28f0f2 100644
--- a/drivers/event/cnxk/cn20k_worker.h
+++ b/drivers/event/cnxk/cn20k_worker.h
@@ -145,6 +145,7 @@ uint16_t __rte_hot cn20k_sso_hws_enq_new_burst(void *port, 
const struct rte_even
                                               uint16_t nb_events);
 uint16_t __rte_hot cn20k_sso_hws_enq_fwd_burst(void *port, const struct 
rte_event ev[],
                                               uint16_t nb_events);
+int __rte_hot cn20k_sso_hws_profile_switch(void *port, uint8_t profile);
 
 uint16_t __rte_hot cn20k_sso_hws_deq(void *port, struct rte_event *ev, 
uint64_t timeout_ticks);
 uint16_t __rte_hot cn20k_sso_hws_deq_burst(void *port, struct rte_event ev[], 
uint16_t nb_events,
-- 
2.25.1

Reply via email to