DPDK 25.03.0-rc0
rte_security_driver.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2017 NXP.
3 * Copyright(c) 2017 Intel Corporation.
4 */
5
6#ifndef _RTE_SECURITY_DRIVER_H_
7#define _RTE_SECURITY_DRIVER_H_
8
15#include <rte_compat.h>
16#include "rte_security.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
26struct rte_security_session {
27 uint64_t opaque_data;
29 uint64_t fast_mdata;
31 rte_iova_t driver_priv_data_iova;
35 uint8_t driver_priv_data[];
37};
38
49 void *device;
51 const struct rte_security_ops *ops;
53 uint32_t flags;
55 uint16_t sess_cnt;
57 uint16_t macsec_sc_cnt;
59 uint16_t macsec_sa_cnt;
61};
62
66#define SECURITY_GET_SESS_PRIV(s) \
67 ((void *)(((struct rte_security_session *)s)->driver_priv_data))
68#define SECURITY_GET_SESS_PRIV_IOVA(s) \
69 (((struct rte_security_session *)s)->driver_priv_data_iova)
70
83typedef int (*security_session_create_t)(void *device,
84 struct rte_security_session_conf *conf,
85 struct rte_security_session *sess);
86
93typedef int (*security_session_destroy_t)(void *device,
94 struct rte_security_session *sess);
95
108typedef int (*security_session_update_t)(void *device,
109 struct rte_security_session *sess,
110 struct rte_security_session_conf *conf);
111
124typedef int (*security_macsec_sc_create_t)(void *device, struct rte_security_macsec_sc *conf);
125
133typedef int (*security_macsec_sc_destroy_t)(void *device, uint16_t sc_id,
135
148typedef int (*security_macsec_sa_create_t)(void *device, struct rte_security_macsec_sa *conf);
149
157typedef int (*security_macsec_sa_destroy_t)(void *device, uint16_t sa_id,
159
169typedef unsigned int (*security_session_get_size)(void *device);
170
182typedef int (*security_session_stats_get_t)(void *device,
183 struct rte_security_session *sess,
184 struct rte_security_stats *stats);
185
198typedef int (*security_macsec_sc_stats_get_t)(void *device, uint16_t sc_id,
200 struct rte_security_macsec_sc_stats *stats);
201
214typedef int (*security_macsec_sa_stats_get_t)(void *device, uint16_t sa_id,
216 struct rte_security_macsec_sa_stats *stats);
217
218
219
220__rte_internal
221int rte_security_dynfield_register(void);
222
228__rte_internal
229int rte_security_oop_dynfield_register(void);
230
243typedef int (*security_set_pkt_metadata_t)(void *device,
244 struct rte_security_session *sess, struct rte_mbuf *mb,
245 void *params);
246
256typedef const struct rte_security_capability *(*security_capabilities_get_t)(
257 void *device);
258
273typedef int (*security_rx_inject_configure)(void *device, uint16_t port_id, bool enable);
274
295typedef uint16_t (*security_inb_pkt_rx_inject)(void *device,
296 struct rte_mbuf **pkts, struct rte_security_session **sess,
297 uint16_t nb_pkts);
298
331};
332
333#ifdef __cplusplus
334}
335#endif
336
337#endif /* _RTE_SECURITY_DRIVER_H_ */
#define RTE_CACHE_LINE_MIN_SIZE
Definition: rte_common.h:624
uint64_t rte_iova_t
Definition: rte_common.h:658
rte_security_macsec_direction
Definition: rte_security.h:337
int(* security_macsec_sc_destroy_t)(void *device, uint16_t sc_id, enum rte_security_macsec_direction dir)
int(* security_session_update_t)(void *device, struct rte_security_session *sess, struct rte_security_session_conf *conf)
int(* security_session_stats_get_t)(void *device, struct rte_security_session *sess, struct rte_security_stats *stats)
int(* security_macsec_sa_stats_get_t)(void *device, uint16_t sa_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sa_stats *stats)
int(* security_macsec_sc_stats_get_t)(void *device, uint16_t sc_id, enum rte_security_macsec_direction dir, struct rte_security_macsec_sc_stats *stats)
int(* security_rx_inject_configure)(void *device, uint16_t port_id, bool enable)
unsigned int(* security_session_get_size)(void *device)
int(* security_macsec_sa_create_t)(void *device, struct rte_security_macsec_sa *conf)
const struct rte_security_capability *(* security_capabilities_get_t)(void *device)
int(* security_session_create_t)(void *device, struct rte_security_session_conf *conf, struct rte_security_session *sess)
uint16_t(* security_inb_pkt_rx_inject)(void *device, struct rte_mbuf **pkts, struct rte_security_session **sess, uint16_t nb_pkts)
int(* security_set_pkt_metadata_t)(void *device, struct rte_security_session *sess, struct rte_mbuf *mb, void *params)
int(* security_macsec_sa_destroy_t)(void *device, uint16_t sa_id, enum rte_security_macsec_direction dir)
int(* security_session_destroy_t)(void *device, struct rte_security_session *sess)
int(* security_macsec_sc_create_t)(void *device, struct rte_security_macsec_sc *conf)
const struct rte_security_ops * ops
enum rte_security_macsec_direction dir
Definition: rte_security.h:354
enum rte_security_macsec_direction dir
Definition: rte_security.h:377
security_session_destroy_t session_destroy
security_macsec_sc_stats_get_t macsec_sc_stats_get
security_macsec_sc_destroy_t macsec_sc_destroy
security_macsec_sa_stats_get_t macsec_sa_stats_get
security_macsec_sc_create_t macsec_sc_create
security_macsec_sa_create_t macsec_sa_create
security_inb_pkt_rx_inject inb_pkt_rx_inject
security_session_update_t session_update
security_session_create_t session_create
security_set_pkt_metadata_t set_pkt_metadata
security_session_get_size session_get_size
security_session_stats_get_t session_stats_get
security_macsec_sa_destroy_t macsec_sa_destroy
security_rx_inject_configure rx_inject_configure
security_capabilities_get_t capabilities_get