net/i40e: fix Rx packet statistics
[dpdk.git] / drivers / net / ice / ice_dcf_ethdev.h
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 #include "base/ice_dcb.h"
11 #include "base/ice_sched.h"
12
13 #include "ice_ethdev.h"
14 #include "ice_dcf.h"
15
16 #define ICE_DCF_MAX_RINGS  1
17
18 struct ice_dcf_queue {
19         uint64_t dummy;
20 };
21
22 struct ice_dcf_repr_info {
23         struct rte_eth_dev *vf_rep_eth_dev;
24 };
25
26 struct ice_dcf_adapter {
27         struct ice_adapter parent; /* Must be first */
28         struct ice_dcf_hw real_hw;
29
30         int num_reprs;
31         struct ice_dcf_repr_info *repr_infos;
32 };
33
34 struct ice_dcf_vf_repr_param {
35         struct rte_eth_dev *dcf_eth_dev;
36         uint16_t switch_domain_id;
37         uint16_t vf_id;
38 };
39
40 struct ice_dcf_vlan {
41         bool port_vlan_ena;
42         bool stripping_ena;
43
44         uint16_t tpid;
45         uint16_t vid;
46 };
47
48 struct ice_dcf_vf_repr {
49         struct rte_eth_dev *dcf_eth_dev;
50         struct rte_ether_addr mac_addr;
51         uint16_t switch_domain_id;
52         uint16_t vf_id;
53
54         struct ice_dcf_vlan outer_vlan_info; /* DCF always handle outer VLAN */
55 };
56
57 extern const struct rte_tm_ops ice_dcf_tm_ops;
58 void ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,
59                                  uint8_t *msg, uint16_t msglen);
60 int ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev);
61 void ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev);
62
63 int ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param);
64 int ice_dcf_vf_repr_uninit(struct rte_eth_dev *vf_rep_eth_dev);
65 int ice_dcf_vf_repr_init_vlan(struct rte_eth_dev *vf_rep_eth_dev);
66 void ice_dcf_vf_repr_stop_all(struct ice_dcf_adapter *dcf_adapter);
67
68 #endif /* _ICE_DCF_ETHDEV_H_ */