DPDK  17.11.10
rte_pmd_i40e.h
Go to the documentation of this file.
1 /*-
2  * BSD LICENSE
3  *
4  * Copyright (c) 2017 Intel Corporation. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * * Neither the name of Intel Corporation nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef _PMD_I40E_H_
34 #define _PMD_I40E_H_
35 
45 #include <rte_ethdev.h>
46 
55 };
56 
61  uint16_t vfid;
62  uint16_t msg_type;
63  uint16_t retval;
64  void *msg;
65  uint16_t msglen;
66 };
67 
72  RTE_PMD_I40E_PKG_OP_UNDEFINED = 0,
76  RTE_PMD_I40E_PKG_OP_MAX = 32
77 };
78 
83  RTE_PMD_I40E_PKG_INFO_UNDEFINED = 0,
84  RTE_PMD_I40E_PKG_INFO_GLOBAL_HEADER,
85  RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES_SIZE,
86  RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES,
87  RTE_PMD_I40E_PKG_INFO_GLOBAL_MAX = 1024,
88  RTE_PMD_I40E_PKG_INFO_HEADER,
89  RTE_PMD_I40E_PKG_INFO_DEVID_NUM,
90  RTE_PMD_I40E_PKG_INFO_DEVID_LIST,
91  RTE_PMD_I40E_PKG_INFO_PROTOCOL_NUM,
92  RTE_PMD_I40E_PKG_INFO_PROTOCOL_LIST,
93  RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM,
94  RTE_PMD_I40E_PKG_INFO_PCTYPE_LIST,
95  RTE_PMD_I40E_PKG_INFO_PTYPE_NUM,
96  RTE_PMD_I40E_PKG_INFO_PTYPE_LIST,
97  RTE_PMD_I40E_PKG_INFO_MAX = (int)0xFFFFFFFF
98 };
99 
104  RTE_PMD_I40E_RSS_QUEUE_REGION_UNDEFINED,
125  RTE_PMD_I40E_RSS_QUEUE_REGION_INFO_GET,
126  RTE_PMD_I40E_RSS_QUEUE_REGION_OP_MAX
127 };
128 
129 #define RTE_PMD_I40E_DDP_NAME_SIZE 32
130 #define RTE_PMD_I40E_PCTYPE_MAX 64
131 #define RTE_PMD_I40E_REGION_MAX_NUM 8
132 #define RTE_PMD_I40E_MAX_USER_PRIORITY 8
133 
139  uint8_t major;
140  uint8_t minor;
141  uint8_t update;
142  uint8_t draft;
143 };
144 
149  uint32_t vendor_dev_id;
150  uint32_t sub_vendor_dev_id;
151 };
152 
157  uint32_t track_id;
158  struct rte_pmd_i40e_ddp_version version;
159  uint8_t owner;
160  uint8_t reserved[7];
161  uint8_t name[RTE_PMD_I40E_DDP_NAME_SIZE];
162 };
163 
164 #define RTE_PMD_I40E_DDP_OWNER_UNKNOWN 0xFF
165 
170  uint32_t p_count;
171  struct rte_pmd_i40e_profile_info p_info[1];
172 };
173 
174 #define RTE_PMD_I40E_PROTO_NUM 6
175 #define RTE_PMD_I40E_PROTO_UNUSED 0xFF
176 
181  uint8_t proto_id;
182  char name[RTE_PMD_I40E_DDP_NAME_SIZE];
183 };
184 
189  uint8_t ptype_id;
190  uint8_t protocols[RTE_PMD_I40E_PROTO_NUM];
191 };
192 
198 #define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK 0x80000000
199 
200 struct rte_pmd_i40e_ptype_mapping {
201  uint16_t hw_ptype;
202  uint32_t sw_ptype;
203 };
204 
210  uint8_t region_id;
215  uint8_t hw_flowtype;
219  uint8_t queue_num;
221  uint8_t user_priority;
222 };
223 
224 /* queue region info */
225 struct rte_pmd_i40e_queue_region_info {
227  uint8_t region_id;
229  uint8_t queue_start_index;
231  uint8_t queue_num;
233  uint8_t user_priority_num;
235  uint8_t user_priority[RTE_PMD_I40E_MAX_USER_PRIORITY];
237  uint8_t flowtype_num;
243  uint8_t hw_flowtype[RTE_PMD_I40E_PCTYPE_MAX];
244 };
245 
246 struct rte_pmd_i40e_queue_regions {
248  uint16_t queue_region_number;
249  struct rte_pmd_i40e_queue_region_info
250  region[RTE_PMD_I40E_REGION_MAX_NUM];
251 };
252 
257  RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT,
258  RTE_PMD_I40E_PKT_TEMPLATE_REJECT,
259  RTE_PMD_I40E_PKT_TEMPLATE_PASSTHRU,
260 };
261 
275 };
276 
282  uint16_t rx_queue;
292  uint8_t flex_off;
293 };
294 
300  uint16_t pctype;
302  void *packet;
304  uint32_t length;
305 };
306 
317  uint32_t soft_id;
318 };
319 
336  uint16_t port,
337  const struct rte_pmd_i40e_pkt_template_conf *conf,
338  uint8_t add);
339 
352 int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf);
353 
370  uint16_t vf_id,
371  uint8_t on);
372 
389  uint16_t vf_id,
390  uint8_t on);
391 
406  uint8_t on);
407 
424  uint16_t vf_id,
425  uint8_t on);
426 
443  uint16_t vf_id,
444  uint8_t on);
445 
466 int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
467  struct ether_addr *mac_addr);
468 
485 int
486 rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
487 
504 int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id,
505  uint16_t vlan_id);
506 
523 int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
524  uint8_t on);
525 
542 int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on);
543 
563 int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id,
564  uint64_t vf_mask, uint8_t on);
565 
588 int rte_pmd_i40e_get_vf_stats(uint16_t port,
589  uint16_t vf_id,
590  struct rte_eth_stats *stats);
591 
604 int rte_pmd_i40e_reset_vf_stats(uint16_t port,
605  uint16_t vf_id);
606 
629 int rte_pmd_i40e_set_vf_max_bw(uint16_t port,
630  uint16_t vf_id,
631  uint32_t bw);
632 
655  uint16_t vf_id,
656  uint8_t tc_num,
657  uint8_t *bw_weight);
658 
680  uint16_t vf_id,
681  uint8_t tc_no,
682  uint32_t bw);
683 
697 int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map);
698 
718 int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff,
719  uint32_t size,
720  enum rte_pmd_i40e_package_op op);
721 
739 int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size,
740  uint8_t *info, uint32_t size,
741  enum rte_pmd_i40e_package_info type);
742 
756 int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size);
757 
776  uint16_t port,
777  struct rte_pmd_i40e_ptype_mapping *mapping_items,
778  uint16_t count,
779  uint8_t exclusive);
780 
789 
807  uint16_t port,
808  struct rte_pmd_i40e_ptype_mapping *mapping_items,
809  uint16_t size,
810  uint16_t *count,
811  uint8_t valid_only);
812 
828  uint32_t target,
829  uint8_t mask,
830  uint32_t pkt_type);
831 
849 int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
850  struct ether_addr *mac_addr);
851 
852 #define RTE_PMD_I40E_PCTYPE_MAX 64
853 #define RTE_PMD_I40E_FLOW_TYPE_MAX 64
854 
855 struct rte_pmd_i40e_flow_type_mapping {
856  uint16_t flow_type;
857  uint64_t pctype;
858 };
859 
878  uint16_t port,
879  struct rte_pmd_i40e_flow_type_mapping *mapping_items,
880  uint16_t count,
881  uint8_t exclusive);
882 
895  uint16_t port,
896  struct rte_pmd_i40e_flow_type_mapping *mapping_items);
897 
906 
920  const struct ether_addr *vf_mac);
921 
933 int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,
934  enum rte_pmd_i40e_queue_region_op op_type, void *arg);
935 
936 #endif /* _PMD_I40E_H_ */
enum rte_pmd_i40e_pkt_template_status report_status
Definition: rte_pmd_i40e.h:286
int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats)
int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw)
struct rte_pmd_i40e_pkt_template_action action
Definition: rte_pmd_i40e.h:315
int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id)
int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size, uint8_t *info, uint32_t size, enum rte_pmd_i40e_package_info type)
int rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on)
int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on)
rte_pmd_i40e_pkt_template_status
Definition: rte_pmd_i40e.h:266
int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on)
rte_pmd_i40e_queue_region_op
Definition: rte_pmd_i40e.h:103
int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id, enum rte_pmd_i40e_queue_region_op op_type, void *arg)
int rte_pmd_i40e_ptype_mapping_reset(uint16_t port)
int rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id)
rte_pmd_i40e_pkt_template_behavior
Definition: rte_pmd_i40e.h:256
int rte_pmd_i40e_flow_type_mapping_update(uint16_t port, struct rte_pmd_i40e_flow_type_mapping *mapping_items, uint16_t count, uint8_t exclusive)
rte_pmd_i40e_package_info
Definition: rte_pmd_i40e.h:82
rte_pmd_i40e_package_op
Definition: rte_pmd_i40e.h:71
int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port)
int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_query_vfid_by_mac(uint16_t port, const struct ether_addr *vf_mac)
int rte_pmd_i40e_flow_type_mapping_get(uint16_t port, struct rte_pmd_i40e_flow_type_mapping *mapping_items)
int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight)
int rte_pmd_i40e_flow_add_del_packet_template(uint16_t port, const struct rte_pmd_i40e_pkt_template_conf *conf, uint8_t add)
int rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on)
int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_ptype_mapping_update(uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive)
int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr)
int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op)
int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf)
int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size)
struct rte_pmd_i40e_pkt_template_input input
Definition: rte_pmd_i40e.h:313
int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type)
int rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw)
int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map)
int rte_pmd_i40e_ptype_mapping_get(uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, uint8_t valid_only)
enum rte_pmd_i40e_pkt_template_behavior behavior
Definition: rte_pmd_i40e.h:284
rte_pmd_i40e_mb_event_rsp
Definition: rte_pmd_i40e.h:50
int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr)