rte_pmd_i40e.h(3)

Okay so bestie, we're reading rte_pmd_i40e.h(3) β€” buckle up, it's straight out of the Library Functions Manual ✨ and it's the whole header for the i40e PMD-specific API. It's long fr, so we're doing this in parts. Part 1, let's go πŸ’…

🌸 NAME 🌸

rte_pmd_i40e.h β€” the header where literally all the i40e PMD-specific functions live πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

#include <rte_compat.h>
#include <rte_ethdev.h>
#include <rte_ether.h>

πŸ¦‹ Data Structures πŸ¦‹

So many structs, and they're all giving main character energy:

  • struct rte_pmd_i40e_mb_event_param
  • struct rte_pmd_i40e_ddp_version
  • struct rte_pmd_i40e_ddp_device_id
  • struct rte_pmd_i40e_profile_info
  • struct rte_pmd_i40e_profile_list
  • struct rte_pmd_i40e_proto_info
  • struct rte_pmd_i40e_ptype_info
  • struct rte_pmd_i40e_queue_region_conf
  • struct rte_pmd_i40e_pkt_template_action
  • struct rte_pmd_i40e_pkt_template_input
  • struct rte_pmd_i40e_pkt_template_conf

⭐ Macros ⭐

One (1) macro, and she's iconic:

#define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK   0x80000000

πŸ‘‘ Enumerations πŸ‘‘

  • enum rte_pmd_i40e_mb_event_rsp { RTE_PMD_I40E_MB_EVENT_NOOP_ACK, RTE_PMD_I40E_MB_EVENT_NOOP_NACK, RTE_PMD_I40E_MB_EVENT_PROCEED, RTE_PMD_I40E_MB_EVENT_MAX }
  • enum rte_pmd_i40e_package_op { }
  • enum rte_pmd_i40e_package_info
  • enum rte_pmd_i40e_queue_region_op { }
  • enum rte_pmd_i40e_pkt_template_behavior
  • enum rte_pmd_i40e_pkt_template_status { RTE_PMD_I40E_PKT_TEMPLATE_NO_REPORT_STATUS, RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID, RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4, RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8 }

πŸ’œ Functions πŸ’œ

A whole personality of prototypes, verbatim, no cap:

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_ping_vfs (uint16_t port, uint16_t vf)
int rte_pmd_i40e_set_vf_mac_anti_spoof (uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_set_vf_vlan_anti_spoof (uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_set_tx_loopback (uint16_t port, uint8_t on)
int rte_pmd_i40e_set_vf_unicast_promisc (uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_set_vf_multicast_promisc (uint16_t port, uint16_t vf_id, uint8_t on)
int rte_pmd_i40e_set_vf_mac_addr (uint16_t port, uint16_t vf_id, struct rte_ether_addr *mac_addr)
int rte_pmd_i40e_remove_vf_mac_addr (uint16_t port, uint16_t vf_id, struct rte_ether_addr *mac_addr)
int rte_pmd_i40e_set_vf_vlan_stripq (uint16_t port, uint16_t vf, uint8_t on)
int rte_pmd_i40e_set_vf_vlan_insert (uint16_t port, uint16_t vf_id, uint16_t vlan_id)
int rte_pmd_i40e_set_vf_broadcast (uint16_t port, uint16_t vf_id, 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_set_vf_vlan_filter (uint16_t port, uint16_t vlan_id, uint64_t vf_mask, 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_reset_vf_stats (uint16_t port, uint16_t vf_id)
int rte_pmd_i40e_set_vf_max_bw (uint16_t port, uint16_t vf_id, uint32_t bw)
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_set_vf_tc_max_bw (uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw)
int rte_pmd_i40e_set_tc_strict_prio (uint16_t port, uint8_t tc_map)
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_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_get_ddp_list (uint16_t port, uint8_t *buff, uint32_t size)
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_ptype_mapping_reset (uint16_t port)
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)
int rte_pmd_i40e_ptype_mapping_replace (uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type)
int rte_pmd_i40e_add_vf_mac_addr (uint16_t port, uint16_t vf_id, struct rte_ether_addr *mac_addr)
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)
int rte_pmd_i40e_flow_type_mapping_get (uint16_t port, struct rte_pmd_i40e_flow_type_mapping *mapping_items)
int rte_pmd_i40e_flow_type_mapping_reset (uint16_t port)
int rte_pmd_i40e_query_vfid_by_mac (uint16_t port, const struct rte_ether_addr *vf_mac)
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_inset_get (uint16_t port, uint8_t pctype, struct rte_pmd_i40e_inset *inset, enum rte_pmd_i40e_inset_type inset_type)
int rte_pmd_i40e_inset_set (uint16_t port, uint8_t pctype, struct rte_pmd_i40e_inset *inset, enum rte_pmd_i40e_inset_type inset_type)
static int rte_pmd_i40e_inset_field_get (uint64_t inset, uint8_t field_idx)
static int rte_pmd_i40e_inset_field_set (uint64_t *inset, uint8_t field_idx)
static int rte_pmd_i40e_inset_field_clear (uint64_t *inset, uint8_t field_idx)
__rte_experimental int rte_pmd_i40e_get_fdir_info (uint16_t port, struct rte_eth_fdir_info *fdir_info)
__rte_experimental int rte_pmd_i40e_get_fdir_stats (uint16_t port, struct rte_eth_fdir_stats *fdir_stat)
__rte_experimental int rte_pmd_i40e_set_gre_key_len (uint16_t port, uint8_t len)
__rte_experimental int rte_pmd_i40e_set_switch_dev (uint16_t port_id, struct rte_eth_dev *switch_dev)
__rte_experimental int rte_pmd_i40e_set_pf_src_prune (uint16_t port, uint8_t on)

πŸ“– Detailed Description πŸ“–

i40e PMD specific functions. That's the whole vibe 🌸

⚠️ EXPERIMENTAL: this API may change, or be removed, without prior notice. Bestie. It can literally ghost you. Do not build your whole life on it ok 😭

Definition in file rte_pmd_i40e.h.

🌈 Macro Definition Documentation 🌈

#define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK 0x80000000

So the ptype mapping table only accepts RTE_PTYPE_XXX or "user defined" ptype. Any ptype with the MSB set gets treated as a user defined ptype, and this macro right here is the girl who helps you create one πŸ’…

Definition at line 176 of file rte_pmd_i40e.h.

πŸ”₯ Enumeration Type Documentation πŸ”₯

enum rte_pmd_i40e_mb_event_rsp

The response sent back to the i40e driver from the user app after the callback. She answers the phone πŸ“ž

Enumerator

  • RTE_PMD_I40E_MB_EVENT_NOOP_ACK β€” skip mbox request and ACK
  • RTE_PMD_I40E_MB_EVENT_NOOP_NACK β€” skip mbox request and NACK
  • RTE_PMD_I40E_MB_EVENT_PROCEED β€” proceed with mbox request
  • RTE_PMD_I40E_MB_EVENT_MAX β€” max value of this enum

Definition at line 28 of file rte_pmd_i40e.h.

enum rte_pmd_i40e_package_op

Option of package processing. Choose your fighter ✨

Enumerator

  • RTE_PMD_I40E_PKG_OP_WR_ADD β€” load package and add to info list
  • RTE_PMD_I40E_PKG_OP_WR_DEL β€” load package and delete from info list
  • RTE_PMD_I40E_PKG_OP_WR_ONLY β€” load package without modifying info list

Definition at line 49 of file rte_pmd_i40e.h.

enum rte_pmd_i40e_package_info

Types of package information. That's the tea 🍡

Definition at line 60 of file rte_pmd_i40e.h.

enum rte_pmd_i40e_queue_region_op

Option types of queue region. Pick your op, queen πŸ‘‘

Enumerator

  • RTE_PMD_I40E_RSS_QUEUE_REGION_SET β€” add queue region set
  • RTE_PMD_I40E_RSS_QUEUE_REGION_FLOWTYPE_SET β€” add PF region pctype set
  • RTE_PMD_I40E_RSS_QUEUE_REGION_USER_PRIORITY_SET β€” add queue region user priority set
  • RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_ON β€” ALL configuration about queue region from up layer at first will only keep in DPDK software stored in driver, only after "FLUSH_ON", it commit all configuration to HW. Because PMD had to set hardware configuration at a time, so it will record all up layer command at first.
  • RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_OFF β€” "FLUSH_OFF " is just clean all configuration about queue region just now, and restore all to DPDK i40e driver default config when start up.

Definition at line 81 of file rte_pmd_i40e.h.

enum rte_pmd_i40e_pkt_template_behavior

Behavior will be taken if raw packet template is matched. Like, what are we doing about it bestie πŸ€”

Definition at line 234 of file rte_pmd_i40e.h.

enum rte_pmd_i40e_pkt_template_status

Flow director report status. It defines what will be reported if raw packet template is matched. Snitching level: selectable 🫢

Enumerator

  • RTE_PMD_I40E_PKT_TEMPLATE_NO_REPORT_STATUS β€” report nothing
  • RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID β€” only report FD ID
  • RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID_FLEX_4 β€” report FD ID and 4 flex bytes
  • RTE_PMD_I40E_PKT_TEMPLATE_REPORT_FLEX_8 β€” report 8 flex bytes

Definition at line 244 of file rte_pmd_i40e.h.


πŸ’– Function Documentation πŸ’–

int rte_pmd_i40e_flow_add_del_packet_template (uint16_t port, const struct rte_pmd_i40e_pkt_template_conf * conf, uint8_t add)

Add or remove raw packet template filter to Flow Director. Adding AND removing in one function, she's versatile ✨

Parameters

  • port β€” 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.

int rte_pmd_i40e_ping_vfs (uint16_t port, uint16_t vf)

Notify VF when PF link status changes. Just a lil ping, a lil heads up πŸ“£

Parameters

  • port β€” the port identifier of the Ethernet device.
  • vf β€” VF id.

Returns

  • (0) if successful.
  • (-ENODEV) if port invalid.
  • (-EINVAL) if vf invalid.

int rte_pmd_i40e_set_vf_mac_anti_spoof (uint16_t port, uint16_t vf_id, uint8_t on)

Enable/Disable VF MAC anti spoofing. Protecting the MAC from fakes πŸ’…

Parameters

  • port β€” 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.

int rte_pmd_i40e_set_vf_vlan_anti_spoof (uint16_t port, uint16_t vf_id, uint8_t on)

Enable/Disable VF VLAN anti spoofing. Same energy, different tag 🏷️

Parameters

  • port β€” 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.

int rte_pmd_i40e_set_tx_loopback (uint16_t port, uint8_t on)

Enable/Disable TX loopback on all the PF and VFs. Everyone gets the loopback, no one is left out πŸŒ€

Parameters

  • port β€” the port identifier of the Ethernet device.
  • on β€” 1 - Enable TX loopback. 0 - Disable TX loopback.

Returns

  • (0) if successful.
  • (-ENODEV) if port invalid.

int rte_pmd_i40e_set_vf_unicast_promisc (uint16_t port, uint16_t vf_id, uint8_t on)

int rte_pmd_i40e_set_vf_unicast_promisc (uint16_t port, uint16_t vf_id,
    uint8_t on)

okay bestie, this one flips VF unicast promiscuous mode on or off πŸ’…

Parameters

  • port β€” the port identifier of the Ethernet device πŸŽ€
  • vf_id β€” the VF on which to set it
  • on β€” 1 means Enable, 0 means Disable

Returns

  • (0) if it slayed (successful) ✨
  • (-ENODEV) if the port is invalid 😭
  • (-EINVAL) if the parameter is bad

int rte_pmd_i40e_set_vf_multicast_promisc (uint16_t port, uint16_t vf_id, uint8_t on)

int rte_pmd_i40e_set_vf_multicast_promisc (uint16_t port, uint16_t vf_id,
    uint8_t on)

same energy as above but for multicast promiscuous mode, no cap πŸ’œ

Parameters

  • port β€” the port identifier of the Ethernet device πŸ¦‹
  • vf_id β€” the VF on which to set it
  • on β€” 1 means Enable, 0 means Disable

Returns

  • (0) if successful 🌸
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad

int rte_pmd_i40e_set_vf_mac_addr (uint16_t port, uint16_t vf_id, struct rte_ether_addr * mac_addr)

int rte_pmd_i40e_set_vf_mac_addr (uint16_t port, uint16_t vf_id, struct
    rte_ether_addr * mac_addr)

set the VF's MAC address, periodt πŸ’…

fr fr, the PF should set the MAC address before the VF is initialized. If the PF sets the MAC address after the VF is already initialized, the new MAC address won't be effective until the VF gets reinitialized. not me learning this the hard way 😭

also heads up: this will remove all existing MAC filters. so like... be aware πŸ‘‘

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf_id β€” VF id πŸŽ€
  • mac_addr β€” VF MAC address

Returns

  • (0) if successful ✨
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if vf or mac_addr is invalid 😭

int rte_pmd_i40e_remove_vf_mac_addr (uint16_t port, uint16_t vf_id, struct rte_ether_addr * mac_addr)

int rte_pmd_i40e_remove_vf_mac_addr (uint16_t port, uint16_t vf_id, struct
    rte_ether_addr * mac_addr)

remove the VF MAC address πŸ’€ the reverse of the lil glow-up above

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf_id β€” VF id
  • mac_addr β€” VF MAC address

Returns

  • (0) if successful 🌈
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if vf or mac_addr is invalid

int rte_pmd_i40e_set_vf_vlan_stripq (uint16_t port, uint16_t vf, uint8_t on)

int rte_pmd_i40e_set_vf_vlan_stripq (uint16_t port, uint16_t vf, uint8_t on)

Enable/Disable vf vlan strip for all queues in a pool ✨

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf β€” ID specifying VF
  • on β€” 1 means Enable VF's vlan strip on RX queues. 0 means Disable VF's vlan strip on RX queues πŸ’…

Returns

  • (0) if successful 🫢
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad

int rte_pmd_i40e_set_vf_vlan_insert (uint16_t port, uint16_t vf_id, uint16_t vlan_id)

int rte_pmd_i40e_set_vf_vlan_insert (uint16_t port, uint16_t vf_id, uint16_t
    vlan_id)

Enable/Disable vf vlan insert πŸŽ€

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf_id β€” ID specifying VF
  • vlan_id β€” 0 means Disable VF's vlan insert. n means Enable; n is inserted as the vlan id 🌸

Returns

  • (0) if successful
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad

int rte_pmd_i40e_set_vf_broadcast (uint16_t port, uint16_t vf_id, uint8_t on)

int rte_pmd_i40e_set_vf_broadcast (uint16_t port, uint16_t vf_id, uint8_t
    on)

Enable/Disable vf broadcast mode πŸ“’ iconic lil toggle

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf_id β€” ID specifying VF
  • on β€” 0 means Disable broadcast. 1 means Enable broadcast πŸ¦‹

Returns

  • (0) if successful ✨
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad

int rte_pmd_i40e_set_vf_vlan_tag (uint16_t port, uint16_t vf_id, uint8_t on)

int rte_pmd_i40e_set_vf_vlan_tag (uint16_t port, uint16_t vf_id, uint8_t on)

Enable/Disable vf vlan tag πŸ’œ

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf_id β€” ID specifying VF
  • on β€” 0 means Disable VF's vlan tag. n means Enable VF's vlan tag πŸ‘‘

Returns

  • (0) if successful
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad

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_vlan_filter (uint16_t port, uint16_t vlan_id,
    uint64_t vf_mask, uint8_t on)

Enable/Disable VF VLAN filter 🌈

Parameters

  • port β€” the port identifier of the Ethernet device
  • vlan_id β€” ID specifying VLAN
  • vf_mask β€” Mask to filter VF's
  • on β€” 0 means Disable VF's VLAN filter. 1 means Enable VF's VLAN filter πŸ’…

Returns

  • (0) if successful πŸŽ€
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad
  • (-ENOTSUP) not supported by firmware 😭

int rte_pmd_i40e_get_vf_stats (uint16_t port, uint16_t vf_id, struct rte_eth_stats * stats)

int rte_pmd_i40e_get_vf_stats (uint16_t port, uint16_t vf_id, struct
    rte_eth_stats * stats)

get the VF's statistics, the receipts bestie πŸ“Š

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf_id β€” VF on which to get
  • stats β€” a pointer to a structure of type rte_eth_stats to be filled with the values of device counters for this exact set of statistics ✨
    • 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 the port is invalid
  • (-EINVAL) if the parameter is bad

int rte_pmd_i40e_reset_vf_stats (uint16_t port, uint16_t vf_id)

int rte_pmd_i40e_reset_vf_stats (uint16_t port, uint16_t vf_id)

Clear the VF's statistics πŸ§ΉπŸ’…

Parameters

  • port β€” the port identifier of the Ethernet device
  • vf_id β€” VF on which to get

Returns

  • (0) if successful 🌸
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad

int rte_pmd_i40e_set_vf_max_bw (uint16_t port, uint16_t vf_id, uint32_t bw)

int rte_pmd_i40e_set_vf_max_bw (uint16_t port, uint16_t vf_id, uint32_t bw)

set the VF's max bandwidth, like a vibe check on how much it's allowed to eat πŸ”₯

⚠️ 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. so like, they're mutually exclusive bestie, pick a lane πŸ’€

Parameters

  • port β€” 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. It does not count the bytes added by the physical layer πŸ‘‘

Returns

  • (0) if successful ✨
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad
  • (-ENOTSUP) not supported by firmware 😭

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_set_vf_tc_bw_alloc (uint16_t port, uint16_t vf_id, uint8_t
    tc_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. You can take it as the relative min bandwidth setting 🌈

Parameters

  • port β€” 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 the port is invalid
  • (-EINVAL) if the parameter is bad
  • (-ENOTSUP) not supported by firmware

int rte_pmd_i40e_set_vf_tc_max_bw (uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw)

int rte_pmd_i40e_set_vf_tc_max_bw (uint16_t port, uint16_t vf_id, uint8_t
    tc_no, uint32_t bw)

set a specific TC's max bandwidth on a specific VF ✨

Parameters

  • port β€” 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. It does not count the bytes added by the physical layer πŸ’œ

Returns

  • (0) if successful πŸ¦‹
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad
  • (-ENOTSUP) not supported by firmware

int rte_pmd_i40e_set_tc_strict_prio (uint16_t port, uint8_t tc_map)

int rte_pmd_i40e_set_tc_strict_prio (uint16_t port, uint8_t tc_map)

set some TCs to strict priority mode on a physical port, main character energy only πŸ‘‘πŸ’…

Parameters

  • port β€” the port identifier of the Ethernet device
  • tc_map β€” A bit map for the TCs πŸŽ€

Returns

  • (0) if successful
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad
  • (-ENOTSUP) not supported by firmware

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_process_ddp_package (uint16_t port, uint8_t * buff,
    uint32_t size, enum rte_pmd_i40e_package_op op)

Load/Unload a ddp package πŸ“¦βœ¨

Parameters

  • port β€” 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 the port is invalid
  • (-EINVAL) if the parameter is bad
  • (-EEXIST) if profile exists
  • (-EACCES) if profile does not exist
  • (-ENOTSUP) if operation not supported 😭

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_get_ddp_info (uint8_t * pkg, uint32_t pkg_size, uint8_t *
    info, uint32_t size, enum rte_pmd_i40e_package_info type)

rte_pmd_i40e_get_ddp_info β€” Get profile's info πŸ”πŸ’…

Parameters

  • pkg β€” 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 the parameter is bad

int rte_pmd_i40e_get_ddp_list (uint16_t port, uint8_t * buff, uint32_t size)

int rte_pmd_i40e_get_ddp_list (uint16_t port, uint8_t * buff, uint32_t size)

rte_pmd_i40e_get_ddp_list β€” Get loaded profile list πŸ“‹πŸŽ€

Parameters

  • port β€” port id
  • buff β€” buffer for response
  • size β€” buffer size

Returns

  • (0) if successful 🫢
  • (-ENODEV) if the port is invalid
  • (-EINVAL) if the parameter is bad

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_ptype_mapping_update (uint16_t port, struct
    rte_pmd_i40e_ptype_mapping * mapping_items, uint16_t count, uint8_t
    exclusive)

update the hardware-defined ptype β†’ software-defined packet type mapping table πŸ”βœ¨

Parameters

  • port β€” 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 indicating the different ptype mapping update method πŸ’…
    • -(0) only overwrite the referred PTYPE mapping, keep other PTYPEs mapping unchanged
    • -(!0) overwrite the referred PTYPE mapping, set other PTYPEs maps to PTYPE_UNKNOWN

int rte_pmd_i40e_ptype_mapping_reset (uint16_t port)

int rte_pmd_i40e_ptype_mapping_reset (uint16_t port)

reset the hardware-defined ptype β†’ software-defined ptype mapping table back to default 🧹🌈

Parameters

  • port β€” pointer to port identifier of the device

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)

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)

get the hardware-defined ptype β†’ software-defined ptype mapping items πŸŽ€πŸ”

Parameters

  • port β€” 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

int rte_pmd_i40e_ptype_mapping_replace (uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type)

int rte_pmd_i40e_ptype_mapping_replace (uint16_t port, uint32_t target,
    uint8_t mask, uint32_t pkt_type)

replace a specific β€” or a whole lil group of β€” software-defined ptypes with a new one πŸ”πŸ‘‘

…and the params for that one 🫢:

  • port β€” 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

🌸 rte_pmd_i40e_add_vf_mac_addr

int rte_pmd_i40e_add_vf_mac_addr (uint16_t port, uint16_t vf_id, struct rte_ether_addr * mac_addr)

Okay so this one adds a VF MAC address πŸ’… β€” and like, you can add more MAC addresses for a VF, not just one. The existing MAC addresses stay effective, they're not getting replaced or anything. Everyone stays on the guest list πŸŽ€.

Parameters

  • port β€” 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.

πŸ¦‹ rte_pmd_i40e_flow_type_mapping_update

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)

Update the hardware defined pctype β†’ software defined flow type mapping table ✨ this is the glow-up for your mapping table, no cap.

Parameters

  • port β€” 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.

🌈 rte_pmd_i40e_flow_type_mapping_get

int rte_pmd_i40e_flow_type_mapping_get (uint16_t port, struct rte_pmd_i40e_flow_type_mapping * mapping_items)

Get the software defined flow type β†’ hardware defined pctype mapping items πŸ‘‘ it's giving "read back what you wrote".

Parameters

  • port β€” 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
bestie. allocate the array yourself first. minimum RTE_PMD_I40E_FLOW_TYPE_MAX items. don't show up empty-handed πŸ’€

πŸŽ€ rte_pmd_i40e_flow_type_mapping_reset

int rte_pmd_i40e_flow_type_mapping_reset (uint16_t port)

Reset the hardware defined pctype β†’ software defined flow type mapping table back to default 🌸 the "never mind, factory settings" button.

Parameters

  • port β€” pointer to port identifier of the device

✨ rte_pmd_i40e_query_vfid_by_mac

int rte_pmd_i40e_query_vfid_by_mac (uint16_t port, const struct rte_ether_addr * vf_mac)

On the PF, find the VF index based on the VF MAC address πŸ” you bring me a MAC, I give you the index. iykyk.

Parameters

  • port β€” 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.


πŸ’œ rte_pmd_i40e_rss_queue_region_conf

int rte_pmd_i40e_rss_queue_region_conf (uint16_t port_id, enum rte_pmd_i40e_queue_region_op op_type, void * arg)

Do RSS queue region configuration for that port as the command option type 🎯

Parameters

  • port_id β€” The port identifier of the Ethernet device.
  • op_type β€” Queue region operation type
  • arg β€” Queue region operation type specific data

🧚 rte_pmd_i40e_inset_get

int rte_pmd_i40e_inset_get (uint16_t port, uint8_t pctype, struct rte_pmd_i40e_inset * inset, enum rte_pmd_i40e_inset_type inset_type)

Get input set πŸ‘‘

Parameters

  • port β€” 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.

🫢 rte_pmd_i40e_inset_set

int rte_pmd_i40e_inset_set (uint16_t port, uint8_t pctype, struct rte_pmd_i40e_inset * inset, enum rte_pmd_i40e_inset_type inset_type)

Set input set ✨ (yes, the twin of the one above, and their return codes are literally identical β€” slay, consistency).

Parameters

  • port β€” 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.

πŸ’– rte_pmd_i40e_inset_field_get

int rte_pmd_i40e_inset_field_get (uint64_t inset, uint8_t field_idx)

[inline], [static] 🌸 Get bit value for some field index

Parameters

  • inset β€” 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.


πŸ“ rte_pmd_i40e_inset_field_set

int rte_pmd_i40e_inset_field_set (uint64_t * inset, uint8_t field_idx)

[inline], [static] πŸŽ€ Set bit value for some field index

Parameters

  • inset β€” 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.


🌸 rte_pmd_i40e_inset_field_clear

int rte_pmd_i40e_inset_field_clear (uint64_t * inset, uint8_t field_idx)

[inline], [static] πŸ’… Clear bit value for some field index

Parameters

  • inset β€” 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.


heads up bestie, everything from here down is tagged __rte_experimental β€” that's literally in the signature, don't say I didn't warn you ✨

πŸ”₯ rte_pmd_i40e_get_fdir_info

__rte_experimental int rte_pmd_i40e_get_fdir_info (uint16_t port, struct rte_eth_fdir_info * fdir_info)

Get port fdir info πŸ‘‘

Parameters

  • port β€” 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_pmd_i40e_get_fdir_stats

__rte_experimental int rte_pmd_i40e_get_fdir_stats (uint16_t port, struct rte_eth_fdir_stats * fdir_stat)

Get port fdir status πŸ“Š

Parameters

  • port β€” 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_pmd_i40e_set_gre_key_len

__rte_experimental int rte_pmd_i40e_set_gre_key_len (uint16_t port, uint8_t len)

Set GRE key length πŸ’…

Parameters

  • port β€” 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_pmd_i40e_set_switch_dev

__rte_experimental int rte_pmd_i40e_set_switch_dev (uint16_t port_id, struct rte_eth_dev * switch_dev)

okay so this one's a whole lore drop 🫢 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.

Parameters

  • port_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_pmd_i40e_set_pf_src_prune

__rte_experimental int rte_pmd_i40e_set_pf_src_prune (uint16_t port, uint8_t on)

Enable/Disable source prune on all the PF πŸ‘‘

Parameters

  • port β€” 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.

πŸ‘‘ Author

Generated automatically by Doxygen for DPDK from the source code.


and that's a wrap on rte_pmd_i40e.h bestie!! πŸŽ‰πŸ’– this whole page is DPDK, Version 25.11.3, and it's the man page for rte_pmd_i40e.h(3) β€” go forth and configure your i40e NIC like the main character you are 🌟 no cap, fr fr, slay πŸ’…βœ¨

πŸ“¦ where this page comes from