event/cnxk: add SSO GWS dequeue fast path
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Tue, 4 May 2021 00:27:07 +0000 (05:57 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 4 May 2021 04:38:56 +0000 (06:38 +0200)
Add SSO GWS event dequeue fastpath functions.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
drivers/event/cnxk/cn10k_eventdev.c
drivers/event/cnxk/cn10k_worker.c
drivers/event/cnxk/cn10k_worker.h
drivers/event/cnxk/cn9k_eventdev.c
drivers/event/cnxk/cn9k_worker.c
drivers/event/cnxk/cn9k_worker.h

index a1b4474..37a7c8a 100644 (file)
@@ -135,11 +135,19 @@ cn10k_sso_rsrc_init(void *arg, uint8_t hws, uint8_t hwgrp)
 static void
 cn10k_sso_fp_fns_set(struct rte_eventdev *event_dev)
 {
-       PLT_SET_USED(event_dev);
+       struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
+
        event_dev->enqueue = cn10k_sso_hws_enq;
        event_dev->enqueue_burst = cn10k_sso_hws_enq_burst;
        event_dev->enqueue_new_burst = cn10k_sso_hws_enq_new_burst;
        event_dev->enqueue_forward_burst = cn10k_sso_hws_enq_fwd_burst;
+
+       event_dev->dequeue = cn10k_sso_hws_deq;
+       event_dev->dequeue_burst = cn10k_sso_hws_deq_burst;
+       if (dev->is_timeout_deq) {
+               event_dev->dequeue = cn10k_sso_hws_tmo_deq;
+               event_dev->dequeue_burst = cn10k_sso_hws_tmo_deq_burst;
+       }
 }
 
 static void
index 9b5cb7b..e2aa534 100644 (file)
@@ -59,3 +59,57 @@ cn10k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[],
 
        return 1;
 }
+
+uint16_t __rte_hot
+cn10k_sso_hws_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
+{
+       struct cn10k_sso_hws *ws = port;
+
+       RTE_SET_USED(timeout_ticks);
+
+       if (ws->swtag_req) {
+               ws->swtag_req = 0;
+               cnxk_sso_hws_swtag_wait(ws->tag_wqe_op);
+               return 1;
+       }
+
+       return cn10k_sso_hws_get_work(ws, ev);
+}
+
+uint16_t __rte_hot
+cn10k_sso_hws_deq_burst(void *port, struct rte_event ev[], uint16_t nb_events,
+                       uint64_t timeout_ticks)
+{
+       RTE_SET_USED(nb_events);
+
+       return cn10k_sso_hws_deq(port, ev, timeout_ticks);
+}
+
+uint16_t __rte_hot
+cn10k_sso_hws_tmo_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
+{
+       struct cn10k_sso_hws *ws = port;
+       uint16_t ret = 1;
+       uint64_t iter;
+
+       if (ws->swtag_req) {
+               ws->swtag_req = 0;
+               cnxk_sso_hws_swtag_wait(ws->tag_wqe_op);
+               return ret;
+       }
+
+       ret = cn10k_sso_hws_get_work(ws, ev);
+       for (iter = 1; iter < timeout_ticks && (ret == 0); iter++)
+               ret = cn10k_sso_hws_get_work(ws, ev);
+
+       return ret;
+}
+
+uint16_t __rte_hot
+cn10k_sso_hws_tmo_deq_burst(void *port, struct rte_event ev[],
+                           uint16_t nb_events, uint64_t timeout_ticks)
+{
+       RTE_SET_USED(nb_events);
+
+       return cn10k_sso_hws_tmo_deq(port, ev, timeout_ticks);
+}
index 48158b3..2f093a8 100644 (file)
@@ -160,4 +160,16 @@ uint16_t __rte_hot cn10k_sso_hws_enq_fwd_burst(void *port,
                                               const struct rte_event ev[],
                                               uint16_t nb_events);
 
+uint16_t __rte_hot cn10k_sso_hws_deq(void *port, struct rte_event *ev,
+                                    uint64_t timeout_ticks);
+uint16_t __rte_hot cn10k_sso_hws_deq_burst(void *port, struct rte_event ev[],
+                                          uint16_t nb_events,
+                                          uint64_t timeout_ticks);
+uint16_t __rte_hot cn10k_sso_hws_tmo_deq(void *port, struct rte_event *ev,
+                                        uint64_t timeout_ticks);
+uint16_t __rte_hot cn10k_sso_hws_tmo_deq_burst(void *port,
+                                              struct rte_event ev[],
+                                              uint16_t nb_events,
+                                              uint64_t timeout_ticks);
+
 #endif
index 61a4d08..6ba3d14 100644 (file)
@@ -162,12 +162,27 @@ cn9k_sso_fp_fns_set(struct rte_eventdev *event_dev)
        event_dev->enqueue_new_burst = cn9k_sso_hws_enq_new_burst;
        event_dev->enqueue_forward_burst = cn9k_sso_hws_enq_fwd_burst;
 
+       event_dev->dequeue = cn9k_sso_hws_deq;
+       event_dev->dequeue_burst = cn9k_sso_hws_deq_burst;
+       if (dev->deq_tmo_ns) {
+               event_dev->dequeue = cn9k_sso_hws_tmo_deq;
+               event_dev->dequeue_burst = cn9k_sso_hws_tmo_deq_burst;
+       }
+
        if (dev->dual_ws) {
                event_dev->enqueue = cn9k_sso_hws_dual_enq;
                event_dev->enqueue_burst = cn9k_sso_hws_dual_enq_burst;
                event_dev->enqueue_new_burst = cn9k_sso_hws_dual_enq_new_burst;
                event_dev->enqueue_forward_burst =
                        cn9k_sso_hws_dual_enq_fwd_burst;
+
+               event_dev->dequeue = cn9k_sso_hws_dual_deq;
+               event_dev->dequeue_burst = cn9k_sso_hws_dual_deq_burst;
+               if (dev->deq_tmo_ns) {
+                       event_dev->dequeue = cn9k_sso_hws_dual_tmo_deq;
+                       event_dev->dequeue_burst =
+                               cn9k_sso_hws_dual_tmo_deq_burst;
+               }
        }
 }
 
index 538bc4b..9ceacc9 100644 (file)
@@ -60,6 +60,60 @@ cn9k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[],
        return 1;
 }
 
+uint16_t __rte_hot
+cn9k_sso_hws_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
+{
+       struct cn9k_sso_hws *ws = port;
+
+       RTE_SET_USED(timeout_ticks);
+
+       if (ws->swtag_req) {
+               ws->swtag_req = 0;
+               cnxk_sso_hws_swtag_wait(ws->tag_op);
+               return 1;
+       }
+
+       return cn9k_sso_hws_get_work(ws, ev);
+}
+
+uint16_t __rte_hot
+cn9k_sso_hws_deq_burst(void *port, struct rte_event ev[], uint16_t nb_events,
+                      uint64_t timeout_ticks)
+{
+       RTE_SET_USED(nb_events);
+
+       return cn9k_sso_hws_deq(port, ev, timeout_ticks);
+}
+
+uint16_t __rte_hot
+cn9k_sso_hws_tmo_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
+{
+       struct cn9k_sso_hws *ws = port;
+       uint16_t ret = 1;
+       uint64_t iter;
+
+       if (ws->swtag_req) {
+               ws->swtag_req = 0;
+               cnxk_sso_hws_swtag_wait(ws->tag_op);
+               return ret;
+       }
+
+       ret = cn9k_sso_hws_get_work(ws, ev);
+       for (iter = 1; iter < timeout_ticks && (ret == 0); iter++)
+               ret = cn9k_sso_hws_get_work(ws, ev);
+
+       return ret;
+}
+
+uint16_t __rte_hot
+cn9k_sso_hws_tmo_deq_burst(void *port, struct rte_event ev[],
+                          uint16_t nb_events, uint64_t timeout_ticks)
+{
+       RTE_SET_USED(nb_events);
+
+       return cn9k_sso_hws_tmo_deq(port, ev, timeout_ticks);
+}
+
 /* Dual ws ops. */
 
 uint16_t __rte_hot
@@ -117,3 +171,66 @@ cn9k_sso_hws_dual_enq_fwd_burst(void *port, const struct rte_event ev[],
 
        return 1;
 }
+
+uint16_t __rte_hot
+cn9k_sso_hws_dual_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
+{
+       struct cn9k_sso_hws_dual *dws = port;
+       uint16_t gw;
+
+       RTE_SET_USED(timeout_ticks);
+       if (dws->swtag_req) {
+               dws->swtag_req = 0;
+               cnxk_sso_hws_swtag_wait(dws->ws_state[!dws->vws].tag_op);
+               return 1;
+       }
+
+       gw = cn9k_sso_hws_dual_get_work(&dws->ws_state[dws->vws],
+                                       &dws->ws_state[!dws->vws], ev);
+       dws->vws = !dws->vws;
+       return gw;
+}
+
+uint16_t __rte_hot
+cn9k_sso_hws_dual_deq_burst(void *port, struct rte_event ev[],
+                           uint16_t nb_events, uint64_t timeout_ticks)
+{
+       RTE_SET_USED(nb_events);
+
+       return cn9k_sso_hws_dual_deq(port, ev, timeout_ticks);
+}
+
+uint16_t __rte_hot
+cn9k_sso_hws_dual_tmo_deq(void *port, struct rte_event *ev,
+                         uint64_t timeout_ticks)
+{
+       struct cn9k_sso_hws_dual *dws = port;
+       uint16_t ret = 1;
+       uint64_t iter;
+
+       if (dws->swtag_req) {
+               dws->swtag_req = 0;
+               cnxk_sso_hws_swtag_wait(dws->ws_state[!dws->vws].tag_op);
+               return ret;
+       }
+
+       ret = cn9k_sso_hws_dual_get_work(&dws->ws_state[dws->vws],
+                                        &dws->ws_state[!dws->vws], ev);
+       dws->vws = !dws->vws;
+       for (iter = 1; iter < timeout_ticks && (ret == 0); iter++) {
+               ret = cn9k_sso_hws_dual_get_work(&dws->ws_state[dws->vws],
+                                                &dws->ws_state[!dws->vws], ev);
+               dws->vws = !dws->vws;
+       }
+
+       return ret;
+}
+
+uint16_t __rte_hot
+cn9k_sso_hws_dual_tmo_deq_burst(void *port, struct rte_event ev[],
+                               uint16_t nb_events, uint64_t timeout_ticks)
+{
+       RTE_SET_USED(nb_events);
+
+       return cn9k_sso_hws_dual_tmo_deq(port, ev, timeout_ticks);
+}
index aa321d0..38fca08 100644 (file)
@@ -270,4 +270,28 @@ uint16_t __rte_hot cn9k_sso_hws_dual_enq_fwd_burst(void *port,
                                                   const struct rte_event ev[],
                                                   uint16_t nb_events);
 
+uint16_t __rte_hot cn9k_sso_hws_deq(void *port, struct rte_event *ev,
+                                   uint64_t timeout_ticks);
+uint16_t __rte_hot cn9k_sso_hws_deq_burst(void *port, struct rte_event ev[],
+                                         uint16_t nb_events,
+                                         uint64_t timeout_ticks);
+uint16_t __rte_hot cn9k_sso_hws_tmo_deq(void *port, struct rte_event *ev,
+                                       uint64_t timeout_ticks);
+uint16_t __rte_hot cn9k_sso_hws_tmo_deq_burst(void *port, struct rte_event ev[],
+                                             uint16_t nb_events,
+                                             uint64_t timeout_ticks);
+
+uint16_t __rte_hot cn9k_sso_hws_dual_deq(void *port, struct rte_event *ev,
+                                        uint64_t timeout_ticks);
+uint16_t __rte_hot cn9k_sso_hws_dual_deq_burst(void *port,
+                                              struct rte_event ev[],
+                                              uint16_t nb_events,
+                                              uint64_t timeout_ticks);
+uint16_t __rte_hot cn9k_sso_hws_dual_tmo_deq(void *port, struct rte_event *ev,
+                                            uint64_t timeout_ticks);
+uint16_t __rte_hot cn9k_sso_hws_dual_tmo_deq_burst(void *port,
+                                                  struct rte_event ev[],
+                                                  uint16_t nb_events,
+                                                  uint64_t timeout_ticks);
+
 #endif