Condy v1.1.0
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
condy::RingSettings Class Reference

Settings manager for io_uring. More...

#include <ring.hpp>

Public Member Functions

int apply_personality ()
 Apply a personality to the io_uring instance.
int remove_personality (int id)
 Remove a personality from the io_uring instance.
int set_restrictions (io_uring_restriction *res, unsigned int nr_res)
 Set restrictions for the io_uring instance.
int apply_iowq_aff (size_t cpusz, const cpu_set_t *mask)
 Apply I/O worker queue affinity settings.
int remove_iowq_aff ()
 Remove I/O worker queue affinity settings.
int set_iowq_max_workers (unsigned int *values)
 Set the maximum number of I/O workers.
io_uring_probe * get_probe ()
 Get the io_uring probe for the ring.
uint32_t get_features () const
 Get the supported features of the ring.
int apply_napi (io_uring_napi *napi)
 Apply NAPI settings to the io_uring instance.
int remove_napi (io_uring_napi *napi=nullptr)
 Remove NAPI settings from the io_uring instance.
int set_clock (io_uring_clock_register *clock_reg)
 Set the clock registration for the io_uring instance.
int set_rings_size (io_uring_params *params)
 Resize the rings of the io_uring instance.
int set_iowait (bool enable_iowait)
 Enable or disable iowait for the io_uring instance.

Detailed Description

Settings manager for io_uring.

This class provides an interface to manage various runtime settings for an io_uring instance, including personalities, restrictions, and other features.

Member Function Documentation

◆ apply_iowq_aff()

int condy::RingSettings::apply_iowq_aff ( size_t cpusz,
const cpu_set_t * mask )
inline

Apply I/O worker queue affinity settings.

See io_uring_register_iowq_aff for more details.

Parameters
cpuszNumber of CPUs in the affinity mask.
maskPointer to the CPU affinity mask.

◆ apply_napi()

int condy::RingSettings::apply_napi ( io_uring_napi * napi)
inline

Apply NAPI settings to the io_uring instance.

See io_uring_register_napi for more details.

Parameters
napiPointer to the io_uring_napi structure.

◆ apply_personality()

int condy::RingSettings::apply_personality ( )
inline

Apply a personality to the io_uring instance.

See io_uring_register_personality for more details.

◆ get_features()

uint32_t condy::RingSettings::get_features ( ) const
inline

Get the supported features of the ring.

Returns
uint32_t Supported features bitmask.

◆ get_probe()

io_uring_probe * condy::RingSettings::get_probe ( )
inline

Get the io_uring probe for the ring.

Returns
io_uring_probe* Pointer to the io_uring probe structure. User shall not free the returned pointer.

◆ remove_iowq_aff()

int condy::RingSettings::remove_iowq_aff ( )
inline

Remove I/O worker queue affinity settings.

Returns
int Returns 0 on success or a negative error code on failure

◆ remove_napi()

int condy::RingSettings::remove_napi ( io_uring_napi * napi = nullptr)
inline

Remove NAPI settings from the io_uring instance.

Parameters
napiPointer to the io_uring_napi structure. Can be nullptr.

◆ remove_personality()

int condy::RingSettings::remove_personality ( int id)
inline

Remove a personality from the io_uring instance.

Parameters
idThe ID of the personality to remove.

◆ set_clock()

int condy::RingSettings::set_clock ( io_uring_clock_register * clock_reg)
inline

Set the clock registration for the io_uring instance.

See io_uring_register_clock for more details.

Parameters
clock_regPointer to the io_uring_clock_register structure.

◆ set_iowait()

int condy::RingSettings::set_iowait ( bool enable_iowait)
inline

Enable or disable iowait for the io_uring instance.

See io_uring_set_iowait for more details.

Parameters
enable_iowaitBoolean flag to enable or disable iowait mode.

◆ set_iowq_max_workers()

int condy::RingSettings::set_iowq_max_workers ( unsigned int * values)
inline

Set the maximum number of I/O workers.

See io_uring_register_iowq_max_workers for more details.

Parameters
valuesPointer to an array with 2 elements representing the max_workers

◆ set_restrictions()

int condy::RingSettings::set_restrictions ( io_uring_restriction * res,
unsigned int nr_res )
inline

Set restrictions for the io_uring instance.

See io_uring_register_restrictions for more details.

Parameters
resPointer to an array of restrictions.
nr_resNumber of restrictions in the array.

◆ set_rings_size()

int condy::RingSettings::set_rings_size ( io_uring_params * params)
inline

Resize the rings of the io_uring instance.

See io_uring_resize_rings for more details.

Parameters
paramsPointer to the io_uring_params structure.

The documentation for this class was generated from the following file: