Add stat of inject packet and drop packet
This commit is contained in:
@@ -228,6 +228,7 @@ void marsio_io_drop(struct marsio_io *handle, uint16_t thr_idx, struct packet *p
|
||||
{
|
||||
struct packet *pkt;
|
||||
marsio_buff_t *mbuff;
|
||||
struct io_stat *stat = &handle->stat[thr_idx];
|
||||
|
||||
for (int i = 0; i < nr_pkts; i++)
|
||||
{
|
||||
@@ -235,6 +236,8 @@ void marsio_io_drop(struct marsio_io *handle, uint16_t thr_idx, struct packet *p
|
||||
mbuff = (marsio_buff_t *)packet_get_io_ctx(pkt);
|
||||
if (mbuff)
|
||||
{
|
||||
stat->drop_pkts++;
|
||||
stat->drop_bytes += packet_get_len(pkt);
|
||||
marsio_buff_free(handle->mr_ins, &mbuff, 1, 0, thr_idx);
|
||||
}
|
||||
packet_free(pkt);
|
||||
|
||||
Reference in New Issue
Block a user