1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
7 #include "cn9k_worker.h"
8 #include "cn9k_cryptodev_ops.h"
11 cn9k_sso_hws_enq(void *port, const struct rte_event *ev)
13 struct cn9k_sso_hws *ws = port;
16 case RTE_EVENT_OP_NEW:
17 return cn9k_sso_hws_new_event(ws, ev);
18 case RTE_EVENT_OP_FORWARD:
19 cn9k_sso_hws_forward_event(ws, ev);
21 case RTE_EVENT_OP_RELEASE:
22 cnxk_sso_hws_swtag_flush(ws->base + SSOW_LF_GWS_TAG,
23 ws->base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
33 cn9k_sso_hws_enq_burst(void *port, const struct rte_event ev[],
36 RTE_SET_USED(nb_events);
37 return cn9k_sso_hws_enq(port, ev);
41 cn9k_sso_hws_enq_new_burst(void *port, const struct rte_event ev[],
44 struct cn9k_sso_hws *ws = port;
47 for (i = 0; i < nb_events && rc; i++)
48 rc = cn9k_sso_hws_new_event(ws, &ev[i]);
54 cn9k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[],
57 struct cn9k_sso_hws *ws = port;
59 RTE_SET_USED(nb_events);
60 cn9k_sso_hws_forward_event(ws, ev);
68 cn9k_sso_hws_dual_enq(void *port, const struct rte_event *ev)
70 struct cn9k_sso_hws_dual *dws = port;
73 base = dws->base[!dws->vws];
75 case RTE_EVENT_OP_NEW:
76 return cn9k_sso_hws_dual_new_event(dws, ev);
77 case RTE_EVENT_OP_FORWARD:
78 cn9k_sso_hws_dual_forward_event(dws, base, ev);
80 case RTE_EVENT_OP_RELEASE:
81 cnxk_sso_hws_swtag_flush(base + SSOW_LF_GWS_TAG,
82 base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
92 cn9k_sso_hws_dual_enq_burst(void *port, const struct rte_event ev[],
95 RTE_SET_USED(nb_events);
96 return cn9k_sso_hws_dual_enq(port, ev);
100 cn9k_sso_hws_dual_enq_new_burst(void *port, const struct rte_event ev[],
103 struct cn9k_sso_hws_dual *dws = port;
106 for (i = 0; i < nb_events && rc; i++)
107 rc = cn9k_sso_hws_dual_new_event(dws, &ev[i]);
113 cn9k_sso_hws_dual_enq_fwd_burst(void *port, const struct rte_event ev[],
116 struct cn9k_sso_hws_dual *dws = port;
118 RTE_SET_USED(nb_events);
119 cn9k_sso_hws_dual_forward_event(dws, dws->base[!dws->vws], ev);
125 cn9k_sso_hws_ca_enq(void *port, struct rte_event ev[], uint16_t nb_events)
127 struct cn9k_sso_hws *ws = port;
129 RTE_SET_USED(nb_events);
131 return cn9k_cpt_crypto_adapter_enqueue(ws->base + SSOW_LF_GWS_TAG,
136 cn9k_sso_hws_dual_ca_enq(void *port, struct rte_event ev[], uint16_t nb_events)
138 struct cn9k_sso_hws_dual *dws = port;
140 RTE_SET_USED(nb_events);
142 return cn9k_cpt_crypto_adapter_enqueue(
143 dws->base[!dws->vws] + SSOW_LF_GWS_TAG, ev->event_ptr);