🐛 tools should init dpdk before all malloc for the same 'virtual memory address'

This commit is contained in:
Andy 2017-09-05 22:16:53 -04:00
parent 47da7658f2
commit 85eb2ae96a
7 changed files with 12 additions and 1 deletions

View File

@ -51,7 +51,7 @@ ff_set_proc_id(int pid)
ff_proc_id = pid; ff_proc_id = pid;
} }
static int int
ff_ipc_init(void) ff_ipc_init(void)
{ {
if (inited) { if (inited) {

View File

@ -32,6 +32,7 @@
/* Set F-Stack proccess id to communicate with */ /* Set F-Stack proccess id to communicate with */
void ff_set_proc_id(int pid); void ff_set_proc_id(int pid);
int ff_ipc_init(void);
struct ff_msg *ff_ipc_msg_alloc(void); struct ff_msg *ff_ipc_msg_alloc(void);
int ff_ipc_msg_free(struct ff_msg *msg); int ff_ipc_msg_free(struct ff_msg *msg);

View File

@ -426,6 +426,8 @@ main(int argc, char *argv[])
struct option *p; struct option *p;
size_t iflen; size_t iflen;
ff_ipc_init();
all = downonly = uponly = namesonly = noload = verbose = 0; all = downonly = uponly = namesonly = noload = verbose = 0;
f_inet = f_inet6 = f_ether = f_addr = NULL; f_inet = f_inet6 = f_ether = f_addr = NULL;

View File

@ -247,6 +247,8 @@ main(int argc, char *argv[])
char *endptr; char *endptr;
bool first = true; bool first = true;
ff_ipc_init();
af = AF_UNSPEC; af = AF_UNSPEC;
argc = xo_parse_args(argc, argv); argc = xo_parse_args(argc, argv);

View File

@ -281,6 +281,8 @@ main(int argc, char **argv)
if (argc < 2) if (argc < 2)
usage(NULL); usage(NULL);
ff_ipc_init();
#ifndef FSTACK #ifndef FSTACK
while ((ch = getopt(argc, argv, "46nqdtv")) != -1) while ((ch = getopt(argc, argv, "46nqdtv")) != -1)
#else #else

View File

@ -241,6 +241,8 @@ main(int argc, char **argv)
int ch; int ch;
int warncount = 0; int warncount = 0;
ff_ipc_init();
setlocale(LC_NUMERIC, ""); setlocale(LC_NUMERIC, "");
setbuf(stdout,0); setbuf(stdout,0);
setbuf(stderr,0); setbuf(stderr,0);

View File

@ -53,6 +53,8 @@ int main(int argc, char **argv)
unsigned int i; unsigned int i;
struct ff_top_args top, otop; struct ff_top_args top, otop;
ff_ipc_init();
#define TOP_DIFF(member) (top.member - otop.member) #define TOP_DIFF(member) (top.member - otop.member)
while ((ch = getopt(argc, argv, "hp:d:n:")) != -1) { while ((ch = getopt(argc, argv, "hp:d:n:")) != -1) {