1322bd6e7SSomnath Kotur /* SPDX-License-Identifier: BSD-3-Clause 2*e6e8f03eSRandy Schacher * Copyright(c) 2014-2023 Broadcom 3322bd6e7SSomnath Kotur * All rights reserved. 4322bd6e7SSomnath Kotur */ 5322bd6e7SSomnath Kotur 6322bd6e7SSomnath Kotur #ifndef _BNXT_REPS_H_ 7322bd6e7SSomnath Kotur #define _BNXT_REPS_H_ 8322bd6e7SSomnath Kotur 9322bd6e7SSomnath Kotur #include <rte_malloc.h> 10322bd6e7SSomnath Kotur #include <rte_ethdev.h> 11322bd6e7SSomnath Kotur 126dc83230SSomnath Kotur #define BNXT_MAX_CFA_CODE 65536 136dc83230SSomnath Kotur #define BNXT_VF_IDX_INVALID 0xffff 146dc83230SSomnath Kotur 159b842a93SSriharsha Basavapatna /* Switchdev Port ID Mapping (Per switch domain id). 169b842a93SSriharsha Basavapatna * Lower 15 bits map the VFs (VF_ID). Upper bit maps the PF. 179b842a93SSriharsha Basavapatna */ 189b842a93SSriharsha Basavapatna #define BNXT_SWITCH_PORT_ID_PF 0x8000 199b842a93SSriharsha Basavapatna #define BNXT_SWITCH_PORT_ID_TRUSTED_VF 0x0 209b842a93SSriharsha Basavapatna #define BNXT_SWITCH_PORT_ID_VF_MASK 0x7FFF 219b842a93SSriharsha Basavapatna 226dc83230SSomnath Kotur uint16_t 231e18ec58SSomnath Kotur bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf); 24ce9875d7SSomnath Kotur int bnxt_representor_init(struct rte_eth_dev *eth_dev, void *params); 25ce9875d7SSomnath Kotur int bnxt_representor_uninit(struct rte_eth_dev *eth_dev); 26ce9875d7SSomnath Kotur int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, 27322bd6e7SSomnath Kotur struct rte_eth_dev_info *dev_info); 28ce9875d7SSomnath Kotur int bnxt_rep_dev_configure_op(struct rte_eth_dev *eth_dev); 29322bd6e7SSomnath Kotur 30ce9875d7SSomnath Kotur int bnxt_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl); 31ce9875d7SSomnath Kotur int bnxt_rep_dev_start_op(struct rte_eth_dev *eth_dev); 32ce9875d7SSomnath Kotur int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, 33322bd6e7SSomnath Kotur __rte_unused uint16_t queue_idx, 34322bd6e7SSomnath Kotur __rte_unused uint16_t nb_desc, 35322bd6e7SSomnath Kotur __rte_unused unsigned int socket_id, 36322bd6e7SSomnath Kotur __rte_unused const struct rte_eth_rxconf * 37322bd6e7SSomnath Kotur rx_conf, 38322bd6e7SSomnath Kotur __rte_unused struct rte_mempool *mp); 39ce9875d7SSomnath Kotur int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, 40322bd6e7SSomnath Kotur __rte_unused uint16_t queue_idx, 41322bd6e7SSomnath Kotur __rte_unused uint16_t nb_desc, 42322bd6e7SSomnath Kotur __rte_unused unsigned int socket_id, 43322bd6e7SSomnath Kotur __rte_unused const struct rte_eth_txconf * 44322bd6e7SSomnath Kotur tx_conf); 457483341aSXueming Li void bnxt_rep_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx); 467483341aSXueming Li void bnxt_rep_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx); 4762024eb8SIvan Ilchenko int bnxt_rep_dev_stop_op(struct rte_eth_dev *eth_dev); 48b142387bSThomas Monjalon int bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev); 49ce9875d7SSomnath Kotur int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, 506dc83230SSomnath Kotur struct rte_eth_stats *stats); 51ce9875d7SSomnath Kotur int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev); 5262024eb8SIvan Ilchenko int bnxt_rep_stop_all(struct bnxt *bp); 53322bd6e7SSomnath Kotur #endif /* _BNXT_REPS_H_ */ 54