1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(C) 2020 Marvell International Ltd. 3 */ 4 5 #ifndef _OTX2_SEC_IDEV_H_ 6 #define _OTX2_SEC_IDEV_H_ 7 8 #include <rte_ethdev.h> 9 10 #define OTX2_MAX_CPT_QP_PER_PORT 64 11 #define OTX2_MAX_INLINE_PORTS 64 12 13 struct otx2_cpt_qp; 14 15 struct otx2_sec_idev_cfg { 16 struct { 17 struct otx2_cpt_qp *qp; 18 rte_atomic16_t ref_cnt; 19 } tx_cpt[OTX2_MAX_CPT_QP_PER_PORT]; 20 21 uint16_t tx_cpt_idx; 22 rte_spinlock_t tx_cpt_lock; 23 }; 24 25 __rte_internal 26 uint8_t otx2_eth_dev_is_sec_capable(struct rte_eth_dev *eth_dev); 27 28 __rte_internal 29 int otx2_sec_idev_cfg_init(int port_id); 30 31 __rte_internal 32 int otx2_sec_idev_tx_cpt_qp_add(uint16_t port_id, struct otx2_cpt_qp *qp); 33 34 __rte_internal 35 int otx2_sec_idev_tx_cpt_qp_remove(struct otx2_cpt_qp *qp); 36 37 __rte_internal 38 int otx2_sec_idev_tx_cpt_qp_put(struct otx2_cpt_qp *qp); 39 40 __rte_internal 41 int otx2_sec_idev_tx_cpt_qp_get(uint16_t port_id, struct otx2_cpt_qp **qp); 42 43 #endif /* _OTX2_SEC_IDEV_H_ */ 44