mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
init DPDK only if needed
This commit is contained in:
committed by
Christian Giese
parent
4cd19455e3
commit
d339dfdac9
@@ -2113,6 +2113,7 @@ json_parse_config(json_t *root)
|
||||
#if BNGBLASTER_DPDK
|
||||
} else if(strcmp(s, "dpdk") == 0) {
|
||||
g_ctx->config.io_mode = IO_MODE_DPDK;
|
||||
g_ctx->dpdk = true;
|
||||
#endif
|
||||
} else {
|
||||
fprintf(stderr, "Config error: Invalid value for interfaces->io-mode\n");
|
||||
|
||||
@@ -90,6 +90,7 @@ typedef struct bbl_ctx_
|
||||
io_thread_s *io_threads; /* single linked list of threads */
|
||||
|
||||
bool tcp;
|
||||
bool dpdk;
|
||||
|
||||
bgp_session_s *bgp_sessions;
|
||||
bgp_raw_update_s *bgp_raw_updates;
|
||||
|
||||
@@ -33,6 +33,10 @@ io_dpdk_init()
|
||||
|
||||
struct rte_eth_dev_info dev_info;
|
||||
|
||||
if(!g_ctx->dpdk) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char *dpdk_args[2];
|
||||
char **argv=dpdk_args;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user