DPDK  24.03.0
rte_pdcp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2023 Marvell.
3  */
4 
5 #ifndef RTE_PDCP_H
6 #define RTE_PDCP_H
7 
16 #include <rte_compat.h>
17 #include <rte_common.h>
18 #include <rte_mempool.h>
19 #include <rte_pdcp_hdr.h>
20 #include <rte_security.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /* Forward declarations. */
27 struct rte_pdcp_entity;
28 
29 /* PDCP pre-process function based on entity configuration. */
30 typedef uint16_t (*rte_pdcp_pre_p_t)(const struct rte_pdcp_entity *entity,
31  struct rte_mbuf *mb[],
32  struct rte_crypto_op *cop[],
33  uint16_t num, uint16_t *nb_err);
34 
35 /* PDCP post-process function based on entity configuration. */
36 typedef uint16_t (*rte_pdcp_post_p_t)(const struct rte_pdcp_entity *entity,
37  struct rte_mbuf *in_mb[],
38  struct rte_mbuf *out_mb[],
39  uint16_t num, uint16_t *nb_err);
40 
54  rte_pdcp_pre_p_t pre_process;
56  rte_pdcp_post_p_t post_process;
68  uint32_t max_pkt_cache;
69 };
70 
84 typedef void (*rte_pdcp_t_reordering_start_cb_t)(void *timer, void *args);
85 
98 typedef void (*rte_pdcp_t_reordering_stop_cb_t)(void *timer, void *args);
99 
105 /* Structure rte_pdcp_t_reordering 8< */
108  void *timer;
110  void *args;
115 };
116 /* >8 End of structure rte_pdcp_t_reordering. */
117 
121 /* Structure rte_pdcp_entity_conf 8< */
124  struct rte_security_pdcp_xform pdcp_xfrm;
138  uint32_t sn;
140  bool is_slrb;
144  uint8_t dev_id;
163  struct rte_pdcp_t_reordering t_reordering;
164 };
165 /* >8 End of structure rte_pdcp_entity_conf. */
166 
181 __rte_experimental
182 struct rte_pdcp_entity *
184 
211 __rte_experimental
212 int
213 rte_pdcp_entity_release(struct rte_pdcp_entity *pdcp_entity,
214  struct rte_mbuf *out_mb[]);
215 
240 __rte_experimental
241 int
242 rte_pdcp_entity_suspend(struct rte_pdcp_entity *pdcp_entity,
243  struct rte_mbuf *out_mb[]);
244 
260 __rte_experimental
261 struct rte_mbuf *
262 rte_pdcp_control_pdu_create(struct rte_pdcp_entity *pdcp_entity,
263  enum rte_pdcp_ctrl_pdu_type type);
264 
291 __rte_experimental
292 static inline uint16_t
294  struct rte_mbuf *mb[], struct rte_crypto_op *cop[],
295  uint16_t num, uint16_t *nb_err)
296 {
297  return entity->pre_process(entity, mb, cop, num, nb_err);
298 }
299 
332 __rte_experimental
333 static inline uint16_t
335  struct rte_mbuf *in_mb[],
336  struct rte_mbuf *out_mb[],
337  uint16_t num, uint16_t *nb_err)
338 {
339  return entity->post_process(entity, in_mb, out_mb, num, nb_err);
340 }
341 
365 __rte_experimental
366 uint16_t
368  struct rte_mbuf *out_mb[]);
369 
374 #include <rte_pdcp_group.h>
375 
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif /* RTE_PDCP_H */
rte_pdcp_t_reordering_start_cb_t start
Definition: rte_pdcp.h:112
void(* rte_pdcp_t_reordering_stop_cb_t)(void *timer, void *args)
Definition: rte_pdcp.h:98
rte_pdcp_post_p_t post_process
Definition: rte_pdcp.h:56
uint32_t max_pkt_cache
Definition: rte_pdcp.h:68
static __rte_experimental uint16_t rte_pdcp_pkt_post_process(const struct rte_pdcp_entity *entity, struct rte_mbuf *in_mb[], struct rte_mbuf *out_mb[], uint16_t num, uint16_t *nb_err)
Definition: rte_pdcp.h:334
struct rte_crypto_sym_xform * crypto_xfrm
Definition: rte_pdcp.h:126
#define __rte_cache_aligned
Definition: rte_common.h:553
__rte_experimental struct rte_pdcp_entity * rte_pdcp_entity_establish(const struct rte_pdcp_entity_conf *conf)
rte_pdcp_ctrl_pdu_type
Definition: rte_pdcp_hdr.h:41
struct rte_mempool * sess_mpool
Definition: rte_pdcp.h:128
__rte_experimental uint16_t rte_pdcp_t_reordering_expiry_handle(const struct rte_pdcp_entity *entity, struct rte_mbuf *out_mb[])
void(* rte_pdcp_t_reordering_start_cb_t)(void *timer, void *args)
Definition: rte_pdcp.h:84
bool out_of_order_delivery
Definition: rte_pdcp.h:161
__rte_experimental int rte_pdcp_entity_suspend(struct rte_pdcp_entity *pdcp_entity, struct rte_mbuf *out_mb[])
struct rte_mempool * ctrl_pdu_pool
Definition: rte_pdcp.h:132
__rte_experimental int rte_pdcp_entity_release(struct rte_pdcp_entity *pdcp_entity, struct rte_mbuf *out_mb[])
rte_pdcp_pre_p_t pre_process
Definition: rte_pdcp.h:54
static __rte_experimental uint16_t rte_pdcp_pkt_pre_process(const struct rte_pdcp_entity *entity, struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num, uint16_t *nb_err)
Definition: rte_pdcp.h:293
bool status_report_required
Definition: rte_pdcp.h:159
struct rte_mempool * cop_pool
Definition: rte_pdcp.h:130
rte_pdcp_t_reordering_stop_cb_t stop
Definition: rte_pdcp.h:114
__rte_experimental struct rte_mbuf * rte_pdcp_control_pdu_create(struct rte_pdcp_entity *pdcp_entity, enum rte_pdcp_ctrl_pdu_type type)