case 0:
if (strcmp(lgopts[opt_idx].name, "help") == 0) {
usage(argv[0]);
- rte_exit(EXIT_SUCCESS, "Displayed help\n");
+ exit(EXIT_SUCCESS);
}
if (strcmp(lgopts[opt_idx].name, "group") == 0) {
if (n >= 0)
flow_group = n;
else
- rte_exit(EXIT_SUCCESS,
+ rte_exit(EXIT_FAILURE,
"flow group should be >= 0\n");
printf("group %d / ", flow_group);
}
if (n > 0)
hairpin_queues_num = n;
else
- rte_exit(EXIT_SUCCESS,
+ rte_exit(EXIT_FAILURE,
"Hairpin queues should be > 0\n");
flow_actions[actions_idx++] =
if (n > 0)
hairpin_queues_num = n;
else
- rte_exit(EXIT_SUCCESS,
+ rte_exit(EXIT_FAILURE,
"Hairpin queues should be > 0\n");
flow_actions[actions_idx++] =
break;
}
/* Reached last item with no match */
- if (i == (RTE_DIM(flow_options) - 1)) {
- fprintf(stderr, "Invalid encap item: %s\n", token);
- usage(argv[0]);
- rte_exit(EXIT_SUCCESS, "Invalid encap item\n");
- }
+ if (i == (RTE_DIM(flow_options) - 1))
+ rte_exit(EXIT_FAILURE,
+ "Invalid encap item: %s\n", token);
}
token = strtok(NULL, ",");
}
break;
}
/* Reached last item with no match */
- if (i == (RTE_DIM(flow_options) - 1)) {
- fprintf(stderr, "Invalid decap item: %s\n", token);
- usage(argv[0]);
- rte_exit(EXIT_SUCCESS, "Invalid decap item\n");
- }
+ if (i == (RTE_DIM(flow_options) - 1))
+ rte_exit(EXIT_FAILURE,
+ "Invalid decap item %s\n", token);
}
token = strtok(NULL, ",");
}
if (n >= DEFAULT_RULES_BATCH)
rules_batch = n;
else {
- printf("\n\nrules_batch should be >= %d\n",
+ rte_exit(EXIT_FAILURE,
+ "rules_batch should be >= %d\n",
DEFAULT_RULES_BATCH);
- rte_exit(EXIT_SUCCESS, " ");
}
}
if (strcmp(lgopts[opt_idx].name,
if (n >= (int) rules_batch)
rules_count = n;
else {
- printf("\n\nrules_count should be >= %d\n",
+ rte_exit(EXIT_FAILURE,
+ "rules_count should be >= %d\n",
rules_batch);
}
}
if (strcmp(lgopts[opt_idx].name, "cores") == 0) {
n = atoi(optarg);
if ((int) rte_lcore_count() <= n) {
- printf("\nError: you need %d cores to run on multi-cores\n"
+ rte_exit(EXIT_FAILURE,
+ "Error: you need %d cores to run on multi-cores\n"
"Existing cores are: %d\n", n, rte_lcore_count());
- rte_exit(EXIT_FAILURE, " ");
}
if (n <= RTE_MAX_LCORE && n > 0)
mc_pool.cores_count = n;
else {
- printf("Error: cores count must be > 0 "
- " and < %d\n", RTE_MAX_LCORE);
- rte_exit(EXIT_FAILURE, " ");
+ rte_exit(EXIT_FAILURE,
+ "Error: cores count must be > 0 and < %d\n",
+ RTE_MAX_LCORE);
}
}
break;
default:
- fprintf(stderr, "Invalid option: %s\n", argv[optind]);
usage(argv[0]);
- rte_exit(EXIT_SUCCESS, "Invalid option\n");
+ rte_exit(EXIT_FAILURE, "Invalid option: %s\n",
+ argv[optind]);
break;
}
}
printf("Port %u create meter idx(%d) error(%d) message: %s\n",
port_id, counter, error.type,
error.message ? error.message : "(no stated reason)");
- rte_exit(EXIT_FAILURE, "error in creating meter");
+ rte_exit(EXIT_FAILURE, "Error in creating meter\n");
}
}
printf("Port %u destroy meter(%d) error(%d) message: %s\n",
port_id, counter, error.type,
error.message ? error.message : "(no stated reason)");
- rte_exit(EXIT_FAILURE, "Error in deleting meter rule");
+ rte_exit(EXIT_FAILURE, "Error in deleting meter rule\n");
}
}
memset(&error, 0x33, sizeof(error));
if (rte_flow_destroy(port_id, flows_list[i], &error)) {
print_flow_error(error);
- rte_exit(EXIT_FAILURE, "Error in deleting flow");
+ rte_exit(EXIT_FAILURE, "Error in deleting flow\n");
}
/*
flows_list = rte_zmalloc("flows_list",
(sizeof(struct rte_flow *) * rules_count_per_core) + 1, 0);
if (flows_list == NULL)
- rte_exit(EXIT_FAILURE, "No Memory available!");
+ rte_exit(EXIT_FAILURE, "No Memory available!\n");
cpu_time_used = 0;
flow_index = 0;
if (flow == NULL) {
print_flow_error(error);
- rte_exit(EXIT_FAILURE, "error in creating flow");
+ rte_exit(EXIT_FAILURE, "Error in creating flow\n");
}
flows_list[flow_index++] = flow;
}
if (!flow) {
print_flow_error(error);
- rte_exit(EXIT_FAILURE, "error in creating flow");
+ rte_exit(EXIT_FAILURE, "Error in creating flow\n");
}
flows_list[flow_index++] = flow;
old = rte_zmalloc("old",
sizeof(struct lcore_info) * RTE_MAX_LCORE, 0);
if (old == NULL)
- rte_exit(EXIT_FAILURE, "No Memory available!");
+ rte_exit(EXIT_FAILURE, "No Memory available!\n");
memcpy(old, lcore_infos,
sizeof(struct lcore_info) * RTE_MAX_LCORE);