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

Function print_route_distribution

dpdk/app/test/test_lpm6_perf.c:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#define NUMBER_TBL8S (1 << 16)
29
30static void
31print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)
32{
33 unsigned i, j;
34
35 printf("Route distribution per prefix width: \n");
36 printf("DEPTH QUANTITY (PERCENT)\n");
37 printf("--------------------------- \n");
38
39 /* Count depths. */
40 for(i = 1; i <= 128; i++) {
41 unsigned depth_counter = 0;
42 double percent_hits;
43
44 for (j = 0; j < n; j++)
45 if (table[j].depth == (uint8_t) i)
46 depth_counter++;
47
48 percent_hits = ((double)depth_counter)/((double)n) * 100;
49 printf("%.2u%15u (%.2f)\n", i, depth_counter, percent_hits);
50 }
51 printf("\n");
52}
53
54static int
55test_lpm6_perf(void)

Callers 1

test_lpm6_perfFunction · 0.70

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected