- ret = run_regex(nb_jobs, nb_max_payload, perf_mode,
- nb_iterations, data_file, nb_max_matches, nb_qps);
+
+ data_len = read_file(data_file, &data_buf);
+ if (data_len <= 0)
+ rte_exit(EXIT_FAILURE, "Error, can't read file, or file is empty.\n");
+
+ job_len = data_len / nb_jobs;
+ if (job_len == 0)
+ rte_exit(EXIT_FAILURE, "Error, To many jobs, for the given input.\n");
+
+ if (job_len > nb_max_payload)
+ rte_exit(EXIT_FAILURE, "Error, not enough jobs to cover input.\n");
+
+ ret = run_regex(nb_jobs, perf_mode,
+ nb_iterations, nb_max_matches, nb_qps,
+ data_buf, data_len, job_len);