From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 2/2] app/testpmd: enable ddp remove profile feature Date: Tue, 27 Jun 2017 10:55:51 +0100 Message-ID: <4760b55e-875a-c6a7-dde2-ae0bd3ea4e33@intel.com> References: <1495901077-11845-1-git-send-email-andrey.chilikin@intel.com> <1498551492-17214-3-git-send-email-andrey.chilikin@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: beilei.xing@intel.com, jingjing.wu@intel.com To: Andrey Chilikin , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3C529235 for ; Tue, 27 Jun 2017 11:55:58 +0200 (CEST) In-Reply-To: <1498551492-17214-3-git-send-email-andrey.chilikin@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 6/27/2017 9:18 AM, Andrey Chilikin wrote: > New command 'ddp del (port) (profile_path)' removes previously > loaded profile and deletes it from the list of the loaded profiles. > > Signed-off-by: Andrey Chilikin <...> > @@ -12860,6 +12863,9 @@ cmd_ddp_add_parsed( > struct cmd_ddp_add_result *res = parsed_result; > uint8_t *buff; > uint32_t size; > + char *filepath; > + char *file_fld[2]; > + int file_num; > int ret = -ENOTSUP; > > if (res->port_id > nb_ports) { > @@ -12872,9 +12878,18 @@ cmd_ddp_add_parsed( > return; > } > > - buff = open_ddp_package_file(res->filepath, &size); > - if (!buff) > + filepath = strdup(res->filepath); > + if (filepath == NULL) { > + printf("Failed to allocate memory\n"); > return; > + } > + file_num = rte_strsplit(filepath, strlen(filepath), file_fld, 2, ','); > + > + buff = open_ddp_package_file(file_fld[0], &size); > + if (!buff) { > + free((void *)filepath); > + return; > + } <...> Can you please export ddp_add related changes into different patch? Thanks, ferruh