rte_keepalive.h(3)

πŸ’– rte_keepalive.h πŸ’–

okay so bestie, you've wandered into the manual page for rte_keepalive.h β€” it's part of the Library Functions Manual and it's literally the DPDK LCore keepalive monitor. no cap, this header is the whole vibe check for figuring out which cores are alive and which ones ghosted you. 🫢


🌸 NAME 🌸

rte_keepalive.h β€” the header itself, that's the whole name, short and iconic


✨ SYNOPSIS ✨

Pull it in like this, bestie:

#include <rte_config.h>
#include <rte_memory.h>

πŸŽ€ Macros

#define RTE_KEEPALIVE_MAXCORES   RTE_MAX_LCORE

πŸ¦‹ Typedefs

typedef void(* rte_keepalive_failure_callback_t) (void *data, const int
    id_core)

typedef void(* rte_keepalive_relay_callback_t) (void *data, const int
    id_core, enum rte_keepalive_state core_state, uint64_t last_seen)

πŸ’… Functions

struct rte_keepalive * rte_keepalive_create
    (rte_keepalive_failure_callback_t callback, void *data)

void rte_keepalive_dispatch_pings (void *ptr_timer, void *ptr_data)

void rte_keepalive_register_core (struct rte_keepalive *keepcfg, const
    int id_core)

void rte_keepalive_mark_alive (struct rte_keepalive *keepcfg)

void rte_keepalive_mark_sleep (struct rte_keepalive *keepcfg)

void rte_keepalive_register_relay_callback (struct rte_keepalive
    *keepcfg, rte_keepalive_relay_callback_t callback, void *data)

🌈 Detailed Description 🌈

DPDK RTE LCore Keepalive Monitor. that's it, that's the energy. πŸ‘‘

Defined in the file rte_keepalive.h.


πŸ’œ Macro Definition Documentation πŸ’œ

#define RTE_KEEPALIVE_MAXCORES RTE_MAX_LCORE

Number of cores to track. just, like, how many besties we're keeping an eye on. πŸ‘€

Note β€” this must be larger than the highest core id. like, if your highest core id is 15 and you only track 4, that's giving chaos, and it will not slay. ⚠️

Definition at line 24 of file rte_keepalive.h.


🧚 Typedef Documentation 🧚

typedef void(* rte_keepalive_failure_callback_t) (void *data, const int id_core)

Keepalive failure callback. this is the "uh oh, someone's not responding" alarm bell. πŸ””πŸ˜­

It receives a data pointer that you passed into rte_keepalive_create() and the id of the failed core.

Parameters

  • data β€” Data pointer passed to rte_keepalive_create()
  • id_core β€” ID of the core that has failed

Definition at line 45 of file rte_keepalive.h.


typedef void(* rte_keepalive_relay_callback_t) (void *data, const int id_core, enum rte_keepalive_state core_state, uint64_t last_seen)

Keepalive relay callback. ✨

It receives a data pointer passed to rte_keepalive_register_relay_callback(), the id of the core whose state is being forwarded, and the deets on the current core state.

Parameters

  • data β€” Data pointer passed to rte_keepalive_register_relay_callback()
  • id_core β€” ID of the core for which state is being reported
  • core_state β€” The current state of the core
  • last_seen β€” Timestamp of when core was last seen alive

Definition at line 60 of file rte_keepalive.h.


πŸ”₯ Function Documentation πŸ”₯

struct rte_keepalive * rte_keepalive_create (rte_keepalive_failure_callback_t callback, void * data)

Initialise keepalive sub-system. the origin story, fr fr. 🌱

Parameters

  • callback β€” Function called upon detection of a dead core.
  • data β€” Data pointer to be passed to function callback.

Returns

Keepalive structure success, NULL on failure. (yes bestie, it literally returns "structure success" β€” we said what we said πŸ’€)


void rte_keepalive_dispatch_pings (void * ptr_timer, void * ptr_data)

Checks & handles keepalive state of monitored cores. this is the main-character function that does the rounds. πŸ’«

Parameters

  • *ptr_timer β€” Triggering timer (unused)
  • *ptr_data β€” Data pointer (keepalive structure)

void rte_keepalive_register_core (struct rte_keepalive * keepcfg, const int id_core)

Registers a core for keepalive checks. adding a bestie to the group chat, essentially. πŸ“²βœ¨

Parameters

  • *keepcfg β€” Keepalive structure pointer
  • id_core β€” ID number of core to register.

void rte_keepalive_mark_alive (struct rte_keepalive * keepcfg)

Per-core keepalive check. "hey bestie, still here!" πŸ“£

Parameters

  • *keepcfg β€” Keepalive structure pointer

This function needs to be called from within the main process loop of the LCore to be checked. don't skip it, no cap.


void rte_keepalive_mark_sleep (struct rte_keepalive * keepcfg)

Per-core sleep-time indication. πŸ˜΄πŸŒ™

Parameters

  • *keepcfg β€” Keepalive structure pointer

If CPU idling is enabled, this function needs to be called from within the main process loop of the LCore going to sleep, in order to avoid the LCore being mis-detected as dead.

okay so this one matters a LOT bestie β€” skip it and your sleeping core gets read as gone, which is giving tragic misunderstanding. call it before you nap. πŸ›ŒπŸ’€

void rte_keepalive_register_relay_callback (struct rte_keepalive * keepcfg, rte_keepalive_relay_callback_t callback, void * data)

Registers a 'live core' callback. πŸ‘‘

The complement of the 'dead core' callback. This is called when a core is known to be alive, and is intended for cases when an app needs to know 'liveness' beyond just knowing when a core has died. so it's not just about the heartbreak β€” it's also about the flirty little "still alive" moments. πŸ’–

Parameters

  • *keepcfg β€” Keepalive structure pointer
  • callback β€” Function called upon detection of a dead core.
  • data β€” Data pointer to be passed to function callback.

🌟 Author 🌟

Generated automatically by Doxygen for DPDK from the source code. (not a human author, it's the Doxygen girlies doing their thing πŸ€–βœ¨)


aaaand that's the whole page, bestie. this one's from DPDK, Version 25.11.3 β€” mwah, go keep those cores alive, you ate. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from