rte_eal_init() returns the number of parsed dpdk arguments to skip.
dpdk_init() should add 1 to that number, because it has already skipped
the "--dpdk" argument itself.
This patch also makes sure the program name is ovs-vswitchd in
rte_eal_init() and proctitle_init().
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
{
int result;
- if (strcmp(argv[1], "--dpdk"))
+ if (argc < 2 || strcmp(argv[1], "--dpdk"))
return 0;
+ /* Make sure program name passed to rte_eal_init() is vswitchd. */
+ argv[1] = argv[0];
+
argc--;
argv++;
rte_memzone_dump();
rte_eal_init_ret = 0;
- return result;
+ if (argc > result)
+ argv[result] = argv[0];
+
+ return result + 1;
}
void