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
17 #include <rte_compat.h>
18 #include <rte_ethdev.h>
19 #include <rte_ether.h>
22 * Response sent back to i40e driver from user app after callback
24 enum rte_pmd_i40e_mb_event_rsp {
25 RTE_PMD_I40E_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */
26 RTE_PMD_I40E_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
27 RTE_PMD_I40E_MB_EVENT_PROCEED, /**< proceed with mbox request */
28 RTE_PMD_I40E_MB_EVENT_MAX /**< max value of this enum */
32 * Data sent to the user application when the callback is executed.
34 struct rte_pmd_i40e_mb_event_param {
35 uint16_t vfid; /**< Virtual Function number */
36 uint16_t msg_type; /**< VF to PF message type, see virtchnl_ops */
37 uint16_t retval; /**< return value */
38 void *msg; /**< pointer to message */
39 uint16_t msglen; /**< length of the message */
43 * Option of package processing.
45 enum rte_pmd_i40e_package_op {
46 RTE_PMD_I40E_PKG_OP_UNDEFINED = 0,
47 RTE_PMD_I40E_PKG_OP_WR_ADD, /**< load package and add to info list */
48 RTE_PMD_I40E_PKG_OP_WR_DEL, /**< load package and delete from info list */
49 RTE_PMD_I40E_PKG_OP_WR_ONLY, /**< load package without modifying info list */
50 RTE_PMD_I40E_PKG_OP_MAX = 32
54 * Types of package information.
56 enum rte_pmd_i40e_package_info {
57 RTE_PMD_I40E_PKG_INFO_UNDEFINED = 0,
58 RTE_PMD_I40E_PKG_INFO_GLOBAL_HEADER,
59 RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES_SIZE,
60 RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES,
61 RTE_PMD_I40E_PKG_INFO_GLOBAL_MAX = 1024,
62 RTE_PMD_I40E_PKG_INFO_HEADER,
63 RTE_PMD_I40E_PKG_INFO_DEVID_NUM,
64 RTE_PMD_I40E_PKG_INFO_DEVID_LIST,
65 RTE_PMD_I40E_PKG_INFO_PROTOCOL_NUM,
66 RTE_PMD_I40E_PKG_INFO_PROTOCOL_LIST,
67 RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM,
68 RTE_PMD_I40E_PKG_INFO_PCTYPE_LIST,
69 RTE_PMD_I40E_PKG_INFO_PTYPE_NUM,
70 RTE_PMD_I40E_PKG_INFO_PTYPE_LIST,
71 RTE_PMD_I40E_PKG_INFO_MAX = (int)0xFFFFFFFF
75 * Option types of queue region.
77 enum rte_pmd_i40e_queue_region_op {
78 RTE_PMD_I40E_RSS_QUEUE_REGION_UNDEFINED,
79 /** add queue region set */
80 RTE_PMD_I40E_RSS_QUEUE_REGION_SET,
81 /** add PF region pctype set */
82 RTE_PMD_I40E_RSS_QUEUE_REGION_FLOWTYPE_SET,
83 /** add queue region user priority set */
84 RTE_PMD_I40E_RSS_QUEUE_REGION_USER_PRIORITY_SET,
86 * ALL configuration about queue region from up layer
87 * at first will only keep in DPDK software stored in driver,
88 * only after " FLUSH_ON ", it commit all configuration to HW.
89 * Because PMD had to set hardware configuration at a time, so
90 * it will record all up layer command at first.
92 RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_ON,
94 * "FLUSH_OFF " is just clean all configuration about queue
95 * region just now, and restore all to DPDK i40e driver default
96 * config when start up.
98 RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_OFF,
99 RTE_PMD_I40E_RSS_QUEUE_REGION_INFO_GET,
100 RTE_PMD_I40E_RSS_QUEUE_REGION_OP_MAX
103 #define RTE_PMD_I40E_DDP_NAME_SIZE 32
104 #define RTE_PMD_I40E_PCTYPE_MAX 64
105 #define RTE_PMD_I40E_REGION_MAX_NUM 8
106 #define RTE_PMD_I40E_MAX_USER_PRIORITY 8
109 * Version for dynamic device personalization.
110 * Version in "major.minor.update.draft" format.
112 struct rte_pmd_i40e_ddp_version {
120 * Device ID for dynamic device personalization.
122 struct rte_pmd_i40e_ddp_device_id {
123 uint32_t vendor_dev_id;
124 uint32_t sub_vendor_dev_id;
128 * Profile information in profile info list.
130 struct rte_pmd_i40e_profile_info {
132 struct rte_pmd_i40e_ddp_version version;
135 uint8_t name[RTE_PMD_I40E_DDP_NAME_SIZE];
138 #define RTE_PMD_I40E_DDP_OWNER_UNKNOWN 0xFF
141 * Profile information list returned from HW.
143 struct rte_pmd_i40e_profile_list {
145 struct rte_pmd_i40e_profile_info p_info[1];
148 #define RTE_PMD_I40E_PROTO_NUM 6
149 #define RTE_PMD_I40E_PROTO_UNUSED 0xFF
152 * Protocols information stored in profile
154 struct rte_pmd_i40e_proto_info {
156 char name[RTE_PMD_I40E_DDP_NAME_SIZE];
160 * Packet classification/ packet type information stored in profile
162 struct rte_pmd_i40e_ptype_info {
164 uint8_t protocols[RTE_PMD_I40E_PROTO_NUM];
168 * ptype mapping table only accept RTE_PTYPE_XXX or "user defined" ptype.
169 * A ptype with MSB set will be regarded as a user defined ptype.
170 * Below macro help to create a user defined ptype.
172 #define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK 0x80000000
174 struct rte_pmd_i40e_ptype_mapping {
175 uint16_t hw_ptype; /**< hardware defined packet type*/
176 uint32_t sw_ptype; /**< software defined packet type */
180 * Queue region related information.
182 struct rte_pmd_i40e_queue_region_conf {
183 /** the region id for this configuration */
185 /** the pctype or hardware flowtype of packet,
186 * the specific index for each type has been defined
187 * in file i40e_type.h as enum i40e_filter_pctype.
190 /** the start queue index for this region */
191 uint8_t queue_start_index;
192 /** the total queue number of this queue region */
194 /** the packet's user priority for this region */
195 uint8_t user_priority;
198 /* queue region info */
199 struct rte_pmd_i40e_queue_region_info {
200 /** the region id for this configuration */
202 /** the start queue index for this region */
203 uint8_t queue_start_index;
204 /** the total queue number of this queue region */
206 /** the total number of user priority for this region */
207 uint8_t user_priority_num;
208 /** the packet's user priority for this region */
209 uint8_t user_priority[RTE_PMD_I40E_MAX_USER_PRIORITY];
210 /** the total number of flowtype for this region */
211 uint8_t flowtype_num;
213 * the pctype or hardware flowtype of packet,
214 * the specific index for each type has been defined
215 * in file i40e_type.h as enum i40e_filter_pctype.
217 uint8_t hw_flowtype[RTE_PMD_I40E_PCTYPE_MAX];
220 struct rte_pmd_i40e_queue_regions {
221 /** the total number of queue region for this port */
222 uint16_t queue_region_number;
223 struct rte_pmd_i40e_queue_region_info
224 region[RTE_PMD_I40E_REGION_MAX_NUM];
228 * Behavior will be taken if raw packet template is matched.
230 enum rte_pmd_i40e_pkt_template_behavior {
231 RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT,
232 RTE_PMD_I40E_PKT_TEMPLATE_REJECT,
233 RTE_PMD_I40E_PKT_TEMPLATE_PASSTHRU,
237 * Flow director report status
238 * It defines what will be reported if raw packet template is matched.
240 enum rte_pmd_i40e_pkt_template_status {
241 /** report nothing */
242 RTE_PMD_I40E_PKT_TEMPLATE_NO_REPORT_STATUS,
243 /** only report FD ID */
244 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID,
245 /** report FD ID and 4 flex bytes */
246 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4,
247 /** report 8 flex bytes */
248 RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8,
252 * A structure used to define an action when raw packet template is matched.
254 struct rte_pmd_i40e_pkt_template_action {
255 /** queue assigned to if raw packet template match */
257 /** behavior will be taken */
258 enum rte_pmd_i40e_pkt_template_behavior behavior;
259 /** status report option */
260 enum rte_pmd_i40e_pkt_template_status report_status;
262 * If report_status is RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4 or
263 * RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8, flex_off specifies
264 * where the reported flex bytes start from in flexible payload.
270 * A structure used to define the input for raw packet template.
272 struct rte_pmd_i40e_pkt_template_input {
273 /** the pctype used for raw packet template */
275 /** the buffer containing raw packet template */
277 /** the length of buffer with raw packet template */
282 * A structure used to define the configuration parameters
283 * for raw packet template.
285 struct rte_pmd_i40e_pkt_template_conf {
286 /** the input for raw packet template. */
287 struct rte_pmd_i40e_pkt_template_input input;
288 /** the action to be taken when raw packet template is matched */
289 struct rte_pmd_i40e_pkt_template_action action;
290 /** ID, an unique software index for the raw packet template filter */
294 enum rte_pmd_i40e_inset_type {
301 struct rte_pmd_i40e_inset_mask {
306 struct rte_pmd_i40e_inset {
308 struct rte_pmd_i40e_inset_mask mask[2];
312 * Add or remove raw packet template filter to Flow Director.
315 * The port identifier of the Ethernet device.
317 * Specifies configuration parameters of raw packet template filter.
319 * Specifies an action to be taken - add or remove raw packet template filter.
321 * - (0) if successful.
322 * - (-ENODEV) if *port* invalid.
323 * - (-EINVAL) if *conf* invalid.
324 * - (-ENOTSUP) not supported by firmware.
326 int rte_pmd_i40e_flow_add_del_packet_template(
328 const struct rte_pmd_i40e_pkt_template_conf *conf,
332 * Notify VF when PF link status changes.
335 * The port identifier of the Ethernet device.
339 * - (0) if successful.
340 * - (-ENODEV) if *port* invalid.
341 * - (-EINVAL) if *vf* invalid.
343 int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf);
346 * Enable/Disable VF MAC anti spoofing.
349 * The port identifier of the Ethernet device.
351 * VF on which to set MAC anti spoofing.
353 * 1 - Enable VFs MAC anti spoofing.
354 * 0 - Disable VFs MAC anti spoofing.
356 * - (0) if successful.
357 * - (-ENODEV) if *port* invalid.
358 * - (-EINVAL) if bad parameter.
360 int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port,
365 * Enable/Disable VF VLAN anti spoofing.
368 * The port identifier of the Ethernet device.
370 * VF on which to set VLAN anti spoofing.
372 * 1 - Enable VFs VLAN anti spoofing.
373 * 0 - Disable VFs VLAN anti spoofing.
375 * - (0) if successful.
376 * - (-ENODEV) if *port* invalid.
377 * - (-EINVAL) if bad parameter.
379 int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port,
384 * Enable/Disable TX loopback on all the PF and VFs.
387 * The port identifier of the Ethernet device.
389 * 1 - Enable TX loopback.
390 * 0 - Disable TX loopback.
392 * - (0) if successful.
393 * - (-ENODEV) if *port* invalid.
394 * - (-EINVAL) if bad parameter.
396 int rte_pmd_i40e_set_tx_loopback(uint16_t port,
400 * Enable/Disable VF unicast promiscuous mode.
403 * The port identifier of the Ethernet device.
405 * VF on which to set.
410 * - (0) if successful.
411 * - (-ENODEV) if *port* invalid.
412 * - (-EINVAL) if bad parameter.
414 int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port,
419 * Enable/Disable VF multicast promiscuous mode.
422 * The port identifier of the Ethernet device.
424 * VF on which to set.
429 * - (0) if successful.
430 * - (-ENODEV) if *port* invalid.
431 * - (-EINVAL) if bad parameter.
433 int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port,
438 * Set the VF MAC address.
440 * PF should set MAC address before VF initialized, if PF sets the MAC
441 * address after VF initialized, new MAC address won't be effective until
444 * This will remove all existing MAC filters.
447 * The port identifier of the Ethernet device.
453 * - (0) if successful.
454 * - (-ENODEV) if *port* invalid.
455 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
457 int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
458 struct rte_ether_addr *mac_addr);
461 * Remove the VF MAC address.
464 * The port identifier of the Ethernet device.
470 * - (0) if successful.
471 * - (-ENODEV) if *port* invalid.
472 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
475 rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
476 struct rte_ether_addr *mac_addr);
479 * Enable/Disable vf vlan strip for all queues in a pool
482 * The port identifier of the Ethernet device.
486 * 1 - Enable VF's vlan strip on RX queues.
487 * 0 - Disable VF's vlan strip on RX queues.
490 * - (0) if successful.
491 * - (-ENODEV) if *port* invalid.
492 * - (-EINVAL) if bad parameter.
495 rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
498 * Enable/Disable vf vlan insert
501 * The port identifier of the Ethernet device.
505 * 0 - Disable VF's vlan insert.
506 * n - Enable; n is inserted as the vlan id.
509 * - (0) if successful.
510 * - (-ENODEV) if *port* invalid.
511 * - (-EINVAL) if bad parameter.
513 int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id,
517 * Enable/Disable vf broadcast mode
520 * The port identifier of the Ethernet device.
524 * 0 - Disable broadcast.
525 * 1 - Enable broadcast.
528 * - (0) if successful.
529 * - (-ENODEV) if *port* invalid.
530 * - (-EINVAL) if bad parameter.
532 int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
536 * Enable/Disable vf vlan tag
539 * The port identifier of the Ethernet device.
543 * 0 - Disable VF's vlan tag.
544 * n - Enable VF's vlan tag.
547 * - (0) if successful.
548 * - (-ENODEV) if *port* invalid.
549 * - (-EINVAL) if bad parameter.
551 int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on);
554 * Enable/Disable VF VLAN filter
557 * The port identifier of the Ethernet device.
561 * Mask to filter VF's
563 * 0 - Disable VF's VLAN filter.
564 * 1 - Enable VF's VLAN filter.
567 * - (0) if successful.
568 * - (-ENODEV) if *port* invalid.
569 * - (-EINVAL) if bad parameter.
570 * - (-ENOTSUP) not supported by firmware.
572 int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id,
573 uint64_t vf_mask, uint8_t on);
576 * Get VF's statistics
579 * The port identifier of the Ethernet device.
581 * VF on which to get.
583 * A pointer to a structure of type *rte_eth_stats* to be filled with
584 * the values of device counters for the following set of statistics:
585 * - *ipackets* with the total of successfully received packets.
586 * - *opackets* with the total of successfully transmitted packets.
587 * - *ibytes* with the total of successfully received bytes.
588 * - *obytes* with the total of successfully transmitted bytes.
589 * - *ierrors* with the total of erroneous received packets.
590 * - *oerrors* with the total of failed transmitted packets.
592 * - (0) if successful.
593 * - (-ENODEV) if *port* invalid.
594 * - (-EINVAL) if bad parameter.
597 int rte_pmd_i40e_get_vf_stats(uint16_t port,
599 struct rte_eth_stats *stats);
602 * Clear VF's statistics
605 * The port identifier of the Ethernet device.
607 * VF on which to get.
609 * - (0) if successful.
610 * - (-ENODEV) if *port* invalid.
611 * - (-EINVAL) if bad parameter.
613 int rte_pmd_i40e_reset_vf_stats(uint16_t port,
617 * Set VF's max bandwidth.
619 * Per VF bandwidth limitation and per TC bandwidth limitation cannot
620 * be enabled in parallel. If per TC bandwidth is enabled, this function
624 * The port identifier of the Ethernet device.
628 * Bandwidth for this VF.
629 * The value should be an absolute bandwidth in Mbps.
630 * The bandwidth is a L2 bandwidth counting the bytes of ethernet packets.
631 * Not count the bytes added by physical layer.
633 * - (0) if successful.
634 * - (-ENODEV) if *port* invalid.
635 * - (-EINVAL) if bad parameter.
636 * - (-ENOTSUP) not supported by firmware.
638 int rte_pmd_i40e_set_vf_max_bw(uint16_t port,
643 * Set all the TCs' bandwidth weight on a specific VF.
645 * The bw_weight means the percentage occupied by the TC.
646 * It can be taken as the relative min bandwidth setting.
649 * The port identifier of the Ethernet device.
655 * An array of relative bandwidth weight for all the TCs.
656 * The summary of the bw_weight should be 100.
658 * - (0) if successful.
659 * - (-ENODEV) if *port* invalid.
660 * - (-EINVAL) if bad parameter.
661 * - (-ENOTSUP) not supported by firmware.
663 int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port,
669 * Set a specific TC's max bandwidth on a specific VF.
672 * The port identifier of the Ethernet device.
676 * Number specifying TC.
678 * Max bandwidth for this TC.
679 * The value should be an absolute bandwidth in Mbps.
680 * The bandwidth is a L2 bandwidth counting the bytes of ethernet packets.
681 * Not count the bytes added by physical layer.
683 * - (0) if successful.
684 * - (-ENODEV) if *port* invalid.
685 * - (-EINVAL) if bad parameter.
686 * - (-ENOTSUP) not supported by firmware.
688 int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port,
694 * Set some TCs to strict priority mode on a physical port.
697 * The port identifier of the Ethernet device.
699 * A bit map for the TCs.
701 * - (0) if successful.
702 * - (-ENODEV) if *port* invalid.
703 * - (-EINVAL) if bad parameter.
704 * - (-ENOTSUP) not supported by firmware.
706 int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map);
709 * Load/Unload a ddp package
712 * The port identifier of the Ethernet device.
718 * Operation of package processing
720 * - (0) if successful.
721 * - (-ENODEV) if *port* invalid.
722 * - (-EINVAL) if bad parameter.
723 * - (-EEXIST) if profile exists.
724 * - (-EACCES) if profile does not exist.
725 * - (-ENOTSUP) if operation not supported.
727 int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff,
729 enum rte_pmd_i40e_package_op op);
732 * rte_pmd_i40e_get_ddp_info - Get profile's info
736 * package buffer size
738 * buffer for response
740 * response buffer size
742 * type of information requested
744 * - (0) if successful.
745 * - (-ENOTSUP) if information type not supported by the profile.
746 * - (-EINVAL) if bad parameter.
748 int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size,
749 uint8_t *info, uint32_t size,
750 enum rte_pmd_i40e_package_info type);
753 * rte_pmd_i40e_get_ddp_list - Get loaded profile list
757 * buffer for response
761 * - (0) if successful.
762 * - (-ENODEV) if *port* invalid.
763 * - (-EINVAL) if bad parameter.
765 int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size);
768 * Update hardware defined ptype to software defined packet type
772 * pointer to port identifier of the device.
773 * @param mapping_items
774 * the base address of the mapping items array.
776 * number of mapping items.
778 * the flag indicate different ptype mapping update method.
779 * -(0) only overwrite referred PTYPE mapping,
780 * keep other PTYPEs mapping unchanged.
781 * -(!0) overwrite referred PTYPE mapping,
782 * set other PTYPEs maps to PTYPE_UNKNOWN.
784 int rte_pmd_i40e_ptype_mapping_update(
786 struct rte_pmd_i40e_ptype_mapping *mapping_items,
791 * Reset hardware defined ptype to software defined ptype
792 * mapping table to default.
795 * pointer to port identifier of the device
797 int rte_pmd_i40e_ptype_mapping_reset(uint16_t port);
800 * Get hardware defined ptype to software defined ptype
804 * pointer to port identifier of the device.
805 * @param mapping_items
806 * the base address of the array to store returned items.
808 * the size of the input array.
810 * the place to store the number of returned items.
812 * -(0) return full mapping table.
813 * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN.
815 int rte_pmd_i40e_ptype_mapping_get(
817 struct rte_pmd_i40e_ptype_mapping *mapping_items,
823 * Replace a specific or a group of software defined ptypes
827 * pointer to port identifier of the device
829 * the packet type to be replaced
831 * -(0) target represent a specific software defined ptype.
832 * -(!0) target is a mask to represent a group of software defined ptypes.
834 * the new packet type to overwrite
836 int rte_pmd_i40e_ptype_mapping_replace(uint16_t port,
842 * Add a VF MAC address.
844 * Add more MAC address for VF. The existing MAC addresses
845 * are still effective.
848 * The port identifier of the Ethernet device.
854 * - (0) if successful.
855 * - (-ENODEV) if *port* invalid.
856 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
858 int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
859 struct rte_ether_addr *mac_addr);
861 #define RTE_PMD_I40E_PCTYPE_MAX 64
862 #define RTE_PMD_I40E_FLOW_TYPE_MAX 64
864 struct rte_pmd_i40e_flow_type_mapping {
865 uint16_t flow_type; /**< software defined flow type*/
866 uint64_t pctype; /**< hardware defined pctype */
870 * Update hardware defined pctype to software defined flow type
874 * pointer to port identifier of the device.
875 * @param mapping_items
876 * the base address of the mapping items array.
878 * number of mapping items.
880 * the flag indicate different pctype mapping update method.
881 * -(0) only overwrite referred PCTYPE mapping,
882 * keep other PCTYPEs mapping unchanged.
883 * -(!0) overwrite referred PCTYPE mapping,
884 * set other PCTYPEs maps to PCTYPE_INVALID.
886 int rte_pmd_i40e_flow_type_mapping_update(
888 struct rte_pmd_i40e_flow_type_mapping *mapping_items,
893 * Get software defined flow type to hardware defined pctype
897 * pointer to port identifier of the device.
898 * @param mapping_items
899 * the base address of the array to store returned items.
900 * array should be allocated by caller with minimum size of
901 * RTE_PMD_I40E_FLOW_TYPE_MAX items
903 int rte_pmd_i40e_flow_type_mapping_get(
905 struct rte_pmd_i40e_flow_type_mapping *mapping_items);
908 * Reset hardware defined pctype to software defined flow type
909 * mapping table to default.
912 * pointer to port identifier of the device
914 int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port);
917 * On the PF, find VF index based on VF MAC address
920 * pointer to port identifier of the device
922 * the mac address of the vf to determine index of
924 * The index of vfid If successful.
925 * -EINVAL: vf mac address does not exist for this port
926 * -ENOTSUP: i40e not supported for this port.
928 int rte_pmd_i40e_query_vfid_by_mac(uint16_t port,
929 const struct rte_ether_addr *vf_mac);
932 * Do RSS queue region configuration for that port as
933 * the command option type
936 * The port identifier of the Ethernet device.
938 * Queue region operation type
940 * Queue region operation type specific data
942 int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,
943 enum rte_pmd_i40e_queue_region_op op_type, void *arg);
945 int rte_pmd_i40e_cfg_hash_inset(uint16_t port,
946 uint64_t pctype, uint64_t inset);
952 * The port identifier of the Ethernet device.
956 * Buffer for input set info.
960 * - (0) if successful.
961 * - (-ENODEV) if *port* invalid.
962 * - (-EINVAL) if bad parameter.
963 * - (-ENOTSUP) if operation not supported.
965 int rte_pmd_i40e_inset_get(uint16_t port, uint8_t pctype,
966 struct rte_pmd_i40e_inset *inset,
967 enum rte_pmd_i40e_inset_type inset_type);
973 * The port identifier of the Ethernet device.
981 * - (0) if successful.
982 * - (-ENODEV) if *port* invalid.
983 * - (-EINVAL) if bad parameter.
984 * - (-ENOTSUP) if operation not supported.
986 int rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
987 struct rte_pmd_i40e_inset *inset,
988 enum rte_pmd_i40e_inset_type inset_type);
991 * Get bit value for some field index
996 * Field index for input set.
1002 rte_pmd_i40e_inset_field_get(uint64_t inset, uint8_t field_idx)
1009 bit_idx = 63 - field_idx;
1010 if (inset & (1ULL << bit_idx))
1017 * Set bit value for some field index
1022 * Field index for input set.
1028 rte_pmd_i40e_inset_field_set(uint64_t *inset, uint8_t field_idx)
1035 bit_idx = 63 - field_idx;
1036 *inset = *inset | (1ULL << bit_idx);
1042 * Clear bit value for some field index
1047 * Field index for input set.
1053 rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
1060 bit_idx = 63 - field_idx;
1061 *inset = *inset & ~(1ULL << bit_idx);
1067 * Get port fdir info
1070 * The port identifier of the Ethernet device.
1072 * The fdir info of the port
1074 * - (0) if successful.
1075 * - (-ENODEV) if *port* invalid.
1076 * - (-ENOTSUP) if operation not supported.
1080 rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
1083 * Get port fdir status
1086 * The port identifier of the Ethernet device.
1088 * The fdir status of the port
1090 * - (0) if successful.
1091 * - (-ENODEV) if *port* invalid.
1092 * - (-ENOTSUP) if operation not supported.
1096 rte_pmd_i40e_get_fdir_stats(uint16_t port,
1097 struct rte_eth_fdir_stats *fdir_stat);
1100 * Set GRE key length
1103 * The port identifier of the Ethernet device.
1107 * - (0) if successful.
1108 * - (-ENODEV) if *port* invalid.
1109 * - (-ENOTSUP) if operation not supported.
1113 rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len);
1116 * For ipn3ke, i40e works with FPGA.
1117 * In this situation, i40e get link status from fpga,
1118 * fpga works as switch_dev for i40e.
1119 * This function set switch_dev for i40e.
1122 * port_id of i40e device to be set switch device.
1124 * target switch device from which i40e device to get link status from.
1126 * - (less than 0) if failed.
1131 rte_pmd_i40e_set_switch_dev(uint16_t port_id, struct rte_eth_dev *switch_dev);
1133 #endif /* _PMD_I40E_H_ */