event/cnxk: add event queue config
authorShijith Thotton <sthotton@marvell.com>
Tue, 4 May 2021 00:26:58 +0000 (05:56 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 4 May 2021 03:35:21 +0000 (05:35 +0200)
Add setup and release functions for event queues i.e.
SSO HWGRPs.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
drivers/event/cnxk/cn10k_eventdev.c
drivers/event/cnxk/cn9k_eventdev.c
drivers/event/cnxk/cnxk_eventdev.c
drivers/event/cnxk/cnxk_eventdev.h

index 779a2e0..557f26b 100644 (file)
@@ -62,6 +62,8 @@ static struct rte_eventdev_ops cn10k_sso_dev_ops = {
        .dev_infos_get = cn10k_sso_info_get,
        .dev_configure = cn10k_sso_dev_configure,
        .queue_def_conf = cnxk_sso_queue_def_conf,
+       .queue_setup = cnxk_sso_queue_setup,
+       .queue_release = cnxk_sso_queue_release,
        .port_def_conf = cnxk_sso_port_def_conf,
 };
 
index d042f58..eba1bfb 100644 (file)
@@ -70,6 +70,8 @@ static struct rte_eventdev_ops cn9k_sso_dev_ops = {
        .dev_infos_get = cn9k_sso_info_get,
        .dev_configure = cn9k_sso_dev_configure,
        .queue_def_conf = cnxk_sso_queue_def_conf,
+       .queue_setup = cnxk_sso_queue_setup,
+       .queue_release = cnxk_sso_queue_release,
        .port_def_conf = cnxk_sso_port_def_conf,
 };
 
index 3eab1ed..e22479a 100644 (file)
@@ -86,6 +86,25 @@ cnxk_sso_queue_def_conf(struct rte_eventdev *event_dev, uint8_t queue_id,
        queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
 }
 
+int
+cnxk_sso_queue_setup(struct rte_eventdev *event_dev, uint8_t queue_id,
+                    const struct rte_event_queue_conf *queue_conf)
+{
+       struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
+
+       plt_sso_dbg("Queue=%d prio=%d", queue_id, queue_conf->priority);
+       /* Normalize <0-255> to <0-7> */
+       return roc_sso_hwgrp_set_priority(&dev->sso, queue_id, 0xFF, 0xFF,
+                                         queue_conf->priority / 32);
+}
+
+void
+cnxk_sso_queue_release(struct rte_eventdev *event_dev, uint8_t queue_id)
+{
+       RTE_SET_USED(event_dev);
+       RTE_SET_USED(queue_id);
+}
+
 void
 cnxk_sso_port_def_conf(struct rte_eventdev *event_dev, uint8_t port_id,
                       struct rte_event_port_conf *port_conf)
index 59d96a0..426219c 100644 (file)
@@ -45,6 +45,9 @@ void cnxk_sso_info_get(struct cnxk_sso_evdev *dev,
 int cnxk_sso_dev_validate(const struct rte_eventdev *event_dev);
 void cnxk_sso_queue_def_conf(struct rte_eventdev *event_dev, uint8_t queue_id,
                             struct rte_event_queue_conf *queue_conf);
+int cnxk_sso_queue_setup(struct rte_eventdev *event_dev, uint8_t queue_id,
+                        const struct rte_event_queue_conf *queue_conf);
+void cnxk_sso_queue_release(struct rte_eventdev *event_dev, uint8_t queue_id);
 void cnxk_sso_port_def_conf(struct rte_eventdev *event_dev, uint8_t port_id,
                            struct rte_event_port_conf *port_conf);