1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015-2020
8 #include <rte_ethdev.h>
9 #include <rte_ethdev_core.h>
10 #include <rte_security.h>
12 #define IPSRXMOD_VALID 0x00000001
13 #define IPSRXMOD_PROTO 0x00000004
14 #define IPSRXMOD_DECRYPT 0x00000008
15 #define IPSRXMOD_IPV6 0x00000010
17 #define IPSEC_MAX_RX_IP_COUNT 128
18 #define IPSEC_MAX_SA_COUNT 1024
20 #define ESP_ICV_SIZE 16
21 #define ESP_TRAILER_SIZE 2
23 enum txgbe_operation {
24 TXGBE_OP_AUTHENTICATED_ENCRYPTION,
25 TXGBE_OP_AUTHENTICATED_DECRYPTION
29 * Generic IP address structure
30 * TODO: Find better location for this rte_net.h possibly.
37 /**< IP Address Type - IPv4/IPv6 */
45 /** inline crypto private session structure */
46 struct txgbe_crypto_session {
47 enum txgbe_operation op;
55 struct rte_eth_dev *dev;
56 } __rte_cache_aligned;
58 struct txgbe_crypto_rx_ip_table {
62 struct txgbe_crypto_rx_sa_table {
69 struct txgbe_crypto_tx_sa_table {
74 union txgbe_crypto_tx_desc_md {
77 /**< SA table index */
79 /**< ICV and ESP trailer length */
81 /**< enable encryption */
87 struct txgbe_crypto_rx_ip_table rx_ip_tbl[IPSEC_MAX_RX_IP_COUNT];
88 struct txgbe_crypto_rx_sa_table rx_sa_tbl[IPSEC_MAX_SA_COUNT];
89 struct txgbe_crypto_tx_sa_table tx_sa_tbl[IPSEC_MAX_SA_COUNT];
92 int txgbe_crypto_enable_ipsec(struct rte_eth_dev *dev);
93 int txgbe_crypto_add_ingress_sa_from_flow(const void *sess,
97 #endif /*TXGBE_IPSEC_H_*/