static void
gen_random_rt_6(struct rt_rule_6 *rt, int nh_sz)
{
- uint32_t i, j, k = 0;
+ uint32_t a, i, j, k = 0;
if (config.nb_routes_per_depth[0] != 0) {
memset(rt[k].addr, 0, 16);
rt[k++].nh = rte_rand() & get_max_nh(nh_sz);
}
- for (int a = 0; a < 4; a++) {
+ for (a = 0; a < 4; a++) {
for (i = 1; i <= 32; i++) {
uint32_t rnd;
double edge = 0;
}
for (i = 0; i < config.nb_routes; i++)
- fprintf(f, NIPQUAD_FMT"/%d %lu\n", NIPQUAD(rt[i].addr),
+ fprintf(f, NIPQUAD_FMT"/%d %"PRIu64"\n", NIPQUAD(rt[i].addr),
rt[i].depth, rt[i].nh);
fclose(f);
return -ret;
}
}
- printf("AVG FIB add %lu\n", (rte_rdtsc_precise() - start) / j);
+ printf("AVG FIB add %"PRIu64"\n",
+ (rte_rdtsc_precise() - start) / j);
i += j;
}
return -ret;
}
}
- printf("AVG LPM add %lu\n",
+ printf("AVG LPM add %"PRIu64"\n",
(rte_rdtsc_precise() - start) / j);
i += j;
}
for (j = 0; j < (config.nb_routes - i) / k; j++)
rte_fib_delete(fib, rt[i + j].addr, rt[i + j].depth);
- printf("AVG FIB delete %lu\n",
+ printf("AVG FIB delete %"PRIu64"\n",
(rte_rdtsc_precise() - start) / j);
i += j;
}
rte_lpm_delete(lpm, rt[i + j].addr,
rt[i + j].depth);
- printf("AVG LPM delete %lu\n",
+ printf("AVG LPM delete %"PRIu64"\n",
(rte_rdtsc_precise() - start) / j);
i += j;
}
}
for (i = 0; i < config.nb_routes; i++) {
- fprintf(f, NIPQUAD6_FMT"/%d %lu\n", NIPQUAD6(rt[i].addr),
+ fprintf(f, NIPQUAD6_FMT"/%d %"PRIu64"\n", NIPQUAD6(rt[i].addr),
rt[i].depth, rt[i].nh);
}
return -ret;
}
}
- printf("AVG FIB add %lu\n", (rte_rdtsc_precise() - start) / j);
+ printf("AVG FIB add %"PRIu64"\n",
+ (rte_rdtsc_precise() - start) / j);
i += j;
}
return -ret;
}
}
- printf("AVG LPM add %lu\n",
+ printf("AVG LPM add %"PRIu64"\n",
(rte_rdtsc_precise() - start) / j);
i += j;
}
for (j = 0; j < (config.nb_routes - i) / k; j++)
rte_fib6_delete(fib, rt[i + j].addr, rt[i + j].depth);
- printf("AVG FIB delete %lu\n",
+ printf("AVG FIB delete %"PRIu64"\n",
(rte_rdtsc_precise() - start) / j);
i += j;
}
rte_lpm6_delete(lpm, rt[i + j].addr,
rt[i + j].depth);
- printf("AVG LPM delete %lu\n",
+ printf("AVG LPM delete %"PRIu64"\n",
(rte_rdtsc_precise() - start) / j);
i += j;
}
main(int argc, char **argv)
{
int ret, af, rt_ent_sz, lookup_ent_sz;
- FILE *fr, *fl;
+ FILE *fr = NULL;
+ FILE *fl = NULL;
uint8_t depth_lim;
ret = rte_eal_init(argc, argv);
rte_exit(-ENOMEM, "Can not alloc lookup table\n");
/* Fill routes table */
- if (config.routes_file == NULL) {
+ if (fr == NULL) {
if (distrib_string != NULL)
ret = parse_distrib(depth_lim, config.nb_routes);
else {
}
/* Fill lookup table with ip's*/
- if (config.lookup_ips_file == NULL)
+ if (fl == NULL)
gen_rnd_lookup_tbl(af);
else {
ret = parse_lookup(fl, af);