intrte_pmd_i40e_flow_add_del_packet_template(uint16_tport,conststructrte_pmd_i40e_pkt_template_conf*conf,uint8_tadd)
Add or remove raw packet template filter to Flow Director.
Parametersport The port identifier of the Ethernet device.
conf Specifies configuration parameters of raw packet template filter.
add Specifies an action to be taken - add or remove raw packet template filter.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if conf invalid.
• (-ENOTSUP) not supported by firmware.
intrte_pmd_i40e_ping_vfs(uint16_tport,uint16_tvf)
Notify VF when PF link status changes.
Parametersport The port identifier of the Ethernet device.
vf VF id.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if vf invalid.
intrte_pmd_i40e_set_vf_mac_anti_spoof(uint16_tport,uint16_tvf_id,uint8_ton)
Enable/Disable VF MAC anti spoofing.
Parametersport The port identifier of the Ethernet device.
vf_id VF on which to set MAC anti spoofing.
on 1 - Enable VFs MAC anti spoofing. 0 - Disable VFs MAC anti spoofing.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_tport,uint16_tvf_id,uint8_ton)
Enable/Disable VF VLAN anti spoofing.
Parametersport The port identifier of the Ethernet device.
vf_id VF on which to set VLAN anti spoofing.
on 1 - Enable VFs VLAN anti spoofing. 0 - Disable VFs VLAN anti spoofing.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_tx_loopback(uint16_tport,uint8_ton)
Enable/Disable TX loopback on all the PF and VFs.
Parametersport The port identifier of the Ethernet device.
on 1 - Enable TX loopback. 0 - Disable TX loopback.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_unicast_promisc(uint16_tport,uint16_tvf_id,uint8_ton)
Enable/Disable VF unicast promiscuous mode.
Parametersport The port identifier of the Ethernet device.
vf_id VF on which to set.
on 1 - Enable. 0 - Disable.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_multicast_promisc(uint16_tport,uint16_tvf_id,uint8_ton)
Enable/Disable VF multicast promiscuous mode.
Parametersport The port identifier of the Ethernet device.
vf_id VF on which to set.
on 1 - Enable. 0 - Disable.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_mac_addr(uint16_tport,uint16_tvf_id,structrte_ether_addr*mac_addr)
Set the VF MAC address.
PF should set MAC address before VF initialized, if PF sets the MAC address after VF initialized, new MAC
address won't be effective until VF reinitialize.
This will remove all existing MAC filters.
Parametersport The port identifier of the Ethernet device.
vf_id VF id.
mac_addr VF MAC address.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if vf or mac_addr is invalid.
intrte_pmd_i40e_remove_vf_mac_addr(uint16_tport,uint16_tvf_id,structrte_ether_addr*mac_addr)
Remove the VF MAC address.
Parametersport The port identifier of the Ethernet device.
vf_id VF id.
mac_addr VF MAC address.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if vf or mac_addr is invalid.
intrte_pmd_i40e_set_vf_vlan_stripq(uint16_tport,uint16_tvf,uint8_ton)
Enable/Disable vf vlan strip for all queues in a pool
Parametersport The port identifier of the Ethernet device.
vf ID specifying VF.
on 1 - Enable VF's vlan strip on RX queues. 0 - Disable VF's vlan strip on RX queues.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_vlan_insert(uint16_tport,uint16_tvf_id,uint16_tvlan_id)
Enable/Disable vf vlan insert
Parametersport The port identifier of the Ethernet device.
vf_id ID specifying VF.
vlan_id 0 - Disable VF's vlan insert. n - Enable; n is inserted as the vlan id.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_broadcast(uint16_tport,uint16_tvf_id,uint8_ton)
Enable/Disable vf broadcast mode
Parametersport The port identifier of the Ethernet device.
vf_id ID specifying VF.
on 0 - Disable broadcast. 1 - Enable broadcast.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_vlan_tag(uint16_tport,uint16_tvf_id,uint8_ton)
Enable/Disable vf vlan tag
Parametersport The port identifier of the Ethernet device.
vf_id ID specifying VF.
on 0 - Disable VF's vlan tag. n - Enable VF's vlan tag.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_vlan_filter(uint16_tport,uint16_tvlan_id,uint64_tvf_mask,uint8_ton)
Enable/Disable VF VLAN filter
Parametersport The port identifier of the Ethernet device.
vlan_id ID specifying VLAN
vf_mask Mask to filter VF's
on 0 - Disable VF's VLAN filter. 1 - Enable VF's VLAN filter.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-ENOTSUP) not supported by firmware.
intrte_pmd_i40e_get_vf_stats(uint16_tport,uint16_tvf_id,structrte_eth_stats*stats)
Get VF's statistics
Parametersport The port identifier of the Ethernet device.
vf_id VF on which to get.
stats A pointer to a structure of type rte_eth_statstobefilledwiththevaluesofdevicecountersforthefollowingsetofstatistics:
• ipackets with the total of successfully received packets.
• opackets with the total of successfully transmitted packets.
• ibytes with the total of successfully received bytes.
• obytes with the total of successfully transmitted bytes.
• ierrors with the total of erroneous received packets.
• oerrors with the total of failed transmitted packets.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_reset_vf_stats(uint16_tport,uint16_tvf_id)
Clear VF's statistics
Parametersport The port identifier of the Ethernet device.
vf_id VF on which to get.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_set_vf_max_bw(uint16_tport,uint16_tvf_id,uint32_tbw)
Set VF's max bandwidth.
Per VF bandwidth limitation and per TC bandwidth limitation cannot be enabled in parallel. If per TC
bandwidth is enabled, this function will disable it.
Parametersport The port identifier of the Ethernet device.
vf_id ID specifying VF.
bw Bandwidth for this VF. The value should be an absolute bandwidth in Mbps. The bandwidth is a L2
bandwidth counting the bytes of ethernet packets. Not count the bytes added by physical layer.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-ENOTSUP) not supported by firmware.
intrte_pmd_i40e_set_vf_tc_bw_alloc(uint16_tport,uint16_tvf_id,uint8_ttc_num,uint8_t*bw_weight)
Set all the TCs' bandwidth weight on a specific VF.
The bw_weight means the percentage occupied by the TC. It can be taken as the relative min bandwidth
setting.
Parametersport The port identifier of the Ethernet device.
vf_id ID specifying VF.
tc_num Number of TCs.
bw_weight An array of relative bandwidth weight for all the TCs. The summary of the bw_weight should
be 100.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-ENOTSUP) not supported by firmware.
intrte_pmd_i40e_set_vf_tc_max_bw(uint16_tport,uint16_tvf_id,uint8_ttc_no,uint32_tbw)
Set a specific TC's max bandwidth on a specific VF.
Parametersport The port identifier of the Ethernet device.
vf_id ID specifying VF.
tc_no Number specifying TC.
bw Max bandwidth for this TC. The value should be an absolute bandwidth in Mbps. The bandwidth is a
L2 bandwidth counting the bytes of ethernet packets. Not count the bytes added by physical layer.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-ENOTSUP) not supported by firmware.
intrte_pmd_i40e_set_tc_strict_prio(uint16_tport,uint8_ttc_map)
Set some TCs to strict priority mode on a physical port.
Parametersport The port identifier of the Ethernet device.
tc_map A bit map for the TCs.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-ENOTSUP) not supported by firmware.
intrte_pmd_i40e_process_ddp_package(uint16_tport,uint8_t*buff,uint32_tsize,enumrte_pmd_i40e_package_opop)
Load/Unload a ddp package
Parametersport The port identifier of the Ethernet device.
buff buffer of package.
size size of buffer.
op Operation of package processing
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-EEXIST) if profile exists.
• (-EACCES) if profile does not exist.
• (-ENOTSUP) if operation not supported.
intrte_pmd_i40e_get_ddp_info(uint8_t*pkg,uint32_tpkg_size,uint8_t*info,uint32_tsize,enumrte_pmd_i40e_package_infotype)
rte_pmd_i40e_get_ddp_info - Get profile's info
Parameterspkg buffer of package.
pkg_size package buffer size
info buffer for response
size response buffer size
type type of information requested
Returns
• (0) if successful.
• (-ENOTSUP) if information type not supported by the profile.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_get_ddp_list(uint16_tport,uint8_t*buff,uint32_tsize)
rte_pmd_i40e_get_ddp_list - Get loaded profile list
Parametersport port id
buff buffer for response
size buffer size
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
intrte_pmd_i40e_ptype_mapping_update(uint16_tport,structrte_pmd_i40e_ptype_mapping*mapping_items,uint16_tcount,uint8_texclusive)
Update hardware defined ptype to software defined packet type mapping table.
Parametersport pointer to port identifier of the device.
mapping_items the base address of the mapping items array.
count number of mapping items.
exclusive the flag indicate different ptype mapping update method. -(0) only overwrite referred PTYPE
mapping, keep other PTYPEs mapping unchanged. -(!0) overwrite referred PTYPE mapping, set other
PTYPEs maps to PTYPE_UNKNOWN.
intrte_pmd_i40e_ptype_mapping_reset(uint16_tport)
Reset hardware defined ptype to software defined ptype mapping table to default.
Parametersport pointer to port identifier of the device
intrte_pmd_i40e_ptype_mapping_get(uint16_tport,structrte_pmd_i40e_ptype_mapping*mapping_items,uint16_tsize,uint16_t*count,uint8_tvalid_only)
Get hardware defined ptype to software defined ptype mapping items.
Parametersport pointer to port identifier of the device.
mapping_items the base address of the array to store returned items.
size the size of the input array.
count the place to store the number of returned items.
valid_only -(0) return full mapping table. -(!0) only return mapping items which packet_type !=
RTE_PTYPE_UNKNOWN.
intrte_pmd_i40e_ptype_mapping_replace(uint16_tport,uint32_ttarget,uint8_tmask,uint32_tpkt_type)
Replace a specific or a group of software defined ptypes with a new one
Parametersport pointer to port identifier of the device
target the packet type to be replaced
mask -(0) target represent a specific software defined ptype. -(!0) target is a mask to represent a
group of software defined ptypes.
pkt_type the new packet type to overwrite
intrte_pmd_i40e_add_vf_mac_addr(uint16_tport,uint16_tvf_id,structrte_ether_addr*mac_addr)
Add a VF MAC address.
Add more MAC address for VF. The existing MAC addresses are still effective.
Parametersport The port identifier of the Ethernet device.
vf_id VF id.
mac_addr VF MAC address.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if vf or mac_addr is invalid.
intrte_pmd_i40e_flow_type_mapping_update(uint16_tport,structrte_pmd_i40e_flow_type_mapping*mapping_items,uint16_tcount,uint8_texclusive)
Update hardware defined pctype to software defined flow type mapping table.
Parametersport pointer to port identifier of the device.
mapping_items the base address of the mapping items array.
count number of mapping items.
exclusive the flag indicate different pctype mapping update method. -(0) only overwrite referred
PCTYPE mapping, keep other PCTYPEs mapping unchanged. -(!0) overwrite referred PCTYPE mapping, set
other PCTYPEs maps to PCTYPE_INVALID.
intrte_pmd_i40e_flow_type_mapping_get(uint16_tport,structrte_pmd_i40e_flow_type_mapping*mapping_items)
Get software defined flow type to hardware defined pctype mapping items.
Parametersport pointer to port identifier of the device.
mapping_items the base address of the array to store returned items. array should be allocated by
caller with minimum size of RTE_PMD_I40E_FLOW_TYPE_MAX items
intrte_pmd_i40e_flow_type_mapping_reset(uint16_tport)
Reset hardware defined pctype to software defined flow type mapping table to default.
Parametersport pointer to port identifier of the device
intrte_pmd_i40e_query_vfid_by_mac(uint16_tport,conststructrte_ether_addr*vf_mac)
On the PF, find VF index based on VF MAC address
Parametersport pointer to port identifier of the device
vf_mac the mac address of the vf to determine index of
Returns
The index of vfid If successful. -EINVAL: vf mac address does not exist for this port -ENOTSUP: i40e
not supported for this port.
intrte_pmd_i40e_rss_queue_region_conf(uint16_tport_id,enumrte_pmd_i40e_queue_region_opop_type,void*arg)
Do RSS queue region configuration for that port as the command option type
Parametersport_id The port identifier of the Ethernet device.
op_type Queue region operation type
arg Queue region operation type specific data
intrte_pmd_i40e_inset_get(uint16_tport,uint8_tpctype,structrte_pmd_i40e_inset*inset,enumrte_pmd_i40e_inset_typeinset_type)
Get input set
Parametersport The port identifier of the Ethernet device.
pctype HW pctype.
inset Buffer for input set info.
inset_type Type of input set.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-ENOTSUP) if operation not supported.
intrte_pmd_i40e_inset_set(uint16_tport,uint8_tpctype,structrte_pmd_i40e_inset*inset,enumrte_pmd_i40e_inset_typeinset_type)
Set input set
Parametersport The port identifier of the Ethernet device.
pctype HW pctype.
inset Input set info.
inset_type Type of input set.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.
• (-ENOTSUP) if operation not supported.
staticintrte_pmd_i40e_inset_field_get(uint64_tinset,uint8_tfield_idx)[inline],[static]
Get bit value for some field index
Parametersinset Input set value.
field_idx Field index for input set.
Returns
• (1) if set.
• (0) if cleared.
Definition at line 1006 of file rte_pmd_i40e.h.
staticintrte_pmd_i40e_inset_field_set(uint64_t*inset,uint8_tfield_idx)[inline],[static]
Set bit value for some field index
Parametersinset Input set value.
field_idx Field index for input set.
Returns
• (-1) if failed.
• (0) if success.
Definition at line 1032 of file rte_pmd_i40e.h.
staticintrte_pmd_i40e_inset_field_clear(uint64_t*inset,uint8_tfield_idx)[inline],[static]
Clear bit value for some field index
Parametersinset Input set value.
field_idx Field index for input set.
Returns
• (-1) if failed.
• (0) if success.
Definition at line 1057 of file rte_pmd_i40e.h.
__rte_experimentalintrte_pmd_i40e_get_fdir_info(uint16_tport,structrte_eth_fdir_info*fdir_info)
Get port fdir info
Parametersport The port identifier of the Ethernet device.
fdir_info The fdir info of the port
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-ENOTSUP) if operation not supported.
__rte_experimentalintrte_pmd_i40e_get_fdir_stats(uint16_tport,structrte_eth_fdir_stats*fdir_stat)
Get port fdir status
Parametersport The port identifier of the Ethernet device.
fdir_stat The fdir status of the port
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-ENOTSUP) if operation not supported.
__rte_experimentalintrte_pmd_i40e_set_gre_key_len(uint16_tport,uint8_tlen)
Set GRE key length
Parametersport The port identifier of the Ethernet device.
len Length of gre-key
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-ENOTSUP) if operation not supported.
__rte_experimentalintrte_pmd_i40e_set_switch_dev(uint16_tport_id,structrte_eth_dev*switch_dev)
For ipn3ke, i40e works with FPGA. In this situation, i40e get link status from fpga, fpga works as
switch_dev for i40e. This function set switch_dev for i40e.
Parametersport_id port_id of i40e device to be set switch device.
switch_dev target switch device from which i40e device to get link status from.
Returns
• (less than 0) if failed.
• (0) if success.
__rte_experimentalintrte_pmd_i40e_set_pf_src_prune(uint16_tport,uint8_ton)
Enable/Disable source prune on all the PF.
Parametersport The port identifier of the Ethernet device.
on 1 - Enable source prune. 0 - Disable source prune.
Returns
• (0) if successful.
• (-ENODEV) if port invalid.
• (-EINVAL) if bad parameter.