From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id A2A1F19F5 for ; Mon, 18 Jul 2016 19:32:47 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 18 Jul 2016 10:32:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,384,1464678000"; d="scan'208";a="1024206076" Received: from unknown (HELO localhost.ch.intel.com) ([10.2.63.143]) by fmsmga002.fm.intel.com with ESMTP; 18 Jul 2016 10:32:46 -0700 From: "Chokkalingam, SankarX" To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com Date: Mon, 18 Jul 2016 10:32:58 -0700 Message-Id: <1468863178-22458-1-git-send-email-sankarx.chokkalingam@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] ip_pipeline: Fix for action flow bulk command error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2016 17:32:48 -0000 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 Acked-by: Cristian Dumitrescu --- 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