net/cnxk: support inline security setup for cn10k
[dpdk.git] / drivers / event / cnxk / cn10k_worker_deq.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_##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, ws->lookup_mem);  \
24         }                                                                      \
25                                                                                \
26         uint16_t __rte_hot cn10k_sso_hws_deq_seg_##name(                       \
27                 void *port, struct rte_event *ev, uint64_t timeout_ticks)      \
28         {                                                                      \
29                 struct cn10k_sso_hws *ws = port;                               \
30                                                                                \
31                 RTE_SET_USED(timeout_ticks);                                   \
32                                                                                \
33                 if (ws->swtag_req) {                                           \
34                         ws->swtag_req = 0;                                     \
35                         cnxk_sso_hws_swtag_wait(ws->base + SSOW_LF_GWS_WQE0);  \
36                         return 1;                                              \
37                 }                                                              \
38                                                                                \
39                 return cn10k_sso_hws_get_work(                                 \
40                         ws, ev, flags | NIX_RX_MULTI_SEG_F, ws->lookup_mem);   \
41         }
42
43 NIX_RX_FASTPATH_MODES
44 #undef R