1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
8 #include <rte_ethdev_driver.h>
10 #include <iavf_prototype.h>
11 #include <iavf_adminq_cmd.h>
12 #include <iavf_type.h>
14 #include "base/ice_type.h"
17 struct dcf_virtchnl_cmd {
18 TAILQ_ENTRY(dcf_virtchnl_cmd) next;
20 enum virtchnl_ops v_op;
21 enum iavf_status v_ret;
36 rte_spinlock_t vc_cmd_send_lock;
37 rte_spinlock_t vc_cmd_queue_lock;
38 TAILQ_HEAD(, dcf_virtchnl_cmd) vc_cmd_queue;
39 void (*vc_event_msg_cb)(struct ice_dcf_hw *dcf_hw,
40 uint8_t *msg, uint16_t msglen);
47 struct virtchnl_version_info virtchnl_version;
48 struct virtchnl_vf_resource *vf_res; /* VF resource */
49 struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */
52 struct rte_eth_dev *eth_dev;
55 uint64_t supported_rxdid;
56 uint16_t num_queue_pairs;
61 struct virtchnl_eth_stats eth_stats_offset;
64 int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
65 struct dcf_virtchnl_cmd *cmd);
66 int ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,
67 void *buf, uint16_t buf_size);
68 int ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw);
69 int ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);
70 void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw);
71 int ice_dcf_init_rss(struct ice_dcf_hw *hw);
72 int ice_dcf_configure_queues(struct ice_dcf_hw *hw);
73 int ice_dcf_config_irq_map(struct ice_dcf_hw *hw);
74 int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on);
75 int ice_dcf_disable_queues(struct ice_dcf_hw *hw);
76 int ice_dcf_query_stats(struct ice_dcf_hw *hw,
77 struct virtchnl_eth_stats *pstats);
78 int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add);
80 #endif /* _ICE_DCF_H_ */