4 * Copyright (c) 2017 Intel Corporation. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
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
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.
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.
37 * @file rte_pmd_i40e.h
39 * i40e PMD specific functions.
41 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
45 #include <rte_ethdev.h>
48 * Response sent back to i40e driver from user app after callback
50 enum rte_pmd_i40e_mb_event_rsp {
51 RTE_PMD_I40E_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */
52 RTE_PMD_I40E_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
53 RTE_PMD_I40E_MB_EVENT_PROCEED, /**< proceed with mbox request */
54 RTE_PMD_I40E_MB_EVENT_MAX /**< max value of this enum */
58 * Data sent to the user application when the callback is executed.
60 struct rte_pmd_i40e_mb_event_param {
61 uint16_t vfid; /**< Virtual Function number */
62 uint16_t msg_type; /**< VF to PF message type, see virtchnl_ops */
63 uint16_t retval; /**< return value */
64 void *msg; /**< pointer to message */
65 uint16_t msglen; /**< length of the message */
69 * Option of package processing.
71 enum rte_pmd_i40e_package_op {
72 RTE_PMD_I40E_PKG_OP_UNDEFINED = 0,
73 RTE_PMD_I40E_PKG_OP_WR_ADD, /**< load package and add to info list */
74 RTE_PMD_I40E_PKG_OP_WR_DEL, /**< load package and delete from info list */
75 RTE_PMD_I40E_PKG_OP_WR_ONLY, /**< load package without modifying info list */
76 RTE_PMD_I40E_PKG_OP_MAX = 32
80 * Types of package information.
82 enum rte_pmd_i40e_package_info {
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 = 0xFFFFFFFF
101 * Option types of queue region.
103 enum rte_pmd_i40e_queue_region_op {
104 RTE_PMD_I40E_RSS_QUEUE_REGION_UNDEFINED,
105 /** add queue region set */
106 RTE_PMD_I40E_RSS_QUEUE_REGION_SET,
107 /** add PF region pctype set */
108 RTE_PMD_I40E_RSS_QUEUE_REGION_FLOWTYPE_SET,
109 /** add queue region user priority set */
110 RTE_PMD_I40E_RSS_QUEUE_REGION_USER_PRIORITY_SET,
112 * ALL configuration about queue region from up layer
113 * at first will only keep in DPDK software stored in driver,
114 * only after " FLUSH_ON ", it commit all configuration to HW.
115 * Because PMD had to set hardware configuration at a time, so
116 * it will record all up layer command at first.
118 RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_ON,
120 * "FLUSH_OFF " is just clean all configuration about queue
121 * region just now, and restore all to DPDK i40e driver default
122 * config when start up.
124 RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_OFF,
125 RTE_PMD_I40E_RSS_QUEUE_REGION_INFO_GET,
126 RTE_PMD_I40E_RSS_QUEUE_REGION_OP_MAX
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
135 * Version for dynamic device personalization.
136 * Version in "major.minor.update.draft" format.
138 struct rte_pmd_i40e_ddp_version {
146 * Device ID for dynamic device personalization.
148 struct rte_pmd_i40e_ddp_device_id {
149 uint32_t vendor_dev_id;
150 uint32_t sub_vendor_dev_id;
154 * Profile information in profile info list.
156 struct rte_pmd_i40e_profile_info {
158 struct rte_pmd_i40e_ddp_version version;
161 uint8_t name[RTE_PMD_I40E_DDP_NAME_SIZE];
164 #define RTE_PMD_I40E_DDP_OWNER_UNKNOWN 0xFF
167 * Profile information list returned from HW.
169 struct rte_pmd_i40e_profile_list {
171 struct rte_pmd_i40e_profile_info p_info[1];
174 #define RTE_PMD_I40E_PROTO_NUM 6
175 #define RTE_PMD_I40E_PROTO_UNUSED 0xFF
178 * Protocols information stored in profile
180 struct rte_pmd_i40e_proto_info {
182 char name[RTE_PMD_I40E_DDP_NAME_SIZE];
186 * Packet classification/ packet type information stored in profile
188 struct rte_pmd_i40e_ptype_info {
190 uint8_t protocols[RTE_PMD_I40E_PROTO_NUM];
194 * ptype mapping table only accept RTE_PTYPE_XXX or "user defined" ptype.
195 * A ptype with MSB set will be regarded as a user defined ptype.
196 * Below macro help to create a user defined ptype.
198 #define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK 0x80000000
200 struct rte_pmd_i40e_ptype_mapping {
201 uint16_t hw_ptype; /**< hardware defined packet type*/
202 uint32_t sw_ptype; /**< software defined packet type */
206 * Queue region related information.
208 struct rte_pmd_i40e_queue_region_conf {
209 /** the region id for this configuration */
211 /** the pctype or hardware flowtype of packet,
212 * the specific index for each type has been defined
213 * in file i40e_type.h as enum i40e_filter_pctype.
216 /** the start queue index for this region */
217 uint8_t queue_start_index;
218 /** the total queue number of this queue region */
220 /** the packet's user priority for this region */
221 uint8_t user_priority;
224 /* queue region info */
225 struct rte_pmd_i40e_queue_region_info {
226 /** the region id for this configuration */
228 /** the start queue index for this region */
229 uint8_t queue_start_index;
230 /** the total queue number of this queue region */
232 /** the total number of user priority for this region */
233 uint8_t user_priority_num;
234 /** the packet's user priority for this region */
235 uint8_t user_priority[RTE_PMD_I40E_MAX_USER_PRIORITY];
236 /** the total number of flowtype for this region */
237 uint8_t flowtype_num;
239 * the pctype or hardware flowtype of packet,
240 * the specific index for each type has been defined
241 * in file i40e_type.h as enum i40e_filter_pctype.
243 uint8_t hw_flowtype[RTE_PMD_I40E_PCTYPE_MAX];
246 struct rte_pmd_i40e_queue_regions {
247 /** the total number of queue region for this port */
248 uint16_t queue_region_number;
249 struct rte_pmd_i40e_queue_region_info
250 region[RTE_PMD_I40E_REGION_MAX_NUM];
254 * Behavior will be taken if raw packet template is matched.
256 enum rte_pmd_i40e_pkt_template_behavior {
257 RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT,
258 RTE_PMD_I40E_PKT_TEMPLATE_REJECT,
259 RTE_PMD_I40E_PKT_TEMPLATE_PASSTHRU,
263 * Flow director report status
264 * It defines what will be reported if raw packet template is matched.
266 enum rte_pmd_i40e_pkt_template_status {
267 /** report nothing */
268 RTE_PMD_I40E_PKT_TEMPLATE_NO_REPORT_STATUS,
269 /** only report FD ID */
270 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID,
271 /** report FD ID and 4 flex bytes */
272 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4,
273 /** report 8 flex bytes */
274 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8,
278 * A structure used to define an action when raw packet template is matched.
280 struct rte_pmd_i40e_pkt_template_action {
281 /** queue assigned to if raw packet template match */
283 /** behavior will be taken */
284 enum rte_pmd_i40e_pkt_template_behavior behavior;
285 /** status report option */
286 enum rte_pmd_i40e_pkt_template_status report_status;
288 * If report_status is RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4 or
289 * RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8, flex_off specifies
290 * where the reported flex bytes start from in flexible payload.
296 * A structure used to define the input for raw packet template.
298 struct rte_pmd_i40e_pkt_template_input {
299 /** the pctype used for raw packet template */
301 /** the buffer conatining raw packet template */
303 /** the length of buffer with raw packet template */
308 * A structure used to define the configuration parameters
309 * for raw packet template.
311 struct rte_pmd_i40e_pkt_template_conf {
312 /** the input for raw packet template. */
313 struct rte_pmd_i40e_pkt_template_input input;
314 /** the action to be taken when raw packet template is matched */
315 struct rte_pmd_i40e_pkt_template_action action;
316 /** ID, an unique software index for the raw packet template filter */
321 * Add or remove raw packet template filter to Flow Director.
324 * The port identifier of the Ethernet device.
326 * Specifies configuration parameters of raw packet template filter.
328 * Speicifes an action to be taken - add or remove raw packet template filter.
330 * - (0) if successful.
331 * - (-ENODEV) if *port* invalid.
332 * - (-EINVAL) if *conf* invalid.
333 * - (-ENOTSUP) not supported by firmware.
335 int rte_pmd_i40e_flow_add_del_packet_template(
337 const struct rte_pmd_i40e_pkt_template_conf *conf,
341 * Notify VF when PF link status changes.
344 * The port identifier of the Ethernet device.
348 * - (0) if successful.
349 * - (-ENODEV) if *port* invalid.
350 * - (-EINVAL) if *vf* invalid.
352 int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf);
355 * Enable/Disable VF MAC anti spoofing.
358 * The port identifier of the Ethernet device.
360 * VF on which to set MAC anti spoofing.
362 * 1 - Enable VFs MAC anti spoofing.
363 * 0 - Disable VFs MAC anti spoofing.
365 * - (0) if successful.
366 * - (-ENODEV) if *port* invalid.
367 * - (-EINVAL) if bad parameter.
369 int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port,
374 * Enable/Disable VF VLAN anti spoofing.
377 * The port identifier of the Ethernet device.
379 * VF on which to set VLAN anti spoofing.
381 * 1 - Enable VFs VLAN anti spoofing.
382 * 0 - Disable VFs VLAN anti spoofing.
384 * - (0) if successful.
385 * - (-ENODEV) if *port* invalid.
386 * - (-EINVAL) if bad parameter.
388 int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port,
393 * Enable/Disable TX loopback on all the PF and VFs.
396 * The port identifier of the Ethernet device.
398 * 1 - Enable TX loopback.
399 * 0 - Disable TX loopback.
401 * - (0) if successful.
402 * - (-ENODEV) if *port* invalid.
403 * - (-EINVAL) if bad parameter.
405 int rte_pmd_i40e_set_tx_loopback(uint16_t port,
409 * Enable/Disable VF unicast promiscuous mode.
412 * The port identifier of the Ethernet device.
414 * VF on which to set.
419 * - (0) if successful.
420 * - (-ENODEV) if *port* invalid.
421 * - (-EINVAL) if bad parameter.
423 int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port,
428 * Enable/Disable VF multicast promiscuous mode.
431 * The port identifier of the Ethernet device.
433 * VF on which to set.
438 * - (0) if successful.
439 * - (-ENODEV) if *port* invalid.
440 * - (-EINVAL) if bad parameter.
442 int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port,
447 * Set the VF MAC address.
449 * PF should set MAC address before VF initialized, if PF sets the MAC
450 * address after VF initialized, new MAC address won't be effective until
453 * This will remove all existing MAC filters.
456 * The port identifier of the Ethernet device.
462 * - (0) if successful.
463 * - (-ENODEV) if *port* invalid.
464 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
466 int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
467 struct ether_addr *mac_addr);
470 * Enable/Disable vf vlan strip for all queues in a pool
473 * The port identifier of the Ethernet device.
477 * 1 - Enable VF's vlan strip on RX queues.
478 * 0 - Disable VF's vlan strip on RX queues.
481 * - (0) if successful.
482 * - (-ENODEV) if *port* invalid.
483 * - (-EINVAL) if bad parameter.
486 rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
489 * Enable/Disable vf vlan insert
492 * The port identifier of the Ethernet device.
496 * 0 - Disable VF's vlan insert.
497 * n - Enable; n is inserted as the vlan id.
500 * - (0) if successful.
501 * - (-ENODEV) if *port* invalid.
502 * - (-EINVAL) if bad parameter.
504 int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id,
508 * Enable/Disable vf broadcast mode
511 * The port identifier of the Ethernet device.
515 * 0 - Disable broadcast.
516 * 1 - Enable broadcast.
519 * - (0) if successful.
520 * - (-ENODEV) if *port* invalid.
521 * - (-EINVAL) if bad parameter.
523 int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
527 * Enable/Disable vf vlan tag
530 * The port identifier of the Ethernet device.
534 * 0 - Disable VF's vlan tag.
535 * n - Enable VF's vlan tag.
538 * - (0) if successful.
539 * - (-ENODEV) if *port* invalid.
540 * - (-EINVAL) if bad parameter.
542 int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on);
545 * Enable/Disable VF VLAN filter
548 * The port identifier of the Ethernet device.
552 * Mask to filter VF's
554 * 0 - Disable VF's VLAN filter.
555 * 1 - Enable VF's VLAN filter.
558 * - (0) if successful.
559 * - (-ENODEV) if *port* invalid.
560 * - (-EINVAL) if bad parameter.
561 * - (-ENOTSUP) not supported by firmware.
563 int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id,
564 uint64_t vf_mask, uint8_t on);
567 * Get VF's statistics
570 * The port identifier of the Ethernet device.
572 * VF on which to get.
574 * A pointer to a structure of type *rte_eth_stats* to be filled with
575 * the values of device counters for the following set of statistics:
576 * - *ipackets* with the total of successfully received packets.
577 * - *opackets* with the total of successfully transmitted packets.
578 * - *ibytes* with the total of successfully received bytes.
579 * - *obytes* with the total of successfully transmitted bytes.
580 * - *ierrors* with the total of erroneous received packets.
581 * - *oerrors* with the total of failed transmitted packets.
583 * - (0) if successful.
584 * - (-ENODEV) if *port* invalid.
585 * - (-EINVAL) if bad parameter.
588 int rte_pmd_i40e_get_vf_stats(uint16_t port,
590 struct rte_eth_stats *stats);
593 * Clear VF's statistics
596 * The port identifier of the Ethernet device.
598 * VF on which to get.
600 * - (0) if successful.
601 * - (-ENODEV) if *port* invalid.
602 * - (-EINVAL) if bad parameter.
604 int rte_pmd_i40e_reset_vf_stats(uint16_t port,
608 * Set VF's max bandwidth.
610 * Per VF bandwidth limitation and per TC bandwidth limitation cannot
611 * be enabled in parallel. If per TC bandwidth is enabled, this function
615 * The port identifier of the Ethernet device.
619 * Bandwidth for this VF.
620 * The value should be an absolute bandwidth in Mbps.
621 * The bandwidth is a L2 bandwidth counting the bytes of ethernet packets.
622 * Not count the bytes added by physical layer.
624 * - (0) if successful.
625 * - (-ENODEV) if *port* invalid.
626 * - (-EINVAL) if bad parameter.
627 * - (-ENOTSUP) not supported by firmware.
629 int rte_pmd_i40e_set_vf_max_bw(uint16_t port,
634 * Set all the TCs' bandwidth weight on a specific VF.
636 * The bw_weight means the percentage occupied by the TC.
637 * It can be taken as the relative min bandwidth setting.
640 * The port identifier of the Ethernet device.
646 * An array of relative bandwidth weight for all the TCs.
647 * The summary of the bw_weight should be 100.
649 * - (0) if successful.
650 * - (-ENODEV) if *port* invalid.
651 * - (-EINVAL) if bad parameter.
652 * - (-ENOTSUP) not supported by firmware.
654 int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port,
660 * Set a specific TC's max bandwidth on a specific VF.
663 * The port identifier of the Ethernet device.
667 * Number specifying TC.
669 * Max bandwidth for this TC.
670 * The value should be an absolute bandwidth in Mbps.
671 * The bandwidth is a L2 bandwidth counting the bytes of ethernet packets.
672 * Not count the bytes added by physical layer.
674 * - (0) if successful.
675 * - (-ENODEV) if *port* invalid.
676 * - (-EINVAL) if bad parameter.
677 * - (-ENOTSUP) not supported by firmware.
679 int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port,
685 * Set some TCs to strict priority mode on a physical port.
688 * The port identifier of the Ethernet device.
690 * A bit map for the TCs.
692 * - (0) if successful.
693 * - (-ENODEV) if *port* invalid.
694 * - (-EINVAL) if bad parameter.
695 * - (-ENOTSUP) not supported by firmware.
697 int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map);
700 * Load/Unload a ddp package
703 * The port identifier of the Ethernet device.
709 * Operation of package processing
711 * - (0) if successful.
712 * - (-ENODEV) if *port* invalid.
713 * - (-EINVAL) if bad parameter.
714 * - (-EEXIST) if profile exists.
715 * - (-EACCES) if profile does not exist.
716 * - (-ENOTSUP) if operation not supported.
718 int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff,
720 enum rte_pmd_i40e_package_op op);
723 * rte_pmd_i40e_get_ddp_info - Get profile's info
727 * package buffer size
729 * buffer for response
731 * response buffer size
733 * type of information requested
735 * - (0) if successful.
736 * - (-ENOTSUP) if information type not supported by the profile.
737 * - (-EINVAL) if bad parameter.
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);
744 * rte_pmd_i40e_get_ddp_list - Get loaded profile list
748 * buffer for response
752 * - (0) if successful.
753 * - (-ENODEV) if *port* invalid.
754 * - (-EINVAL) if bad parameter.
756 int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size);
759 * Update hardware defined ptype to software defined packet type
763 * pointer to port identifier of the device.
764 * @param mapping_items
765 * the base address of the mapping items array.
767 * number of mapping items.
769 * the flag indicate different ptype mapping update method.
770 * -(0) only overwrite referred PTYPE mapping,
771 * keep other PTYPEs mapping unchanged.
772 * -(!0) overwrite referred PTYPE mapping,
773 * set other PTYPEs maps to PTYPE_UNKNOWN.
775 int rte_pmd_i40e_ptype_mapping_update(
777 struct rte_pmd_i40e_ptype_mapping *mapping_items,
782 * Reset hardware defined ptype to software defined ptype
783 * mapping table to default.
786 * pointer to port identifier of the device
788 int rte_pmd_i40e_ptype_mapping_reset(uint16_t port);
791 * Get hardware defined ptype to software defined ptype
795 * pointer to port identifier of the device.
796 * @param mapping_items
797 * the base address of the array to store returned items.
799 * the size of the input array.
801 * the place to store the number of returned items.
803 * -(0) return full mapping table.
804 * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN.
806 int rte_pmd_i40e_ptype_mapping_get(
808 struct rte_pmd_i40e_ptype_mapping *mapping_items,
814 * Replace a specific or a group of software defined ptypes
818 * pointer to port identifier of the device
820 * the packet type to be replaced
822 * -(0) target represent a specific software defined ptype.
823 * -(!0) target is a mask to represent a group of software defined ptypes.
825 * the new packet type to overwrite
827 int rte_pmd_i40e_ptype_mapping_replace(uint16_t port,
833 * Add a VF MAC address.
835 * Add more MAC address for VF. The existing MAC addresses
836 * are still effective.
839 * The port identifier of the Ethernet device.
845 * - (0) if successful.
846 * - (-ENODEV) if *port* invalid.
847 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
849 int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
850 struct ether_addr *mac_addr);
852 #define RTE_PMD_I40E_PCTYPE_MAX 64
853 #define RTE_PMD_I40E_FLOW_TYPE_MAX 64
855 struct rte_pmd_i40e_flow_type_mapping {
856 uint16_t flow_type; /**< software defined flow type*/
857 uint64_t pctype; /**< hardware defined pctype */
861 * Update hardware defined pctype to software defined flow type
865 * pointer to port identifier of the device.
866 * @param mapping_items
867 * the base address of the mapping items array.
869 * number of mapping items.
871 * the flag indicate different pctype mapping update method.
872 * -(0) only overwrite referred PCTYPE mapping,
873 * keep other PCTYPEs mapping unchanged.
874 * -(!0) overwrite referred PCTYPE mapping,
875 * set other PCTYPEs maps to PCTYPE_INVALID.
877 int rte_pmd_i40e_flow_type_mapping_update(
879 struct rte_pmd_i40e_flow_type_mapping *mapping_items,
884 * Get software defined flow type to hardware defined pctype
888 * pointer to port identifier of the device.
889 * @param mapping_items
890 * the base address of the array to store returned items.
891 * array should be allocated by caller with minimum size of
892 * RTE_PMD_I40E_FLOW_TYPE_MAX items
894 int rte_pmd_i40e_flow_type_mapping_get(
896 struct rte_pmd_i40e_flow_type_mapping *mapping_items);
899 * Reset hardware defined pctype to software defined flow type
900 * mapping table to default.
903 * pointer to port identifier of the device
905 int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port);
908 * On the PF, find VF index based on VF MAC address
911 * pointer to port identifier of the device
913 * the mac address of the vf to determine index of
915 * The index of vfid If successful.
916 * -EINVAL: vf mac address does not exist for this port
917 * -ENOTSUP: i40e not supported for this port.
919 int rte_pmd_i40e_query_vfid_by_mac(uint16_t port,
920 const struct ether_addr *vf_mac);
923 * Do RSS queue region configuration for that port as
924 * the command option type
927 * The port identifier of the Ethernet device.
929 * Queue region operation type
931 * Queue region operation type specific data
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);
936 #endif /* _PMD_I40E_H_ */