X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_pipeline%2Frte_swx_ctl.c;h=2e4538bd096baeea17a529e1f8a93604b8e74706;hb=64cfcebd6890fdc60c12eac09e1f066223a3d4e6;hp=6bef9c311c8d819cf0338a7b35f8be26dd530a46;hpb=924d3ba019b763e65f4fe0dd83a57553481e3079;p=dpdk.git diff --git a/lib/librte_pipeline/rte_swx_ctl.c b/lib/librte_pipeline/rte_swx_ctl.c index 6bef9c311c..2e4538bd09 100644 --- a/lib/librte_pipeline/rte_swx_ctl.c +++ b/lib/librte_pipeline/rte_swx_ctl.c @@ -386,6 +386,9 @@ table_entry_duplicate(struct rte_swx_ctl_pipeline *ctl, entry->key_mask, table->params.key_size); } + + /* key_priority. */ + new_entry->key_priority = entry->key_priority; } if (data_duplicate) { @@ -1672,6 +1675,28 @@ rte_swx_ctl_pipeline_table_entry_read(struct rte_swx_ctl_pipeline *ctl, tokens += 1 + table->info.n_match_fields; n_tokens -= 1 + table->info.n_match_fields; + /* + * Match priority. + */ + if (n_tokens && !strcmp(tokens[0], "priority")) { + char *priority = tokens[1]; + uint32_t val; + + if (n_tokens < 2) + goto error; + + /* Parse. */ + val = strtoul(priority, &priority, 0); + if (priority[0]) + goto error; + + /* Copy to entry. */ + entry->key_priority = val; + + tokens += 2; + n_tokens -= 2; + } + /* * Action. */ @@ -1768,6 +1793,8 @@ table_entry_printf(FILE *f, fprintf(f, "%02x", entry->key_mask[i]); } + fprintf(f, " priority %u", entry->key_priority); + fprintf(f, " action %s ", action->info.name); for (i = 0; i < action->data_size; i++) fprintf(f, "%02x", entry->action_data[i]);