Add stat of inject packet and drop packet
This commit is contained in:
@@ -262,12 +262,16 @@ void dumpfile_io_egress(struct dumpfile_io *handle, uint16_t thr_idx, struct pac
|
||||
void dumpfile_io_drop(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, int nr_pkts)
|
||||
{
|
||||
struct packet *pkt = NULL;
|
||||
struct io_stat *stat = &handle->stat[thr_idx];
|
||||
|
||||
for (int i = 0; i < nr_pkts; i++)
|
||||
{
|
||||
pkt = &pkts[i];
|
||||
struct pcap_pkt *pcap_pkt = (struct pcap_pkt *)packet_get_io_ctx(pkt);
|
||||
if (pcap_pkt)
|
||||
{
|
||||
stat->drop_pkts++;
|
||||
stat->drop_bytes += packet_get_len(pkt);
|
||||
free(pcap_pkt);
|
||||
}
|
||||
packet_free(pkt);
|
||||
|
||||
Reference in New Issue
Block a user