rte_reorder.h(3)

πŸ’– rte_reorder.h πŸ’–

okay bestie, welcome to the group chat where we talk about DPDK's reorder library header β€” that's rte_reorder.h, from Library Functions Manual (section 3, the library-functions corner of the man universe, iykyk 🫢). Grab a πŸ“ and let's get into it, because this thing is lowkey iconic.


✨ NAME ✨

rte_reorder.h β€” the header for the RTE reorder library, bestie. It's the whole vibe of putting your out-of-order packets back in line. πŸ’…

🌈 SYNOPSIS 🌈

#include <rte_common.h>
#include <rte_compat.h>
#include <rte_mbuf.h>
#include <rte_mbuf_dyn.h>

🧚 Functions 🧚

  • static __rte_experimental rte_reorder_seqn_t * rte_reorder_seqn (struct rte_mbuf *mbuf) β€” reads the reorder sequence number straight off an mbuf.
  • void rte_reorder_free (struct rte_reorder_buffer *b) β€” yeets a reorder buffer instance into the void.
  • struct rte_reorder_buffer * rte_reorder_create (const char *name, unsigned int socket_id, unsigned int size) __rte_malloc __rte_dealloc(rte_reorder_free β€” makes a brand-new reorder buffer instance.
  • struct rte_reorder_buffer struct rte_reorder_buffer * rte_reorder_init (struct rte_reorder_buffer *b, unsigned int bufsize, const char *name, unsigned int size) β€” initializes a reorder buffer instance you already brought with you.
  • struct rte_reorder_buffer * rte_reorder_find_existing (const char *name) β€” hunts down a reorder buffer instance that already exists.
  • void rte_reorder_reset (struct rte_reorder_buffer *b) β€” resets a reorder buffer instance back to its initial values.
  • int rte_reorder_insert (struct rte_reorder_buffer *b, struct rte_mbuf *mbuf) β€” slides an mbuf into its correct spot in the buffer.
  • unsigned int rte_reorder_drain (struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, unsigned max_mbufs) β€” pulls the reordered buffers back out.
  • __rte_experimental unsigned int rte_reorder_drain_up_to_seqn (struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, unsigned int max_mbufs, rte_reorder_seqn_t seqn) β€” drains everything up to a given sequence number, exclusive bestie.
  • __rte_experimental unsigned int rte_reorder_min_seqn_set (struct rte_reorder_buffer *b, rte_reorder_seqn_t min_seqn) β€” sets the minimum sequence number that's allowed to be buffered.
  • __rte_experimental unsigned int rte_reorder_memory_footprint_get (unsigned int size) β€” tells you how much memory a buffer of size elements is gonna eat.

πŸ‘‘ Detailed Description πŸ‘‘

RTE reorder. πŸŽ€

The reorder library is a component which is designed to provide ordering of out of ordered packets based on sequence number present in mbuf.

Definition in file rte_reorder.h.


πŸ“š Function Documentation πŸ“š

πŸ’« __rte_experimental rte_reorder_seqn_t * rte_reorder_seqn (struct rte_mbuf *mbuf) [inline], [static]

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

Read reorder sequence number from mbuf.

Parameters

  • mbuf β€” Structure to read from.

Returns

pointer to reorder sequence number.

Definition at line 42 of file rte_reorder.h.


πŸ’« void rte_reorder_free (struct rte_reorder_buffer *b)

Free reorder buffer instance.

Parameters

  • b β€” Pointer to reorder buffer instance. If b is NULL, no operation is performed.

πŸ’« struct rte_reorder_buffer * rte_reorder_create (const char *name, unsigned int socket_id, unsigned int size)

Create a new reorder buffer instance

Allocate memory and initialize a new reorder buffer in that memory, returning the reorder buffer pointer to the user

Parameters

  • name β€” The name to be given to the reorder buffer instance.
  • socket_id β€” The NUMA node on which the memory for the reorder buffer instance is to be reserved.
  • size β€” Max number of elements that can be stored in the reorder buffer

Returns

The initialized reorder buffer instance, or NULL on error. On error case, rte_errno will be set appropriately:

  • ENOMEM - no appropriate memory area found in which to create memzone
  • EINVAL - invalid parameters

πŸ’« struct rte_reorder_buffer struct rte_reorder_buffer * rte_reorder_init (struct rte_reorder_buffer *b, unsigned int bufsize, const char *name, unsigned int size)

Initializes given reorder buffer instance

Parameters

  • b β€” Reorder buffer instance to initialize
  • bufsize β€” Size of the reorder buffer
  • name β€” The name to be given to the reorder buffer
  • size β€” Number of elements that can be stored in reorder buffer

Returns

The initialized reorder buffer instance, or NULL on error. On error case, rte_errno will be set appropriately:

  • EINVAL - invalid parameters
  • ENOMEM - not enough memory to register dynamic field

πŸ’« struct rte_reorder_buffer * rte_reorder_find_existing (const char *name)

Find an existing reorder buffer instance and return a pointer to it.

Parameters

  • name β€” Name of the reorder buffer instance as passed to rte_reorder_create()

Returns

Pointer to reorder buffer instance or NULL if object not found with rte_errno set appropriately. Possible rte_errno values include:

  • ENOENT - required entry not available to return. reorder instance list

πŸ’« void rte_reorder_reset (struct rte_reorder_buffer *b)

Reset the given reorder buffer instance with initial values.

Parameters

  • b β€” Reorder buffer instance which has to be reset

πŸ’« int rte_reorder_insert (struct rte_reorder_buffer *b, struct rte_mbuf *mbuf)

Insert given mbuf in reorder buffer in its correct position

The given mbuf is to be reordered relative to other mbufs in the system. The mbuf must contain a sequence number which is then used to place the buffer in the correct position in the reorder buffer. Reordered packets can later be taken from the buffer using the rte_reorder_drain() API.

Parameters

  • b β€” Reorder buffer where the mbuf has to be inserted.
  • mbuf β€” mbuf of packet that needs to be inserted in reorder buffer.

Returns

0 on success, -1 on error. On error case, rte_errno will be set appropriately:

  • ENOSPC - Cannot move existing mbufs from reorder buffer to accommodate early mbuf, but it can be accommodated by performing drain and then insert.
  • ERANGE - Too early or late mbuf which is vastly out of range of expected window should be ignored without any handling.

πŸ’« unsigned int rte_reorder_drain (struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, unsigned max_mbufs)

Fetch reordered buffers

Returns a set of in-order buffers from the reorder buffer structure. Gaps may be present in the sequence numbers of the mbuf if packets have been delayed too long before reaching the reorder window, or have been previously dropped by the system.

Parameters

  • b β€” Reorder buffer instance from which packets are to be drained
  • mbufs β€” array of mbufs where reordered packets will be inserted from reorder buffer
  • max_mbufs β€” the number of elements in the mbufs array.

Returns

number of mbuf pointers written to mbufs. 0 <= N < max_mbufs.


πŸ’« __rte_experimental unsigned int rte_reorder_drain_up_to_seqn (struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, unsigned int max_mbufs, rte_reorder_seqn_t seqn)

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

Fetch set of reordered packets up to specified sequence number (exclusive).

Returns a set of in-order packets from the reorder buffer structure. Gaps may be present since reorder buffer will try to fetch all possible packets up to given sequence number.

Parameters

  • b β€” Reorder buffer instance from which packets are to be drained.
  • mbufs β€” Array of mbufs where reordered packets will be inserted from reorder buffer.
  • max_mbufs β€” The number of elements in the mbuf array.
  • seqn β€” Sequence number up to which buffer will be drained.

Returns

Number of mbuf pointers written to mbufs. 0 <= N < max_mbufs.


πŸ’« __rte_experimental unsigned int rte_reorder_min_seqn_set (struct rte_reorder_buffer *b, rte_reorder_seqn_t min_seqn)

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

Set minimum sequence number of packet allowed to be buffered. To successfully set new value, reorder buffer has to be empty (after create, reset or drain_all).

Parameters

  • b β€” Empty reorder buffer instance to modify.
  • min_seqn β€” New sequence number to set.

Returns

0 on success, a negative value otherwise.


πŸ’« __rte_experimental unsigned int rte_reorder_memory_footprint_get (unsigned int size)

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

Determine the amount of memory needed by the reorder buffer to accommodate a given number of elements.

See also

rte_reorder_init()

Parameters

  • size β€” Number of elements that can be stored in reorder buffer.

Returns

Reorder buffer footprint measured in bytes.


🌟 Author 🌟

Generated automatically by Doxygen for DPDK from the source code.


and that's the whole page, bestie β€” no notes, no cap, every single option and error code kept exactly where it was. this one came straight from DPDK, Version 25.11.3, and yes it's a section 3 page so rte_reorder.h(3) through and through. run it, love it, drain it, slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from