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
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;
37 struct ice_dcf_repr_info *repr_infos;
40 struct ice_dcf_vf_repr_param {
41 struct rte_eth_dev *dcf_eth_dev;
42 uint16_t switch_domain_id;
54 struct ice_dcf_vf_repr {
55 struct rte_eth_dev *dcf_eth_dev;
56 struct rte_ether_addr mac_addr;
57 uint16_t switch_domain_id;
60 struct ice_dcf_vlan outer_vlan_info; /* DCF always handle outer VLAN */
63 extern const struct rte_tm_ops ice_dcf_tm_ops;
64 void ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,
65 uint8_t *msg, uint16_t msglen);
66 int ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev);
67 void ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev);
69 int ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param);
70 int ice_dcf_vf_repr_uninit(struct rte_eth_dev *vf_rep_eth_dev);
71 int ice_dcf_vf_repr_init_vlan(struct rte_eth_dev *vf_rep_eth_dev);
72 void ice_dcf_vf_repr_stop_all(struct ice_dcf_adapter *dcf_adapter);
73 bool ice_dcf_adminq_need_retry(struct ice_adapter *ad);
75 #endif /* _ICE_DCF_ETHDEV_H_ */