packet IO support inject packet and add inject packet stat

This commit is contained in:
luwenpeng
2024-04-25 15:34:46 +08:00
parent 476c5bac56
commit 54a78389cf
6 changed files with 85 additions and 0 deletions

View File

@@ -106,6 +106,18 @@ void packet_io_drop(struct packet_io *packet_io, uint16_t thr_idx, struct packet
}
}
int packet_io_inject(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, int nr_pkts)
{
if (likely(packet_io->mode == PACKET_IO_MARSIO))
{
return marsio_io_inject(packet_io->marsio, thr_idx, pkts, nr_pkts);
}
else
{
return dumpfile_io_inject(packet_io->dumpfile, thr_idx, pkts, nr_pkts);
}
}
void packet_io_yield(struct packet_io *packet_io, uint16_t thr_idx, uint64_t timeout_ms)
{
if (likely(packet_io->mode == PACKET_IO_MARSIO))