packet IO stat metric rename

This commit is contained in:
luwenpeng
2024-08-16 17:44:23 +08:00
parent 169607cd1e
commit 2b9e867071
5 changed files with 95 additions and 129 deletions

View File

@@ -279,16 +279,16 @@ int marsio_io_ingress(struct marsio_io *handle, uint16_t thr_idx, struct packet
data = marsio_buff_mtod(mbuff);
len = marsio_buff_datalen(mbuff);
stat->dev_rx_pkts++;
stat->dev_rx_bytes += len;
stat->pkts_rx++;
stat->bytes_rx += len;
if (is_keepalive_packet(data, len))
{
stat->keep_alive_pkts++;
stat->keep_alive_bytes += len;
stat->dev_tx_pkts++;
stat->dev_tx_bytes += len;
stat->pkts_tx++;
stat->bytes_tx += len;
marsio_send_burst(handle->mr_path, thr_idx, &mbuff, 1);
continue;
@@ -301,13 +301,13 @@ int marsio_io_ingress(struct marsio_io *handle, uint16_t thr_idx, struct packet
if (marsio_buff_is_ctrlbuf(mbuff))
{
stat->ctrl_rx_pkts++;
stat->ctrl_rx_bytes += len;
stat->ctrl_pkts_rx++;
stat->ctrl_bytes_rx += len;
}
else
{
stat->raw_rx_pkts++;
stat->raw_rx_bytes += len;
stat->raw_pkts_rx++;
stat->raw_bytes_rx += len;
}
}
@@ -326,8 +326,8 @@ void marsio_io_egress(struct marsio_io *handle, uint16_t thr_idx, struct packet
pkt = &pkts[i];
len = packet_get_raw_len(pkt);
stat->dev_tx_pkts++;
stat->dev_tx_bytes += len;
stat->pkts_tx++;
stat->bytes_tx += len;
mbuff = (marsio_buff_t *)packet_get_origin_ctx(pkt);
assert(mbuff != NULL);
@@ -335,13 +335,13 @@ void marsio_io_egress(struct marsio_io *handle, uint16_t thr_idx, struct packet
if (marsio_buff_is_ctrlbuf(mbuff))
{
stat->ctrl_tx_pkts++;
stat->ctrl_tx_bytes += len;
stat->ctrl_pkts_tx++;
stat->ctrl_bytes_tx += len;
}
else
{
stat->raw_tx_pkts++;
stat->raw_tx_bytes += len;
stat->raw_pkts_tx++;
stat->raw_bytes_tx += len;
}
marsio_send_burst(handle->mr_path, thr_idx, &mbuff, 1);
@@ -361,8 +361,8 @@ void marsio_io_drop(struct marsio_io *handle, uint16_t thr_idx, struct packet *p
mbuff = (marsio_buff_t *)packet_get_origin_ctx(pkt);
if (mbuff)
{
stat->drop_pkts++;
stat->drop_bytes += packet_get_raw_len(pkt);
stat->pkts_dropped++;
stat->bytes_dropped += packet_get_raw_len(pkt);
marsio_buff_free(handle->mr_ins, &mbuff, 1, 0, thr_idx);
}
packet_free(pkt);
@@ -389,14 +389,14 @@ int marsio_io_inject(struct marsio_io *handle, uint16_t thr_idx, struct packet *
continue;
}
stat->inject_pkts++;
stat->inject_bytes += len;
stat->pkts_injected++;
stat->bytes_injected += len;
stat->raw_tx_pkts++;
stat->raw_tx_bytes += len;
stat->raw_pkts_tx++;
stat->raw_bytes_tx += len;
stat->dev_tx_pkts++;
stat->dev_tx_bytes += len;
stat->pkts_tx++;
stat->bytes_tx += len;
nr_inject++;