1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2014-2023 Broadcom 3 * All rights reserved. 4 */ 5 6 #ifndef _BNXT_REPS_H_ 7 #define _BNXT_REPS_H_ 8 9 #include <rte_malloc.h> 10 #include <rte_ethdev.h> 11 12 #define BNXT_MAX_CFA_CODE 65536 13 #define BNXT_VF_IDX_INVALID 0xffff 14 15 /* Switchdev Port ID Mapping (Per switch domain id). 16 * Lower 15 bits map the VFs (VF_ID). Upper bit maps the PF. 17 */ 18 #define BNXT_SWITCH_PORT_ID_PF 0x8000 19 #define BNXT_SWITCH_PORT_ID_TRUSTED_VF 0x0 20 #define BNXT_SWITCH_PORT_ID_VF_MASK 0x7FFF 21 22 uint16_t 23 bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf); 24 int bnxt_representor_init(struct rte_eth_dev *eth_dev, void *params); 25 int bnxt_representor_uninit(struct rte_eth_dev *eth_dev); 26 int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, 27 struct rte_eth_dev_info *dev_info); 28 int bnxt_rep_dev_configure_op(struct rte_eth_dev *eth_dev); 29 30 int bnxt_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl); 31 int bnxt_rep_dev_start_op(struct rte_eth_dev *eth_dev); 32 int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, 33 __rte_unused uint16_t queue_idx, 34 __rte_unused uint16_t nb_desc, 35 __rte_unused unsigned int socket_id, 36 __rte_unused const struct rte_eth_rxconf * 37 rx_conf, 38 __rte_unused struct rte_mempool *mp); 39 int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, 40 __rte_unused uint16_t queue_idx, 41 __rte_unused uint16_t nb_desc, 42 __rte_unused unsigned int socket_id, 43 __rte_unused const struct rte_eth_txconf * 44 tx_conf); 45 void bnxt_rep_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx); 46 void bnxt_rep_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx); 47 int bnxt_rep_dev_stop_op(struct rte_eth_dev *eth_dev); 48 int bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev); 49 int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, 50 struct rte_eth_stats *stats); 51 int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev); 52 int bnxt_rep_stop_all(struct bnxt *bp); 53 #endif /* _BNXT_REPS_H_ */ 54