The variable name table_id is used in several places causing warnings if -Wshadow is enabled. Rename it to table_ids.
Signed-off-by: Stephen Hemminger <step...@networkplumber.org> --- app/test/test_table.c | 2 +- app/test/test_table.h | 2 +- app/test/test_table_acl.c | 28 ++++++++++++++-------------- app/test/test_table_pipeline.c | 22 +++++++++++----------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/test/test_table.c b/app/test/test_table.c index 27d2407517..6da0012944 100644 --- a/app/test/test_table.c +++ b/app/test/test_table.c @@ -33,7 +33,7 @@ struct rte_mempool *pool = NULL; uint32_t port_in_id[N_PORTS]; uint32_t port_out_id[N_PORTS]; uint32_t port_out_id_type[3]; -uint32_t table_id[N_PORTS*2]; +uint32_t table_ids[N_PORTS*2]; uint64_t override_hit_mask = 0xFFFFFFFF; uint64_t override_miss_mask = 0xFFFFFFFF; uint64_t non_reserved_actions_hit = 0; diff --git a/app/test/test_table.h b/app/test/test_table.h index 209bdbff2c..b8fdd98281 100644 --- a/app/test/test_table.h +++ b/app/test/test_table.h @@ -120,7 +120,7 @@ extern struct rte_mempool *pool; extern uint32_t port_in_id[N_PORTS]; extern uint32_t port_out_id[N_PORTS]; extern uint32_t port_out_id_type[3]; -extern uint32_t table_id[N_PORTS*2]; +extern uint32_t table_ids[N_PORTS*2]; extern uint64_t override_hit_mask; extern uint64_t override_miss_mask; extern uint64_t non_reserved_actions_hit; diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c index dff9bddfb9..4076c513fb 100644 --- a/app/test/test_table_acl.c +++ b/app/test/test_table_acl.c @@ -427,14 +427,14 @@ setup_acl_pipeline(void) table_params.ops = &rte_table_acl_ops; table_params.arg_create = &acl_params; - if (rte_pipeline_table_create(p, &table_params, &table_id[i])) { + if (rte_pipeline_table_create(p, &table_params, &table_ids[i])) { rte_panic("Unable to configure table %u\n", i); goto fail; } if (connect_miss_action_to_table) { if (rte_pipeline_table_create(p, &table_params, - &table_id[i+2])) { + &table_ids[i+2])) { rte_panic("Unable to configure table %u\n", i); goto fail; } @@ -443,10 +443,10 @@ setup_acl_pipeline(void) for (i = 0; i < N_PORTS; i++) { if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i], - table_id[i])) { + table_ids[i])) { rte_panic("Unable to connect input port %u to " "table %u\n", - port_in_id[i], table_id[i]); + port_in_id[i], table_ids[i]); goto fail; } } @@ -485,11 +485,11 @@ setup_acl_pipeline(void) table_entries_ptr[n] = &entries_ptr[n]; } - ret = rte_pipeline_table_entry_add_bulk(p, table_id[i], + ret = rte_pipeline_table_entry_add_bulk(p, table_ids[i], (void **)key_array, table_entries, 5, key_found, table_entries_ptr); if (ret < 0) { rte_panic("Add entry bulk to table %u failed (%d)\n", - table_id[i], ret); + table_ids[i], ret); goto fail; } } @@ -519,11 +519,11 @@ setup_acl_pipeline(void) } } - ret = rte_pipeline_table_entry_delete_bulk(p, table_id[i], + ret = rte_pipeline_table_entry_delete_bulk(p, table_ids[i], (void **)key_array, 5, key_found, table_entries); if (ret < 0) { rte_panic("Delete bulk entries from table %u failed (%d)\n", - table_id[i], ret); + table_ids[i], ret); goto fail; } else printf("Bulk deleted rules.\n"); @@ -555,12 +555,12 @@ setup_acl_pipeline(void) rule_params.priority = RTE_ACL_MAX_PRIORITY - n; - ret = rte_pipeline_table_entry_add(p, table_id[i], + ret = rte_pipeline_table_entry_add(p, table_ids[i], &rule_params, &table_entry, &key_found, &entry_ptr); if (ret < 0) { rte_panic("Add entry to table %u failed (%d)\n", - table_id[i], ret); + table_ids[i], ret); goto fail; } } @@ -581,11 +581,11 @@ setup_acl_pipeline(void) delete_params = (struct rte_pipeline_table_acl_rule_delete_params *) &(rule_params.field_value[0]); - ret = rte_pipeline_table_entry_delete(p, table_id[i], + ret = rte_pipeline_table_entry_delete(p, table_ids[i], delete_params, &key_found, NULL); if (ret < 0) { rte_panic("Add entry to table %u failed (%d)\n", - table_id[i], ret); + table_ids[i], ret); goto fail; } else printf("Deleted Rule.\n"); @@ -607,12 +607,12 @@ setup_acl_pipeline(void) rule_params.priority = RTE_ACL_MAX_PRIORITY - n; - ret = rte_pipeline_table_entry_add(p, table_id[i], + ret = rte_pipeline_table_entry_add(p, table_ids[i], &rule_params, &table_entry, &key_found, &entry_ptr); if (ret < 0) { rte_panic("Add entry to table %u failed (%d)\n", - table_id[i], ret); + table_ids[i], ret); goto fail; } } diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c index 960f730cf2..318ef1ac6c 100644 --- a/app/test/test_table_pipeline.c +++ b/app/test/test_table_pipeline.c @@ -311,14 +311,14 @@ setup_pipeline(int test_type) .action_data_size = 0, }; - if (rte_pipeline_table_create(p, &table_params, &table_id[i])) { + if (rte_pipeline_table_create(p, &table_params, &table_ids[i])) { rte_panic("Unable to configure table %u\n", i); goto fail; } if (connect_miss_action_to_table) if (rte_pipeline_table_create(p, &table_params, - &table_id[i+2])) { + &table_ids[i+2])) { rte_panic("Unable to configure table %u\n", i); goto fail; } @@ -326,9 +326,9 @@ setup_pipeline(int test_type) for (i = 0; i < N_PORTS; i++) if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i], - table_id[i])) { + table_ids[i])) { rte_panic("Unable to connect input port %u to " - "table %u\n", port_in_id[i], table_id[i]); + "table %u\n", port_in_id[i], table_ids[i]); goto fail; } @@ -344,20 +344,20 @@ setup_pipeline(int test_type) if (connect_miss_action_to_table) { printf("Setting first table to output to next table\n"); default_entry.action = RTE_PIPELINE_ACTION_TABLE; - default_entry.table_id = table_id[i+2]; + default_entry.table_id = table_ids[i+2]; } /* Add the default action for the table. */ - ret = rte_pipeline_table_default_entry_add(p, table_id[i], + ret = rte_pipeline_table_default_entry_add(p, table_ids[i], &default_entry, &default_entry_ptr); if (ret < 0) { rte_panic("Unable to add default entry to table %u " - "code %d\n", table_id[i], ret); + "code %d\n", table_ids[i], ret); goto fail; } else printf("Added default entry to table id %d with " "action %x\n", - table_id[i], default_entry.action); + table_ids[i], default_entry.action); if (connect_miss_action_to_table) { /* We create a second table so the first can pass @@ -370,17 +370,17 @@ setup_pipeline(int test_type) /* Add the default action for the table. */ ret = rte_pipeline_table_default_entry_add(p, - table_id[i+2], + table_ids[i+2], &default_entry, &default_entry_ptr); if (ret < 0) { rte_panic("Unable to add default entry to " "table %u code %d\n", - table_id[i], ret); + table_ids[i], ret); goto fail; } else printf("Added default entry to table id %d " "with action %x\n", - table_id[i], default_entry.action); + table_ids[i], default_entry.action); } } -- 2.47.2