MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fwd_stats_reset

Function fwd_stats_reset

dpdk/app/test-pmd/testpmd.c:2181–2212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2179}
2180
2181void
2182fwd_stats_reset(void)
2183{
2184 streamid_t sm_id;
2185 portid_t pt_id;
2186 int ret;
2187 int i;
2188
2189 for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
2190 pt_id = fwd_ports_ids[i];
2191 ret = rte_eth_stats_get(pt_id, &ports[pt_id].stats);
2192 if (ret != 0)
2193 fprintf(stderr,
2194 "%s: Error: failed to clear stats (port %u):%d",
2195 __func__, pt_id, ret);
2196 }
2197 for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
2198 struct fwd_stream *fs = fwd_streams[sm_id];
2199
2200 fs->rx_packets = 0;
2201 fs->tx_packets = 0;
2202 fs->fwd_dropped = 0;
2203 fs->rx_bad_ip_csum = 0;
2204 fs->rx_bad_l4_csum = 0;
2205 fs->rx_bad_outer_l4_csum = 0;
2206 fs->rx_bad_outer_ip_csum = 0;
2207
2208 memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats));
2209 memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats));
2210 fs->busy_cycles = 0;
2211 }
2212}
2213
2214static void
2215flush_fwd_rx_queues(void)

Callers 2

start_packet_forwardingFunction · 0.85
cmd_showfwdall_parsedFunction · 0.85

Calls 2

rte_eth_stats_getFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected