DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chokkalingam, SankarX" <sankarx.chokkalingam@intel.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com
Subject: [dpdk-dev] [PATCH] ip_pipeline: Fix for action flow bulk command error
Date: Mon, 18 Jul 2016 10:32:58 -0700	[thread overview]
Message-ID: <1468863178-22458-1-git-send-email-sankarx.chokkalingam@intel.com> (raw)

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: Chokkalingam, SankarX <sankarx.chokkalingam@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/ip_pipeline/pipeline/pipeline_flow_actions.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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
-- 
2.5.5

             reply	other threads:[~2016-07-18 17:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 17:32 Chokkalingam, SankarX [this message]
2016-07-22 10:15 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468863178-22458-1-git-send-email-sankarx.chokkalingam@intel.com \
    --to=sankarx.chokkalingam@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).