xref: /dpdk/drivers/common/idpf/idpf_common_virtchnl.h (revision e9fd1ebf981f361844aea9ec94e17f4bda5e1479)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2023 Intel Corporation
3  */
4 
5 #ifndef _IDPF_COMMON_VIRTCHNL_H_
6 #define _IDPF_COMMON_VIRTCHNL_H_
7 
8 #include "idpf_common_device.h"
9 #include "idpf_common_rxtx.h"
10 
11 __rte_internal
12 int idpf_vc_api_version_check(struct idpf_adapter *adapter);
13 __rte_internal
14 int idpf_vc_caps_get(struct idpf_adapter *adapter);
15 __rte_internal
16 int idpf_vc_vport_create(struct idpf_vport *vport,
17 			 struct virtchnl2_create_vport *vport_info);
18 __rte_internal
19 int idpf_vc_vport_destroy(struct idpf_vport *vport);
20 __rte_internal
21 int idpf_vc_rss_key_set(struct idpf_vport *vport);
22 __rte_internal
23 int idpf_vc_rss_lut_set(struct idpf_vport *vport);
24 __rte_internal
25 int idpf_vc_rss_hash_set(struct idpf_vport *vport);
26 __rte_internal
27 int idpf_vc_irq_map_unmap_config(struct idpf_vport *vport,
28 				 uint16_t nb_rxq, bool map);
29 __rte_internal
30 int idpf_vc_cmd_execute(struct idpf_adapter *adapter,
31 			struct idpf_cmd_info *args);
32 __rte_internal
33 int idpf_vc_queue_switch(struct idpf_vport *vport, uint16_t qid,
34 			 bool rx, bool on);
35 __rte_internal
36 int idpf_vc_queues_ena_dis(struct idpf_vport *vport, bool enable);
37 __rte_internal
38 int idpf_vc_vport_ena_dis(struct idpf_vport *vport, bool enable);
39 __rte_internal
40 int idpf_vc_vectors_alloc(struct idpf_vport *vport, uint16_t num_vectors);
41 __rte_internal
42 int idpf_vc_vectors_dealloc(struct idpf_vport *vport);
43 __rte_internal
44 int idpf_vc_ptype_info_query(struct idpf_adapter *adapter,
45 			     struct virtchnl2_get_ptype_info *req_ptype_info,
46 			     struct virtchnl2_get_ptype_info *recv_ptype_info);
47 __rte_internal
48 int idpf_vc_one_msg_read(struct idpf_adapter *adapter, uint32_t ops,
49 			 uint16_t buf_len, uint8_t *buf);
50 __rte_internal
51 int idpf_vc_rxq_config(struct idpf_vport *vport, struct idpf_rx_queue *rxq);
52 __rte_internal
53 int idpf_vc_txq_config(struct idpf_vport *vport, struct idpf_tx_queue *txq);
54 __rte_internal
55 int idpf_vc_stats_query(struct idpf_vport *vport,
56 			struct virtchnl2_vport_stats **pstats);
57 __rte_internal
58 int idpf_vc_rss_key_get(struct idpf_vport *vport);
59 __rte_internal
60 int idpf_vc_rss_lut_get(struct idpf_vport *vport);
61 __rte_internal
62 int idpf_vc_rss_hash_get(struct idpf_vport *vport);
63 __rte_internal
64 int idpf_vc_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,
65 		      struct idpf_ctlq_msg *q_msg);
66 __rte_internal
67 int idpf_vc_ctlq_post_rx_buffs(struct idpf_hw *hw, struct idpf_ctlq_info *cq,
68 			   u16 *buff_count, struct idpf_dma_mem **buffs);
69 __rte_internal
70 int idpf_vc_rxq_config_by_info(struct idpf_vport *vport, struct virtchnl2_rxq_info *rxq_info,
71 			       uint16_t num_qs);
72 __rte_internal
73 int idpf_vc_txq_config_by_info(struct idpf_vport *vport, struct virtchnl2_txq_info *txq_info,
74 			       uint16_t num_qs);
75 __rte_internal
76 int idpf_vc_ena_dis_one_queue(struct idpf_vport *vport, uint16_t qid,
77 			      uint32_t type, bool on);
78 __rte_internal
79 int idpf_vc_queue_grps_del(struct idpf_vport *vport,
80 			   uint16_t num_q_grps,
81 			   struct virtchnl2_queue_group_id *qg_ids);
82 __rte_internal
83 int
84 idpf_vc_queue_grps_add(struct idpf_vport *vport,
85 		       struct virtchnl2_add_queue_groups *ptp_queue_grps_info,
86 		       uint8_t *ptp_queue_grps_out);
87 #endif /* _IDPF_COMMON_VIRTCHNL_H_ */
88