@@ -73,7 +73,6 @@ volatile sig_atomic_t terminate_export = 0;
7373volatile sig_atomic_t terminate_input = 0 ;
7474
7575const uint32_t DEFAULT_IQUEUE_SIZE = 64 ;
76- const uint32_t DEFAULT_IQUEUE_BLOCK = 32 ;
7776const uint32_t DEFAULT_OQUEUE_SIZE = 16536 ;
7877const uint32_t DEFAULT_FPS = 0 ; // unlimited
7978
@@ -159,29 +158,6 @@ void print_help(ipxp_conf_t &conf, const std::string &arg)
159158 }
160159}
161160
162- void init_packets (ipxp_conf_t &conf)
163- {
164- // Reserve +1 more block as a "working block"
165- conf.blocks_cnt = static_cast <size_t >(conf.iqueue_size + 1U ) * conf.worker_cnt ;
166- conf.pkts_cnt = conf.blocks_cnt * conf.iqueue_block ;
167- conf.pkt_data_cnt = conf.pkts_cnt * conf.pkt_bufsize ;
168- conf.blocks = new PacketBlock[conf.blocks_cnt ];
169- conf.pkts = new Packet[conf.pkts_cnt ];
170- conf.pkt_data = new uint8_t [conf.pkt_data_cnt ];
171-
172- for (unsigned i = 0 ; i < conf.blocks_cnt ; i++) {
173- size_t pkts_offset = static_cast <size_t >(i) * conf.iqueue_block ; // offset in number of packets
174-
175- conf.blocks [i].pkts = conf.pkts + pkts_offset;
176- conf.blocks [i].cnt = 0 ;
177- conf.blocks [i].size = conf.iqueue_block ;
178- for (unsigned j = 0 ; j < conf.iqueue_block ; j++) {
179- conf.blocks [i].pkts [j].buffer = static_cast <uint8_t *>(conf.pkt_data + conf.pkt_bufsize * (j + pkts_offset));
180- conf.blocks [i].pkts [j].buffer_size = conf.pkt_bufsize ;
181- }
182- }
183- }
184-
185161void process_plugin_argline (const std::string &args, std::string &plugin, std::string ¶ms)
186162{
187163 size_t delim;
@@ -356,17 +332,17 @@ bool process_plugin_args(ipxp_conf_t &conf, IpfixprobeOptParser &parser)
356332 conf.input_stats .push_back (input_stats);
357333
358334 WorkPipeline tmp = {
359- {
360- input_plugin,
361- new std::thread (input_storage_worker, input_plugin, storage_plugin, & conf.blocks [pipeline_idx * (conf. iqueue_size + 1 )],
362- conf. iqueue_size + 1 , conf.max_pkts , input_res, input_stats),
363- input_res,
364- input_stats
365- },
366- {
367- storage_plugin,
368- storage_process_plugins
369- }
335+ {
336+ input_plugin,
337+ new std::thread (input_storage_worker, input_plugin, storage_plugin, conf.iqueue_size ,
338+ conf.max_pkts , input_res, input_stats),
339+ input_res,
340+ input_stats
341+ },
342+ {
343+ storage_plugin,
344+ storage_process_plugins
345+ }
370346 };
371347 conf.pipelines .push_back (tmp);
372348 pipeline_idx++;
@@ -646,15 +622,13 @@ int run(int argc, char *argv[])
646622 }
647623
648624 conf.worker_cnt = parser.m_input .size ();
649- conf.iqueue_block = parser.m_iqueue_block ;
650625 conf.iqueue_size = parser.m_iqueue ;
651626 conf.oqueue_size = parser.m_oqueue ;
652627 conf.fps = parser.m_fps ;
653628 conf.pkt_bufsize = parser.m_pkt_bufsize ;
654629 conf.max_pkts = parser.m_max_pkts ;
655630
656631 try {
657- init_packets (conf);
658632 if (process_plugin_args (conf, parser)) {
659633 goto EXIT;
660634 }
0 commit comments