1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
11 * i40e PMD specific functions.
13 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
21 #include <rte_compat.h>
22 #include <rte_ethdev.h>
23 #include <rte_ether.h>
26 * Response sent back to i40e driver from user app after callback
28 enum rte_pmd_i40e_mb_event_rsp {
29 RTE_PMD_I40E_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */
30 RTE_PMD_I40E_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
31 RTE_PMD_I40E_MB_EVENT_PROCEED, /**< proceed with mbox request */
32 RTE_PMD_I40E_MB_EVENT_MAX /**< max value of this enum */
36 * Data sent to the user application when the callback is executed.
38 struct rte_pmd_i40e_mb_event_param {
39 uint16_t vfid; /**< Virtual Function number */
40 uint16_t msg_type; /**< VF to PF message type, see virtchnl_ops */
41 uint16_t retval; /**< return value */
42 void *msg; /**< pointer to message */
43 uint16_t msglen; /**< length of the message */
47 * Option of package processing.
49 enum rte_pmd_i40e_package_op {
50 RTE_PMD_I40E_PKG_OP_UNDEFINED = 0,
51 RTE_PMD_I40E_PKG_OP_WR_ADD, /**< load package and add to info list */
52 RTE_PMD_I40E_PKG_OP_WR_DEL, /**< load package and delete from info list */
53 RTE_PMD_I40E_PKG_OP_WR_ONLY, /**< load package without modifying info list */
54 RTE_PMD_I40E_PKG_OP_MAX = 32
58 * Types of package information.
60 enum rte_pmd_i40e_package_info {
61 RTE_PMD_I40E_PKG_INFO_UNDEFINED = 0,
62 RTE_PMD_I40E_PKG_INFO_GLOBAL_HEADER,
63 RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES_SIZE,
64 RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES,
65 RTE_PMD_I40E_PKG_INFO_GLOBAL_MAX = 1024,
66 RTE_PMD_I40E_PKG_INFO_HEADER,
67 RTE_PMD_I40E_PKG_INFO_DEVID_NUM,
68 RTE_PMD_I40E_PKG_INFO_DEVID_LIST,
69 RTE_PMD_I40E_PKG_INFO_PROTOCOL_NUM,
70 RTE_PMD_I40E_PKG_INFO_PROTOCOL_LIST,
71 RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM,
72 RTE_PMD_I40E_PKG_INFO_PCTYPE_LIST,
73 RTE_PMD_I40E_PKG_INFO_PTYPE_NUM,
74 RTE_PMD_I40E_PKG_INFO_PTYPE_LIST,
75 RTE_PMD_I40E_PKG_INFO_MAX = (int)0xFFFFFFFF
79 * Option types of queue region.
81 enum rte_pmd_i40e_queue_region_op {
82 RTE_PMD_I40E_RSS_QUEUE_REGION_UNDEFINED,
83 /** add queue region set */
84 RTE_PMD_I40E_RSS_QUEUE_REGION_SET,
85 /** add PF region pctype set */
86 RTE_PMD_I40E_RSS_QUEUE_REGION_FLOWTYPE_SET,
87 /** add queue region user priority set */
88 RTE_PMD_I40E_RSS_QUEUE_REGION_USER_PRIORITY_SET,
90 * ALL configuration about queue region from up layer
91 * at first will only keep in DPDK software stored in driver,
92 * only after " FLUSH_ON ", it commit all configuration to HW.
93 * Because PMD had to set hardware configuration at a time, so
94 * it will record all up layer command at first.
96 RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_ON,
98 * "FLUSH_OFF " is just clean all configuration about queue
99 * region just now, and restore all to DPDK i40e driver default
100 * config when start up.
102 RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_OFF,
103 RTE_PMD_I40E_RSS_QUEUE_REGION_INFO_GET,
104 RTE_PMD_I40E_RSS_QUEUE_REGION_OP_MAX
107 #define RTE_PMD_I40E_DDP_NAME_SIZE 32
108 #define RTE_PMD_I40E_PCTYPE_MAX 64
109 #define RTE_PMD_I40E_REGION_MAX_NUM 8
110 #define RTE_PMD_I40E_MAX_USER_PRIORITY 8
113 * Version for dynamic device personalization.
114 * Version in "major.minor.update.draft" format.
116 struct rte_pmd_i40e_ddp_version {
124 * Device ID for dynamic device personalization.
126 struct rte_pmd_i40e_ddp_device_id {
127 uint32_t vendor_dev_id;
128 uint32_t sub_vendor_dev_id;
132 * Profile information in profile info list.
134 struct rte_pmd_i40e_profile_info {
136 struct rte_pmd_i40e_ddp_version version;
139 uint8_t name[RTE_PMD_I40E_DDP_NAME_SIZE];
142 #define RTE_PMD_I40E_DDP_OWNER_UNKNOWN 0xFF
145 * Profile information list returned from HW.
147 struct rte_pmd_i40e_profile_list {
149 struct rte_pmd_i40e_profile_info p_info[1];
152 #define RTE_PMD_I40E_PROTO_NUM 6
153 #define RTE_PMD_I40E_PROTO_UNUSED 0xFF
156 * Protocols information stored in profile
158 struct rte_pmd_i40e_proto_info {
160 char name[RTE_PMD_I40E_DDP_NAME_SIZE];
164 * Packet classification/ packet type information stored in profile
166 struct rte_pmd_i40e_ptype_info {
168 uint8_t protocols[RTE_PMD_I40E_PROTO_NUM];
172 * ptype mapping table only accept RTE_PTYPE_XXX or "user defined" ptype.
173 * A ptype with MSB set will be regarded as a user defined ptype.
174 * Below macro help to create a user defined ptype.
176 #define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK 0x80000000
178 struct rte_pmd_i40e_ptype_mapping {
179 uint16_t hw_ptype; /**< hardware defined packet type*/
180 uint32_t sw_ptype; /**< software defined packet type */
184 * Queue region related information.
186 struct rte_pmd_i40e_queue_region_conf {
187 /** the region id for this configuration */
189 /** the pctype or hardware flowtype of packet,
190 * the specific index for each type has been defined
191 * in file i40e_type.h as enum i40e_filter_pctype.
194 /** the start queue index for this region */
195 uint8_t queue_start_index;
196 /** the total queue number of this queue region */
198 /** the packet's user priority for this region */
199 uint8_t user_priority;
202 /* queue region info */
203 struct rte_pmd_i40e_queue_region_info {
204 /** the region id for this configuration */
206 /** the start queue index for this region */
207 uint8_t queue_start_index;
208 /** the total queue number of this queue region */
210 /** the total number of user priority for this region */
211 uint8_t user_priority_num;
212 /** the packet's user priority for this region */
213 uint8_t user_priority[RTE_PMD_I40E_MAX_USER_PRIORITY];
214 /** the total number of flowtype for this region */
215 uint8_t flowtype_num;
217 * the pctype or hardware flowtype of packet,
218 * the specific index for each type has been defined
219 * in file i40e_type.h as enum i40e_filter_pctype.
221 uint8_t hw_flowtype[RTE_PMD_I40E_PCTYPE_MAX];
224 struct rte_pmd_i40e_queue_regions {
225 /** the total number of queue region for this port */
226 uint16_t queue_region_number;
227 struct rte_pmd_i40e_queue_region_info
228 region[RTE_PMD_I40E_REGION_MAX_NUM];
232 * Behavior will be taken if raw packet template is matched.
234 enum rte_pmd_i40e_pkt_template_behavior {
235 RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT,
236 RTE_PMD_I40E_PKT_TEMPLATE_REJECT,
237 RTE_PMD_I40E_PKT_TEMPLATE_PASSTHRU,
241 * Flow director report status
242 * It defines what will be reported if raw packet template is matched.
244 enum rte_pmd_i40e_pkt_template_status {
245 /** report nothing */
246 RTE_PMD_I40E_PKT_TEMPLATE_NO_REPORT_STATUS,
247 /** only report FD ID */
248 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID,
249 /** report FD ID and 4 flex bytes */
250 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4,
251 /** report 8 flex bytes */
252 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8,
256 * A structure used to define an action when raw packet template is matched.
258 struct rte_pmd_i40e_pkt_template_action {
259 /** queue assigned to if raw packet template match */
261 /** behavior will be taken */
262 enum rte_pmd_i40e_pkt_template_behavior behavior;
263 /** status report option */
264 enum rte_pmd_i40e_pkt_template_status report_status;
266 * If report_status is RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4 or
267 * RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8, flex_off specifies
268 * where the reported flex bytes start from in flexible payload.
274 * A structure used to define the input for raw packet template.
276 struct rte_pmd_i40e_pkt_template_input {
277 /** the pctype used for raw packet template */
279 /** the buffer containing raw packet template */
281 /** the length of buffer with raw packet template */
286 * A structure used to define the configuration parameters
287 * for raw packet template.
289 struct rte_pmd_i40e_pkt_template_conf {
290 /** the input for raw packet template. */
291 struct rte_pmd_i40e_pkt_template_input input;
292 /** the action to be taken when raw packet template is matched */
293 struct rte_pmd_i40e_pkt_template_action action;
294 /** ID, an unique software index for the raw packet template filter */
298 enum rte_pmd_i40e_inset_type {
305 struct rte_pmd_i40e_inset_mask {
310 struct rte_pmd_i40e_inset {
312 struct rte_pmd_i40e_inset_mask mask[2];
316 * Add or remove raw packet template filter to Flow Director.
319 * The port identifier of the Ethernet device.
321 * Specifies configuration parameters of raw packet template filter.
323 * Specifies an action to be taken - add or remove raw packet template filter.
325 * - (0) if successful.
326 * - (-ENODEV) if *port* invalid.
327 * - (-EINVAL) if *conf* invalid.
328 * - (-ENOTSUP) not supported by firmware.
330 int rte_pmd_i40e_flow_add_del_packet_template(
332 const struct rte_pmd_i40e_pkt_template_conf *conf,
336 * Notify VF when PF link status changes.
339 * The port identifier of the Ethernet device.
343 * - (0) if successful.
344 * - (-ENODEV) if *port* invalid.
345 * - (-EINVAL) if *vf* invalid.
347 int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf);
350 * Enable/Disable VF MAC anti spoofing.
353 * The port identifier of the Ethernet device.
355 * VF on which to set MAC anti spoofing.
357 * 1 - Enable VFs MAC anti spoofing.
358 * 0 - Disable VFs MAC anti spoofing.
360 * - (0) if successful.
361 * - (-ENODEV) if *port* invalid.
362 * - (-EINVAL) if bad parameter.
364 int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port,
369 * Enable/Disable VF VLAN anti spoofing.
372 * The port identifier of the Ethernet device.
374 * VF on which to set VLAN anti spoofing.
376 * 1 - Enable VFs VLAN anti spoofing.
377 * 0 - Disable VFs VLAN anti spoofing.
379 * - (0) if successful.
380 * - (-ENODEV) if *port* invalid.
381 * - (-EINVAL) if bad parameter.
383 int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port,
388 * Enable/Disable TX loopback on all the PF and VFs.
391 * The port identifier of the Ethernet device.
393 * 1 - Enable TX loopback.
394 * 0 - Disable TX loopback.
396 * - (0) if successful.
397 * - (-ENODEV) if *port* invalid.
398 * - (-EINVAL) if bad parameter.
400 int rte_pmd_i40e_set_tx_loopback(uint16_t port,
404 * Enable/Disable VF unicast promiscuous mode.
407 * The port identifier of the Ethernet device.
409 * VF on which to set.
414 * - (0) if successful.
415 * - (-ENODEV) if *port* invalid.
416 * - (-EINVAL) if bad parameter.
418 int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port,
423 * Enable/Disable VF multicast promiscuous mode.
426 * The port identifier of the Ethernet device.
428 * VF on which to set.
433 * - (0) if successful.
434 * - (-ENODEV) if *port* invalid.
435 * - (-EINVAL) if bad parameter.
437 int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port,
442 * Set the VF MAC address.
444 * PF should set MAC address before VF initialized, if PF sets the MAC
445 * address after VF initialized, new MAC address won't be effective until
448 * This will remove all existing MAC filters.
451 * The port identifier of the Ethernet device.
457 * - (0) if successful.
458 * - (-ENODEV) if *port* invalid.
459 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
461 int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
462 struct rte_ether_addr *mac_addr);
465 * Remove the VF MAC address.
468 * The port identifier of the Ethernet device.
474 * - (0) if successful.
475 * - (-ENODEV) if *port* invalid.
476 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
479 rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
480 struct rte_ether_addr *mac_addr);
483 * Enable/Disable vf vlan strip for all queues in a pool
486 * The port identifier of the Ethernet device.
490 * 1 - Enable VF's vlan strip on RX queues.
491 * 0 - Disable VF's vlan strip on RX queues.
494 * - (0) if successful.
495 * - (-ENODEV) if *port* invalid.
496 * - (-EINVAL) if bad parameter.
499 rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
502 * Enable/Disable vf vlan insert
505 * The port identifier of the Ethernet device.
509 * 0 - Disable VF's vlan insert.
510 * n - Enable; n is inserted as the vlan id.
513 * - (0) if successful.
514 * - (-ENODEV) if *port* invalid.
515 * - (-EINVAL) if bad parameter.
517 int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id,
521 * Enable/Disable vf broadcast mode
524 * The port identifier of the Ethernet device.
528 * 0 - Disable broadcast.
529 * 1 - Enable broadcast.
532 * - (0) if successful.
533 * - (-ENODEV) if *port* invalid.
534 * - (-EINVAL) if bad parameter.
536 int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
540 * Enable/Disable vf vlan tag
543 * The port identifier of the Ethernet device.
547 * 0 - Disable VF's vlan tag.
548 * n - Enable VF's vlan tag.
551 * - (0) if successful.
552 * - (-ENODEV) if *port* invalid.
553 * - (-EINVAL) if bad parameter.
555 int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on);
558 * Enable/Disable VF VLAN filter
561 * The port identifier of the Ethernet device.
565 * Mask to filter VF's
567 * 0 - Disable VF's VLAN filter.
568 * 1 - Enable VF's VLAN filter.
571 * - (0) if successful.
572 * - (-ENODEV) if *port* invalid.
573 * - (-EINVAL) if bad parameter.
574 * - (-ENOTSUP) not supported by firmware.
576 int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id,
577 uint64_t vf_mask, uint8_t on);
580 * Get VF's statistics
583 * The port identifier of the Ethernet device.
585 * VF on which to get.
587 * A pointer to a structure of type *rte_eth_stats* to be filled with
588 * the values of device counters for the following set of statistics:
589 * - *ipackets* with the total of successfully received packets.
590 * - *opackets* with the total of successfully transmitted packets.
591 * - *ibytes* with the total of successfully received bytes.
592 * - *obytes* with the total of successfully transmitted bytes.
593 * - *ierrors* with the total of erroneous received packets.
594 * - *oerrors* with the total of failed transmitted packets.
596 * - (0) if successful.
597 * - (-ENODEV) if *port* invalid.
598 * - (-EINVAL) if bad parameter.
601 int rte_pmd_i40e_get_vf_stats(uint16_t port,
603 struct rte_eth_stats *stats);
606 * Clear VF's statistics
609 * The port identifier of the Ethernet device.
611 * VF on which to get.
613 * - (0) if successful.
614 * - (-ENODEV) if *port* invalid.
615 * - (-EINVAL) if bad parameter.
617 int rte_pmd_i40e_reset_vf_stats(uint16_t port,
621 * Set VF's max bandwidth.
623 * Per VF bandwidth limitation and per TC bandwidth limitation cannot
624 * be enabled in parallel. If per TC bandwidth is enabled, this function
628 * The port identifier of the Ethernet device.
632 * Bandwidth for this VF.
633 * The value should be an absolute bandwidth in Mbps.
634 * The bandwidth is a L2 bandwidth counting the bytes of ethernet packets.
635 * Not count the bytes added by physical layer.
637 * - (0) if successful.
638 * - (-ENODEV) if *port* invalid.
639 * - (-EINVAL) if bad parameter.
640 * - (-ENOTSUP) not supported by firmware.
642 int rte_pmd_i40e_set_vf_max_bw(uint16_t port,
647 * Set all the TCs' bandwidth weight on a specific VF.
649 * The bw_weight means the percentage occupied by the TC.
650 * It can be taken as the relative min bandwidth setting.
653 * The port identifier of the Ethernet device.
659 * An array of relative bandwidth weight for all the TCs.
660 * The summary of the bw_weight should be 100.
662 * - (0) if successful.
663 * - (-ENODEV) if *port* invalid.
664 * - (-EINVAL) if bad parameter.
665 * - (-ENOTSUP) not supported by firmware.
667 int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port,
673 * Set a specific TC's max bandwidth on a specific VF.
676 * The port identifier of the Ethernet device.
680 * Number specifying TC.
682 * Max bandwidth for this TC.
683 * The value should be an absolute bandwidth in Mbps.
684 * The bandwidth is a L2 bandwidth counting the bytes of ethernet packets.
685 * Not count the bytes added by physical layer.
687 * - (0) if successful.
688 * - (-ENODEV) if *port* invalid.
689 * - (-EINVAL) if bad parameter.
690 * - (-ENOTSUP) not supported by firmware.
692 int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port,
698 * Set some TCs to strict priority mode on a physical port.
701 * The port identifier of the Ethernet device.
703 * A bit map for the TCs.
705 * - (0) if successful.
706 * - (-ENODEV) if *port* invalid.
707 * - (-EINVAL) if bad parameter.
708 * - (-ENOTSUP) not supported by firmware.
710 int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map);
713 * Load/Unload a ddp package
716 * The port identifier of the Ethernet device.
722 * Operation of package processing
724 * - (0) if successful.
725 * - (-ENODEV) if *port* invalid.
726 * - (-EINVAL) if bad parameter.
727 * - (-EEXIST) if profile exists.
728 * - (-EACCES) if profile does not exist.
729 * - (-ENOTSUP) if operation not supported.
731 int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff,
733 enum rte_pmd_i40e_package_op op);
736 * rte_pmd_i40e_get_ddp_info - Get profile's info
740 * package buffer size
742 * buffer for response
744 * response buffer size
746 * type of information requested
748 * - (0) if successful.
749 * - (-ENOTSUP) if information type not supported by the profile.
750 * - (-EINVAL) if bad parameter.
752 int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size,
753 uint8_t *info, uint32_t size,
754 enum rte_pmd_i40e_package_info type);
757 * rte_pmd_i40e_get_ddp_list - Get loaded profile list
761 * buffer for response
765 * - (0) if successful.
766 * - (-ENODEV) if *port* invalid.
767 * - (-EINVAL) if bad parameter.
769 int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size);
772 * Update hardware defined ptype to software defined packet type
776 * pointer to port identifier of the device.
777 * @param mapping_items
778 * the base address of the mapping items array.
780 * number of mapping items.
782 * the flag indicate different ptype mapping update method.
783 * -(0) only overwrite referred PTYPE mapping,
784 * keep other PTYPEs mapping unchanged.
785 * -(!0) overwrite referred PTYPE mapping,
786 * set other PTYPEs maps to PTYPE_UNKNOWN.
788 int rte_pmd_i40e_ptype_mapping_update(
790 struct rte_pmd_i40e_ptype_mapping *mapping_items,
795 * Reset hardware defined ptype to software defined ptype
796 * mapping table to default.
799 * pointer to port identifier of the device
801 int rte_pmd_i40e_ptype_mapping_reset(uint16_t port);
804 * Get hardware defined ptype to software defined ptype
808 * pointer to port identifier of the device.
809 * @param mapping_items
810 * the base address of the array to store returned items.
812 * the size of the input array.
814 * the place to store the number of returned items.
816 * -(0) return full mapping table.
817 * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN.
819 int rte_pmd_i40e_ptype_mapping_get(
821 struct rte_pmd_i40e_ptype_mapping *mapping_items,
827 * Replace a specific or a group of software defined ptypes
831 * pointer to port identifier of the device
833 * the packet type to be replaced
835 * -(0) target represent a specific software defined ptype.
836 * -(!0) target is a mask to represent a group of software defined ptypes.
838 * the new packet type to overwrite
840 int rte_pmd_i40e_ptype_mapping_replace(uint16_t port,
846 * Add a VF MAC address.
848 * Add more MAC address for VF. The existing MAC addresses
849 * are still effective.
852 * The port identifier of the Ethernet device.
858 * - (0) if successful.
859 * - (-ENODEV) if *port* invalid.
860 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
862 int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
863 struct rte_ether_addr *mac_addr);
865 #define RTE_PMD_I40E_PCTYPE_MAX 64
866 #define RTE_PMD_I40E_FLOW_TYPE_MAX 64
868 struct rte_pmd_i40e_flow_type_mapping {
869 uint16_t flow_type; /**< software defined flow type*/
870 uint64_t pctype; /**< hardware defined pctype */
874 * Update hardware defined pctype to software defined flow type
878 * pointer to port identifier of the device.
879 * @param mapping_items
880 * the base address of the mapping items array.
882 * number of mapping items.
884 * the flag indicate different pctype mapping update method.
885 * -(0) only overwrite referred PCTYPE mapping,
886 * keep other PCTYPEs mapping unchanged.
887 * -(!0) overwrite referred PCTYPE mapping,
888 * set other PCTYPEs maps to PCTYPE_INVALID.
890 int rte_pmd_i40e_flow_type_mapping_update(
892 struct rte_pmd_i40e_flow_type_mapping *mapping_items,
897 * Get software defined flow type to hardware defined pctype
901 * pointer to port identifier of the device.
902 * @param mapping_items
903 * the base address of the array to store returned items.
904 * array should be allocated by caller with minimum size of
905 * RTE_PMD_I40E_FLOW_TYPE_MAX items
907 int rte_pmd_i40e_flow_type_mapping_get(
909 struct rte_pmd_i40e_flow_type_mapping *mapping_items);
912 * Reset hardware defined pctype to software defined flow type
913 * mapping table to default.
916 * pointer to port identifier of the device
918 int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port);
921 * On the PF, find VF index based on VF MAC address
924 * pointer to port identifier of the device
926 * the mac address of the vf to determine index of
928 * The index of vfid If successful.
929 * -EINVAL: vf mac address does not exist for this port
930 * -ENOTSUP: i40e not supported for this port.
932 int rte_pmd_i40e_query_vfid_by_mac(uint16_t port,
933 const struct rte_ether_addr *vf_mac);
936 * Do RSS queue region configuration for that port as
937 * the command option type
940 * The port identifier of the Ethernet device.
942 * Queue region operation type
944 * Queue region operation type specific data
946 int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,
947 enum rte_pmd_i40e_queue_region_op op_type, void *arg);
949 int rte_pmd_i40e_cfg_hash_inset(uint16_t port,
950 uint64_t pctype, uint64_t inset);
956 * The port identifier of the Ethernet device.
960 * Buffer for input set info.
964 * - (0) if successful.
965 * - (-ENODEV) if *port* invalid.
966 * - (-EINVAL) if bad parameter.
967 * - (-ENOTSUP) if operation not supported.
969 int rte_pmd_i40e_inset_get(uint16_t port, uint8_t pctype,
970 struct rte_pmd_i40e_inset *inset,
971 enum rte_pmd_i40e_inset_type inset_type);
977 * The port identifier of the Ethernet device.
985 * - (0) if successful.
986 * - (-ENODEV) if *port* invalid.
987 * - (-EINVAL) if bad parameter.
988 * - (-ENOTSUP) if operation not supported.
990 int rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
991 struct rte_pmd_i40e_inset *inset,
992 enum rte_pmd_i40e_inset_type inset_type);
995 * Get bit value for some field index
1000 * Field index for input set.
1006 rte_pmd_i40e_inset_field_get(uint64_t inset, uint8_t field_idx)
1013 bit_idx = 63 - field_idx;
1014 if (inset & (1ULL << bit_idx))
1021 * Set bit value for some field index
1026 * Field index for input set.
1032 rte_pmd_i40e_inset_field_set(uint64_t *inset, uint8_t field_idx)
1039 bit_idx = 63 - field_idx;
1040 *inset = *inset | (1ULL << bit_idx);
1046 * Clear bit value for some field index
1051 * Field index for input set.
1057 rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
1064 bit_idx = 63 - field_idx;
1065 *inset = *inset & ~(1ULL << bit_idx);
1071 * Get port fdir info
1074 * The port identifier of the Ethernet device.
1076 * The fdir info of the port
1078 * - (0) if successful.
1079 * - (-ENODEV) if *port* invalid.
1080 * - (-ENOTSUP) if operation not supported.
1084 rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
1087 * Get port fdir status
1090 * The port identifier of the Ethernet device.
1092 * The fdir status of the port
1094 * - (0) if successful.
1095 * - (-ENODEV) if *port* invalid.
1096 * - (-ENOTSUP) if operation not supported.
1100 rte_pmd_i40e_get_fdir_stats(uint16_t port,
1101 struct rte_eth_fdir_stats *fdir_stat);
1104 * Set GRE key length
1107 * The port identifier of the Ethernet device.
1111 * - (0) if successful.
1112 * - (-ENODEV) if *port* invalid.
1113 * - (-ENOTSUP) if operation not supported.
1117 rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len);
1120 * For ipn3ke, i40e works with FPGA.
1121 * In this situation, i40e get link status from fpga,
1122 * fpga works as switch_dev for i40e.
1123 * This function set switch_dev for i40e.
1126 * port_id of i40e device to be set switch device.
1128 * target switch device from which i40e device to get link status from.
1130 * - (less than 0) if failed.
1135 rte_pmd_i40e_set_switch_dev(uint16_t port_id, struct rte_eth_dev *switch_dev);
1141 #endif /* _PMD_I40E_H_ */