summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSankar Chokkalingam <sankarx.chokkalingam@intel.com>2016-07-18 10:32:58 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-22 12:40:26 +0200
commit399b2d4758009868a578c618015bf2aa47e222a5 (patch)
treedbd96b0dab7aa195c5dab6725ea0e04f8d91924d /examples
parent9a9751b58bd608f9d4d5f0df2b0e96c43ae44bfb (diff)
downloaddpdk-399b2d4758009868a578c618015bf2aa47e222a5.zip
dpdk-399b2d4758009868a578c618015bf2aa47e222a5.tar.gz
dpdk-399b2d4758009868a578c618015bf2aa47e222a5.tar.xz
examples/ip_pipeline: fix action flow bulk command
Error while executing action flow bulk command pipeline> p 1 action flow bulk ./config/action.txt Command "action flow bulk" failed pipeline> The flow action entries are added successfully. But the return value is not computed correctly. Due to this, the error message appears on CLI. The return value is computed with rsp->n_flows after rsp pointer is freed. This fix computes the return value before rsp pointer is freed. Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/ip_pipeline/pipeline/pipeline_flow_actions.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_actions.c b/examples/ip_pipeline/pipeline/pipeline_flow_actions.c
index bf12fd7..349db6b 100644
--- a/examples/ip_pipeline/pipeline/pipeline_flow_actions.c
+++ b/examples/ip_pipeline/pipeline/pipeline_flow_actions.c
@@ -290,6 +290,7 @@ app_pipeline_fa_flow_config_bulk(struct app_params *app,
void **req_entry_ptr;
uint32_t *req_flow_id;
uint32_t i;
+ int status;
/* Check input arguments */
if ((app == NULL) ||
@@ -368,6 +369,7 @@ app_pipeline_fa_flow_config_bulk(struct app_params *app,
}
/* Read response */
+ status = (rsp->n_flows == n_flows) ? 0 : -1;
/* Commit flows */
for (i = 0; i < rsp->n_flows; i++) {
@@ -408,7 +410,7 @@ app_pipeline_fa_flow_config_bulk(struct app_params *app,
rte_free(req_flow_id);
rte_free(req_entry_ptr);
- return (rsp->n_flows == n_flows) ? 0 : -1;
+ return status;
}
int