DPDK
25.11.0
Toggle main menu visibility
Loading...
Searching...
No Matches
rte_pdcp_group.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_GROUP_H
6
#define RTE_PDCP_GROUP_H
7
17
18
#include <
rte_common.h
>
19
#include <
rte_crypto.h
>
20
#include <
rte_cryptodev.h
>
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
29
struct
rte_pdcp_group
{
30
union
{
31
uint64_t val;
32
void
*ptr;
33
}
id
;
34
struct
rte_mbuf
**
m
;
35
uint32_t
cnt
;
36
int32_t
rc
;
37
};
38
49
static
inline
struct
rte_pdcp_entity
*
50
rte_pdcp_en_from_cop
(
const
struct
rte_crypto_op
*cop)
51
{
52
void
*sess = cop->
sym
[0].
session
;
53
54
return
(
struct
rte_pdcp_entity
*)(uintptr_t)
55
rte_cryptodev_sym_session_opaque_data_get
(sess);
56
}
57
82
static
inline
uint16_t
83
rte_pdcp_pkt_crypto_group
(
struct
rte_crypto_op
*cop[],
struct
rte_mbuf
*mb[],
84
struct
rte_pdcp_group
grp[], uint16_t num)
85
{
86
uint32_t i, j = 0, n = 0;
87
void
*ns, *ps = NULL;
88
struct
rte_mbuf
*m;
89
90
for
(i = 0; i != num; i++) {
91
m = cop[i]->
sym
[0].
m_src
;
92
ns = cop[i]->
sym
[0].
session
;
93
94
m->
ol_flags
|=
RTE_MBUF_F_RX_SEC_OFFLOAD
;
95
if
(cop[i]->status !=
RTE_CRYPTO_OP_STATUS_SUCCESS
)
96
m->
ol_flags
|=
RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED
;
97
98
/* Different entity */
99
if
(ps != ns) {
100
101
/* Finalize open group and start a new one */
102
if
(ps != NULL) {
103
grp[n].
cnt
= mb + j - grp[n].
m
;
104
n++;
105
}
106
107
/* Start new group */
108
grp[n].
m
= mb + j;
109
ps = ns;
110
grp[n].
id
.ptr =
rte_pdcp_en_from_cop
(cop[i]);
111
}
112
113
mb[j++] = m;
114
rte_crypto_op_free
(cop[i]);
115
}
116
117
/* Finalize last group */
118
if
(ps != NULL) {
119
grp[n].
cnt
= mb + j - grp[n].
m
;
120
n++;
121
}
122
123
return
n;
124
}
125
126
#ifdef __cplusplus
127
}
128
#endif
129
130
#endif
/* RTE_PDCP_GROUP_H */
rte_common.h
rte_crypto.h
rte_crypto_op_free
static void rte_crypto_op_free(struct rte_crypto_op *op)
Definition
rte_crypto.h:398
RTE_CRYPTO_OP_STATUS_SUCCESS
@ RTE_CRYPTO_OP_STATUS_SUCCESS
Definition
rte_crypto.h:39
rte_cryptodev.h
rte_cryptodev_sym_session_opaque_data_get
static uint64_t rte_cryptodev_sym_session_opaque_data_get(void *sess)
Definition
rte_cryptodev.h:1310
RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED
#define RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED
Definition
rte_mbuf_core.h:149
RTE_MBUF_F_RX_SEC_OFFLOAD
#define RTE_MBUF_F_RX_SEC_OFFLOAD
Definition
rte_mbuf_core.h:144
rte_pdcp_pkt_crypto_group
static uint16_t rte_pdcp_pkt_crypto_group(struct rte_crypto_op *cop[], struct rte_mbuf *mb[], struct rte_pdcp_group grp[], uint16_t num)
Definition
rte_pdcp_group.h:83
rte_pdcp_en_from_cop
static struct rte_pdcp_entity * rte_pdcp_en_from_cop(const struct rte_crypto_op *cop)
Definition
rte_pdcp_group.h:50
rte_crypto_op
Definition
rte_crypto.h:91
rte_crypto_op::sym
struct rte_crypto_sym_op sym[0]
Definition
rte_crypto.h:178
rte_crypto_sym_op::session
void * session
Definition
rte_crypto_sym.h:633
rte_crypto_sym_op::m_src
struct rte_mbuf * m_src
Definition
rte_crypto_sym.h:629
rte_mbuf
Definition
rte_mbuf_core.h:475
rte_mbuf::ol_flags
uint64_t ol_flags
Definition
rte_mbuf_core.h:529
rte_pdcp_entity
Definition
rte_pdcp.h:48
rte_pdcp_group
Definition
rte_pdcp_group.h:29
rte_pdcp_group::m
struct rte_mbuf ** m
Definition
rte_pdcp_group.h:34
rte_pdcp_group::cnt
uint32_t cnt
Definition
rte_pdcp_group.h:35
rte_pdcp_group::rc
int32_t rc
Definition
rte_pdcp_group.h:36
rte_pdcp_group::id
union rte_pdcp_group::@310107346043261340205124145123204227134071331315 id
lib
pdcp
rte_pdcp_group.h
Generated by
1.17.0