1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2020 Intel Corporation 3 */ 4 5 #ifndef _ICE_DCF_ETHDEV_H_ 6 #define _ICE_DCF_ETHDEV_H_ 7 8 #include "base/ice_common.h" 9 #include "base/ice_adminq_cmd.h" 10 11 #include "ice_ethdev.h" 12 #include "ice_dcf.h" 13 14 #define ICE_DCF_MAX_RINGS 1 15 16 struct ice_dcf_queue { 17 uint64_t dummy; 18 }; 19 20 struct ice_dcf_repr_info { 21 struct rte_eth_dev *vf_rep_eth_dev; 22 }; 23 24 struct ice_dcf_adapter { 25 struct ice_adapter parent; /* Must be first */ 26 struct ice_dcf_hw real_hw; 27 28 int num_reprs; 29 struct ice_dcf_repr_info *repr_infos; 30 }; 31 32 struct ice_dcf_vf_repr_param { 33 struct rte_eth_dev *dcf_eth_dev; 34 uint16_t switch_domain_id; 35 uint16_t vf_id; 36 }; 37 38 struct ice_dcf_vlan { 39 bool port_vlan_ena; 40 bool stripping_ena; 41 42 uint16_t tpid; 43 uint16_t vid; 44 }; 45 46 struct ice_dcf_vf_repr { 47 struct rte_eth_dev *dcf_eth_dev; 48 struct rte_ether_addr mac_addr; 49 uint16_t switch_domain_id; 50 uint16_t vf_id; 51 52 struct ice_dcf_vlan outer_vlan_info; /* DCF always handle outer VLAN */ 53 }; 54 55 void ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw, 56 uint8_t *msg, uint16_t msglen); 57 int ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev); 58 void ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev); 59 60 int ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param); 61 int ice_dcf_vf_repr_uninit(struct rte_eth_dev *vf_rep_eth_dev); 62 int ice_dcf_vf_repr_init_vlan(struct rte_eth_dev *vf_rep_eth_dev); 63 void ice_dcf_vf_repr_stop_all(struct ice_dcf_adapter *dcf_adapter); 64 65 #endif /* _ICE_DCF_ETHDEV_H_ */ 66