X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl2fwd%2Fmain.c;h=e4a4a7c36c5df2428c6e735ea97e2e81e6825c29;hb=ba2f43464ed53fd1358cf7b1f483103c616f341c;hp=6c07ed43e1030988958a5825efabc1850a3133f3;hpb=867a6c66ecf3d88e76367254e79bb9e7b936a830;p=dpdk.git diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 6c07ed43e1..e4a4a7c36c 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -549,6 +549,11 @@ main(int argc, char **argv) if (nb_ports == 0) rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); + /* check port mask to possible port mask */ + if (l2fwd_enabled_port_mask & ~((1 << nb_ports) - 1)) + rte_exit(EXIT_FAILURE, "Invalid portmask; possible (0x%x)\n", + (1 << nb_ports) - 1); + /* reset l2fwd_dst_ports */ for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) l2fwd_dst_ports[portid] = 0;