1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
5 #ifndef _ICE_DCF_ETHDEV_H_
6 #define _ICE_DCF_ETHDEV_H_
8 #include "base/ice_common.h"
9 #include "base/ice_adminq_cmd.h"
10 #include "base/ice_dcb.h"
11 #include "base/ice_sched.h"
13 #include "ice_ethdev.h"
16 #define ICE_DCF_MAX_RINGS 1
17 #define DCF_NUM_MACADDR_MAX 64
18 #define ICE_DCF_FRAME_SIZE_MAX 9728
19 #define ICE_DCF_VLAN_TAG_SIZE 4
20 #define ICE_DCF_ETH_OVERHEAD \
21 (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)
22 #define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD)
24 struct ice_dcf_queue {
28 struct ice_dcf_repr_info {
29 struct rte_eth_dev *vf_rep_eth_dev;
32 struct ice_dcf_adapter {
33 struct ice_adapter parent; /* Must be first */
34 struct ice_dcf_hw real_hw;
36 bool promisc_unicast_enabled;
37 bool promisc_multicast_enabled;
38 uint32_t mc_addrs_num;
39 struct rte_ether_addr mc_addrs[DCF_NUM_MACADDR_MAX];
41 struct ice_dcf_repr_info *repr_infos;
44 struct ice_dcf_vf_repr_param {
45 struct rte_eth_dev *dcf_eth_dev;
46 uint16_t switch_domain_id;
58 struct ice_dcf_vf_repr {
59 struct rte_eth_dev *dcf_eth_dev;
60 struct rte_ether_addr mac_addr;
61 uint16_t switch_domain_id;
64 struct ice_dcf_vlan outer_vlan_info; /* DCF always handle outer VLAN */
67 extern const struct rte_tm_ops ice_dcf_tm_ops;
68 void ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,
69 uint8_t *msg, uint16_t msglen);
70 int ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev);
71 void ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev);
73 int ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param);
74 int ice_dcf_vf_repr_uninit(struct rte_eth_dev *vf_rep_eth_dev);
75 int ice_dcf_vf_repr_init_vlan(struct rte_eth_dev *vf_rep_eth_dev);
76 void ice_dcf_vf_repr_stop_all(struct ice_dcf_adapter *dcf_adapter);
77 bool ice_dcf_adminq_need_retry(struct ice_adapter *ad);
79 #endif /* _ICE_DCF_ETHDEV_H_ */