The pipeline object is not freed when a particular test-case of the
unit-test finishes. Using rte_pipeline_free() before returning the
outcome for each test-case fixes the issue.
Fixes:
5205954791cb ("app/test: packet framework unit tests")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
};
if (rte_pipeline_port_in_create(pipeline, &ring_in_params,
};
if (rte_pipeline_port_in_create(pipeline, &ring_in_params,
+ &ring_in_id) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_PORT_CONFIG;
return -CHECK_TABLE_PORT_CONFIG;
/* Create table */
struct rte_pipeline_table_params table_params = {
/* Create table */
struct rte_pipeline_table_params table_params = {
.action_data_size = 0,
};
.action_data_size = 0,
};
- if (rte_pipeline_table_create(pipeline, &table_params, &table_id) != 0)
+ if (rte_pipeline_table_create(pipeline, &table_params,
+ &table_id) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_TABLE_CONFIG;
return -CHECK_TABLE_TABLE_CONFIG;
/* Create output ports */
ring_params_tx.ring = RING_TX;
/* Create output ports */
ring_params_tx.ring = RING_TX;
};
if (rte_pipeline_port_out_create(pipeline, &ring_out_params,
};
if (rte_pipeline_port_out_create(pipeline, &ring_out_params,
+ &ring_out_id) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_PORT_CONFIG;
return -CHECK_TABLE_PORT_CONFIG;
ring_params_tx.ring = RING_TX_2;
if (rte_pipeline_port_out_create(pipeline, &ring_out_params,
ring_params_tx.ring = RING_TX_2;
if (rte_pipeline_port_out_create(pipeline, &ring_out_params,
+ &ring_out_2_id) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_PORT_CONFIG;
return -CHECK_TABLE_PORT_CONFIG;
/* Add entry to the table */
struct rte_pipeline_table_entry default_entry = {
/* Add entry to the table */
struct rte_pipeline_table_entry default_entry = {
int key_found;
if (rte_pipeline_table_default_entry_add(pipeline, table_id,
int key_found;
if (rte_pipeline_table_default_entry_add(pipeline, table_id,
- &default_entry, &default_entry_ptr) != 0)
+ &default_entry, &default_entry_ptr) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_DEFAULT_ENTRY_ADD;
return -CHECK_TABLE_DEFAULT_ENTRY_ADD;
if (rte_pipeline_table_entry_add(pipeline, table_id,
key ? key : &table_entry, &table_entry, &key_found,
if (rte_pipeline_table_entry_add(pipeline, table_id,
key ? key : &table_entry, &table_entry, &key_found,
+ &entry_ptr) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_ENTRY_ADD;
return -CHECK_TABLE_ENTRY_ADD;
/* Create connections and check consistency */
if (rte_pipeline_port_in_connect_to_table(pipeline, ring_in_id,
/* Create connections and check consistency */
if (rte_pipeline_port_in_connect_to_table(pipeline, ring_in_id,
+ table_id) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_CONNECT;
return -CHECK_TABLE_CONNECT;
- if (rte_pipeline_port_in_enable(pipeline, ring_in_id) != 0)
+ if (rte_pipeline_port_in_enable(pipeline, ring_in_id) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_PORT_ENABLE;
return -CHECK_TABLE_PORT_ENABLE;
- if (rte_pipeline_check(pipeline) != 0)
+ if (rte_pipeline_check(pipeline) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_CONSISTENCY;
return -CHECK_TABLE_CONSISTENCY;
table_entry.table_id = ring_out_2_id;
if (rte_pipeline_table_default_entry_add(pipeline, table_id,
table_entry.table_id = ring_out_2_id;
if (rte_pipeline_table_default_entry_add(pipeline, table_id,
- &default_entry, &default_entry_ptr) != 0)
+ &default_entry, &default_entry_ptr) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_ENTRY_ADD;
return -CHECK_TABLE_ENTRY_ADD;
if (rte_pipeline_table_entry_add(pipeline, table_id,
key ? key : &table_entry, &table_entry, &key_found,
if (rte_pipeline_table_entry_add(pipeline, table_id,
key ? key : &table_entry, &table_entry, &key_found,
+ &entry_ptr) != 0) {
+ rte_pipeline_free(pipeline);
return -CHECK_TABLE_ENTRY_ADD;
return -CHECK_TABLE_ENTRY_ADD;
/* Check that traffic destination has changed */
if (table_packets->n_hit_packets) {
/* Check that traffic destination has changed */
if (table_packets->n_hit_packets) {