X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fprox_compat.h;h=001caa6d4b943bc2c76f48ace6059d486b03142d;hb=1eb070d16476285b3dff087cff03cf352a0aadbc;hp=1ebacd4ac4c3f03b6ca223887892a7ae76d9b551;hpb=ae43633b258e3cf53013cfac4643146761f03b9d;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/prox_compat.h b/VNFs/DPPD-PROX/prox_compat.h index 1ebacd4a..001caa6d 100644 --- a/VNFs/DPPD-PROX/prox_compat.h +++ b/VNFs/DPPD-PROX/prox_compat.h @@ -19,6 +19,7 @@ #include #include #include +#include #include "hash_utils.h" #include "quit.h" @@ -130,6 +131,12 @@ static void *prox_rte_table_create(struct prox_rte_table_params *params, int soc #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800 #endif +#ifndef DEV_RX_OFFLOAD_KEEP_CRC +#ifndef DEV_RX_OFFLOAD_CRC_STRIP +#define DEV_RX_OFFLOAD_CRC_STRIP 0x00001000 +#endif +#endif + #if RTE_VERSION < RTE_VERSION_NUM(19,2,0,0) #define RTE_COLOR_GREEN e_RTE_METER_GREEN #define RTE_COLOR_YELLOW e_RTE_METER_YELLOW @@ -153,4 +160,35 @@ static inline char *prox_strncpy(char * dest, const char * src, size_t count) PROX_PANIC(dest[count - 1] != 0, "\t\tError in strncpy: buffer overrun (%lu bytes)", count); return dest; } +#ifdef RTE_LIBRTE_PMD_AESNI_MB +#if RTE_VERSION < RTE_VERSION_NUM(19,5,0,0) +//RFC4303 +struct prox_esp_hdr { + uint32_t spi; + uint32_t seq; +}; +struct prox_rte_cryptodev_qp_conf { + uint32_t nb_descriptors; /**< Number of descriptors per queue pair */ + struct rte_mempool * mp_session; + struct rte_mempool * mp_session_private; +}; + +static int prox_rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, struct prox_rte_cryptodev_qp_conf *qp_conf, int socket_id) +{ + struct rte_mempool *session_pool = qp_conf->mp_session; + return rte_cryptodev_queue_pair_setup(dev_id, queue_pair_id, (struct rte_cryptodev_qp_conf *)qp_conf, socket_id, session_pool); +} + +#else +#define prox_esp_hdr esp_hdr +#define prox_rte_cryptodev_qp_conf rte_cryptodev_qp_conf + +static int prox_rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, struct prox_rte_cryptodev_qp_conf *qp_conf, int socket_id) +{ + return rte_cryptodev_queue_pair_setup(dev_id, queue_pair_id, (struct rte_cryptodev_qp_conf *)qp_conf, socket_id); +} + +#endif +#endif // CONFIG_RTE_LIBRTE_PMD_AESNI_MB + #endif // _PROX_COMPAT_H