- Introduce per-thread I/O statistics for packet I/O to reduce performance overhead. - Implement packet_io_yield() for better thread management during I/O operations. - Refactor time wheel management: - Replace timeouts-based cron tasks with (now_ts - last_ts > timeout) for scheduled tasks. - Update the time wheel every 5 ms for improved time management.
27 lines
854 B
C
27 lines
854 B
C
#ifndef _DUMPFILE_IO_H
|
|
#define _DUMPFILE_IO_H
|
|
|
|
#ifdef __cpluscplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#include "packet_io.h"
|
|
|
|
struct dumpfile_io;
|
|
struct dumpfile_io *dumpfile_io_new(const char *directory, uint8_t nr_threads);
|
|
void dumpfile_io_free(struct dumpfile_io *handle);
|
|
|
|
int dumpfile_io_init(struct dumpfile_io *handle, uint16_t thr_idx);
|
|
int dumpfile_io_ingress(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, int nr_pkts);
|
|
void dumpfile_io_egress(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, int nr_pkts);
|
|
void dumpfile_io_drop(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, int nr_pkts);
|
|
void dumpfile_io_yield(struct dumpfile_io *handle, uint16_t thr_idx, uint64_t timeout_ms);
|
|
struct io_stat *dumpfile_io_stat(struct dumpfile_io *handle, uint16_t thr_idx);
|
|
|
|
#ifdef __cpluscplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|