net/cnxk: support inline security setup for cn10k
[dpdk.git] / drivers / event / cnxk / cn10k_worker_deq_ca.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #include "cn10k_worker.h"
6 #include "cnxk_eventdev.h"
7 #include "cnxk_worker.h"
8
9 #define R(name, f5, f4, f3, f2, f1, f0, flags)                                 \
10         uint16_t __rte_hot cn10k_sso_hws_deq_ca_##name(                        \
11                 void *port, struct rte_event *ev, uint64_t timeout_ticks)      \
12         {                                                                      \
13                 struct cn10k_sso_hws *ws = port;                               \
14                                                                                \
15                 RTE_SET_USED(timeout_ticks);                                   \
16                                                                                \
17                 if (ws->swtag_req) {                                           \
18                         ws->swtag_req = 0;                                     \
19                         cnxk_sso_hws_swtag_wait(ws->base + SSOW_LF_GWS_WQE0);  \
20                         return 1;                                              \
21                 }                                                              \
22                                                                                \
23                 return cn10k_sso_hws_get_work(ws, ev, flags | CPT_RX_WQE_F,    \
24                                               ws->lookup_mem);                 \
25         }                                                                      \
26                                                                                \
27         uint16_t __rte_hot cn10k_sso_hws_deq_ca_burst_##name(                  \
28                 void *port, struct rte_event ev[], uint16_t nb_events,         \
29                 uint64_t timeout_ticks)                                        \
30         {                                                                      \
31                 RTE_SET_USED(nb_events);                                       \
32                                                                                \
33                 return cn10k_sso_hws_deq_ca_##name(port, ev, timeout_ticks);   \
34         }                                                                      \
35                                                                                \
36         uint16_t __rte_hot cn10k_sso_hws_deq_ca_seg_##name(                    \
37                 void *port, struct rte_event *ev, uint64_t timeout_ticks)      \
38         {                                                                      \
39                 struct cn10k_sso_hws *ws = port;                               \
40                                                                                \
41                 RTE_SET_USED(timeout_ticks);                                   \
42                                                                                \
43                 if (ws->swtag_req) {                                           \
44                         ws->swtag_req = 0;                                     \
45                         cnxk_sso_hws_swtag_wait(ws->base + SSOW_LF_GWS_WQE0);  \
46                         return 1;                                              \
47                 }                                                              \
48                                                                                \
49                 return cn10k_sso_hws_get_work(                                 \
50                         ws, ev, flags | NIX_RX_MULTI_SEG_F | CPT_RX_WQE_F,     \
51                         ws->lookup_mem);                                       \
52         }                                                                      \
53                                                                                \
54         uint16_t __rte_hot cn10k_sso_hws_deq_ca_seg_burst_##name(              \
55                 void *port, struct rte_event ev[], uint16_t nb_events,         \
56                 uint64_t timeout_ticks)                                        \
57         {                                                                      \
58                 RTE_SET_USED(nb_events);                                       \
59                                                                                \
60                 return cn10k_sso_hws_deq_ca_seg_##name(port, ev,               \
61                                                        timeout_ticks);         \
62         }
63
64 NIX_RX_FASTPATH_MODES
65 #undef R