rte_gro.h(3)

✨ NAME ✨

okay so bestie, welcome to rte_gro.h πŸ’– this is the header from the Library Functions Manual, and it's literally the whole interface to the GRO library. GRO = Generic Receive Offload, and yes she's iconic, she's merging your packets, she's doing the most 🫢


🌸 SYNOPSIS 🌸

#include <stdint.h>
#include <rte_mbuf.h>

πŸŽ€ Data Structures

  • struct rte_gro_param

πŸ¦‹ Macros

#define RTE_GRO_MAX_BURST_ITEM_NUM   128U
#define RTE_GRO_TYPE_MAX_NUM   64
#define RTE_GRO_TYPE_SUPPORT_NUM   2
#define RTE_GRO_TCP_IPV4   (1ULL << RTE_GRO_TCP_IPV4_INDEX)
#define RTE_GRO_IPV4_VXLAN_TCP_IPV4   (1ULL <<
    RTE_GRO_IPV4_VXLAN_TCP_IPV4_INDEX)
#define RTE_GRO_UDP_IPV4   (1ULL << RTE_GRO_UDP_IPV4_INDEX)
#define RTE_GRO_IPV4_VXLAN_UDP_IPV4   (1ULL <<
    RTE_GRO_IPV4_VXLAN_UDP_IPV4_INDEX)
#define RTE_GRO_TCP_IPV6   (1ULL << RTE_GRO_TCP_IPV6_INDEX)

πŸ’… Functions

void * rte_gro_ctx_create (const struct rte_gro_param *param)
void rte_gro_ctx_destroy (void *ctx)
uint16_t rte_gro_reassemble_burst (struct rte_mbuf **pkts, uint16_t
    nb_pkts, const struct rte_gro_param *param)
uint16_t rte_gro_reassemble (struct rte_mbuf **pkts, uint16_t nb_pkts,
    void *ctx)
uint16_t rte_gro_timeout_flush (void *ctx, uint64_t timeout_cycles,
    uint64_t gro_types, struct rte_mbuf **out, uint16_t max_nb_out)
uint64_t rte_gro_get_pkt_count (void *ctx)

🌈 Detailed Description

Interface to GRO library πŸ’–

Definition in file rte_gro.h.


πŸ“ Macro Definition Documentation πŸ“

#define RTE_GRO_MAX_BURST_ITEM_NUM 128U

the max number of packets that rte_gro_reassemble_burst() can process in each invocation. that's the ceiling, bestie β€” don't exceed it βœ‹

Definition at line 20 of file rte_gro.h.

#define RTE_GRO_TYPE_MAX_NUM 64

the max number of supported GRO types πŸ’«

Definition at line 24 of file rte_gro.h.

#define RTE_GRO_TYPE_SUPPORT_NUM 2

the number of currently supported GRO types. only 2 rn, and honestly? she's thriving 😌

Definition at line 26 of file rte_gro.h.

#define RTE_GRO_TCP_IPV4 (1ULL << RTE_GRO_TCP_IPV4_INDEX)

TCP/IPv4 GRO flag πŸ”₯

Definition at line 30 of file rte_gro.h.

#define RTE_GRO_IPV4_VXLAN_TCP_IPV4 (1ULL << RTE_GRO_IPV4_VXLAN_TCP_IPV4_INDEX)

VxLAN TCP/IPv4 GRO flag. yes she's tunneling AND offloading, main character energy fr πŸ’…

Definition at line 33 of file rte_gro.h.

#define RTE_GRO_UDP_IPV4 (1ULL << RTE_GRO_UDP_IPV4_INDEX)

UDP/IPv4 GRO flag ✨

Definition at line 36 of file rte_gro.h.

#define RTE_GRO_IPV4_VXLAN_UDP_IPV4 (1ULL << RTE_GRO_IPV4_VXLAN_UDP_IPV4_INDEX)

VxLAN UDP/IPv4 GRO flag. πŸ’œ

Definition at line 39 of file rte_gro.h.

#define RTE_GRO_TCP_IPV6 (1ULL << RTE_GRO_TCP_IPV6_INDEX)

TCP/IPv6 GRO flag. πŸ¦‹

Definition at line 42 of file rte_gro.h.


πŸ‘‘ Function Documentation πŸ‘‘

void * rte_gro_ctx_create (const struct rte_gro_param * param)

⚠️ Warning β€” EXPERIMENTAL: this API may change without prior notice. she's experimental, she's growing, she's evolving 🧚

This function creates a GRO context object, which is used to merge packets in rte_gro_reassemble(). think of it as her little workspace where the packet-merging magic happens πŸ’–

Parameters

  • param β€” applications use it to pass needed parameters to create a GRO context object.

Returns

if created successfully, return a pointer which points to the GRO context object. Otherwise, return NULL. no context, no vibes 😭


void rte_gro_ctx_destroy (void * ctx)

⚠️ Warning β€” EXPERIMENTAL: this API may change without prior notice.

This function destroys a GRO context object. clean up after yourself, bestie, we don't leave mess πŸŽ€

Parameters

  • ctx β€” pointer points to a GRO context object.

uint16_t rte_gro_reassemble_burst (struct rte_mbuf ** pkts, uint16_t nb_pkts, const struct rte_gro_param * param)

This is one of the main reassembly APIs, which merges numbers of packets at a time. It doesn't check if input packets have correct checksums and doesn't re-calculate checksums for merged packets. It assumes the packets are complete (i.e., MF==0 && frag_off==0), when IP fragmentation is possible (i.e., DF==0). The GROed packets are returned as soon as the function finishes. she does not wait, she does not stall, she's serving right away πŸ’…

Parameters

  • pkts β€” Pointer array pointing to the packets to reassemble. Besides, it keeps MBUF addresses for the GROed packets.
  • nb_pkts β€” The number of packets to reassemble
  • param β€” Application-determined parameters for reassembling packets.

Returns

The number of packets after been GROed. If no packets are merged, the return value is equals to nb_pkts. no merges, no drama, same number back 🫢


uint16_t rte_gro_reassemble (struct rte_mbuf ** pkts, uint16_t nb_pkts, void * ctx)

⚠️ Warning β€” EXPERIMENTAL: this API may change without prior notice.

Reassembly function, which tries to merge input packets with the existed packets in the reassembly tables of a given GRO context. It doesn't check if input packets have correct checksums and doesn't re-calculate checksums for merged packets. Additionally, it assumes the packets are complete (i.e., MF==0 && frag_off==0), when IP fragmentation is possible (i.e., DF==0).

If the input packets have invalid parameters (e.g. no data payload, unsupported GRO types), they are returned to applications. Otherwise, they are either merged or inserted into the table. Applications need to flush packets from the tables by flush API, if they want to get the GROed packets. so like β€” she holds onto them until you ask for them back, she's not gonna just hand them over unprompted 😀

Parameters

  • pkts β€” Packets to reassemble. It's also used to store the unprocessed packets.
  • nb_pkts β€” The number of packets to reassemble
  • ctx β€” GRO context object pointer

Returns

The number of unprocessed packets.


uint16_t rte_gro_timeout_flush (void * ctx, uint64_t timeout_cycles, uint64_t gro_types, struct rte_mbuf ** out, uint16_t max_nb_out)

⚠️ Warning β€” EXPERIMENTAL: this API may change without prior notice.

This function flushes the timeout packets from the reassembly tables of desired GRO types. The max number of flushed packets is the element number of 'out'.

Additionally, the flushed packets may have incorrect checksums, since this function doesn't re-calculate checksums for merged packets. 🚨 yes bestie, read that again β€” checksums might be off, she is NOT doing that math for you.

Parameters

  • ctx β€” GRO context object pointer.
  • timeout_cycles β€” The max TTL for packets in reassembly tables, measured in nanosecond.
  • gro_types β€” This function flushes packets whose GRO types are specified by gro_types.
  • out β€” Pointer array used to keep flushed packets.
  • max_nb_out β€” The element number of 'out'. It's also the max number of timeout packets that can be flushed finally.

Returns

The number of flushed packets. 🌊


uint64_t rte_gro_get_pkt_count (void * ctx)

⚠️ Warning β€” EXPERIMENTAL: this API may change without prior notice.

This function returns the number of packets in all reassembly tables of a given GRO context. she's got receipts, she knows exactly how many she's holding πŸ“Š

Parameters

  • ctx β€” GRO context object pointer.

Returns

The number of packets in the tables.


πŸ’œ Author

Generated automatically by Doxygen for DPDK from the source code. so technically a robot wrote this but I rewrote it for you, iykyk 😌✨


okay that's the whole page bestie, no notes, she ate, periodt πŸ’…πŸ‘‘

and like β€” huge shoutout to DPDK, Version 25.11.3, which is where this whole thing comes from 🌈 this manual page for rte_gro.h(3) was served to you fresh, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from