From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31CF5A0032; Thu, 1 Sep 2022 16:22:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18B1C42B92; Thu, 1 Sep 2022 16:21:15 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 3BB6C42B6D for ; Thu, 1 Sep 2022 16:21:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662042068; x=1693578068; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S4PXGKGKmO8ip4f1y4RiQ8zutx5+NEbe+ra7/Z/3X1M=; b=JTFgaTwAz1+hhE++2eXt3D+lz6a5tiSsHS/8nHa68Rg8ZWqqaKtpV4yo 8VLfg9hJ1ufOV++jBUBdkKFvpspSXJkN3gre/ZcnOJs84GD2gp4MAVMiy 50zMg6u9NzFhhAvy86tLWre0wuUsE8lqeNQO3Xmrr9Kvu95G++LLZSSyq dhS8eyzlX/XEOyofIv/SV7oD75KADb6jno5ZqncxWg99fQPhXncgZbfzu hZyrwvDMfisANTr44UfD3nwvCPSo+C0nd5hByTJPPI3KBT9+vunhHW49L obZBLjCYewb9oYKRARdX+AH5d2FXOTLLQzhGmVw6GDPoCDeFLMqtq1nnx g==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="357444060" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="357444060" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 07:20:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="680870206" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by fmsmga004.fm.intel.com with ESMTP; 01 Sep 2022 07:20:53 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: Yogesh Jangra Subject: [PATCH V3 12/21] net/softnic: add pipeline build CLI command Date: Thu, 1 Sep 2022 14:20:32 +0000 Message-Id: <20220901142041.2628537-13-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220901142041.2628537-1-cristian.dumitrescu@intel.com> References: <20220804165839.1074817-1-cristian.dumitrescu@intel.com> <20220901142041.2628537-1-cristian.dumitrescu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add CLI command for pipeline build. Signed-off-by: Cristian Dumitrescu Signed-off-by: Yogesh Jangra --- drivers/net/softnic/rte_eth_softnic_cli.c | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c index 08cca7a8e4..cf71aa7b96 100644 --- a/drivers/net/softnic/rte_eth_softnic_cli.c +++ b/drivers/net/softnic/rte_eth_softnic_cli.c @@ -365,6 +365,67 @@ cmd_softnic_pipeline_libbuild(struct pmd_internals *softnic __rte_unused, free(buffer); } +/** + * pipeline build lib io numa + */ +static void +cmd_softnic_pipeline_build(struct pmd_internals *softnic, + char **tokens, + uint32_t n_tokens, + char *out, + size_t out_size) +{ + struct pipeline *p = NULL; + char *pipeline_name, *lib_file_name, *iospec_file_name; + uint32_t numa_node = 0; + + /* Parsing. */ + if (n_tokens != 9) { + snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); + return; + } + + pipeline_name = tokens[1]; + + if (strcmp(tokens[2], "build")) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "build"); + return; + } + + if (strcmp(tokens[3], "lib")) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "lib"); + return; + } + + lib_file_name = tokens[4]; + + if (strcmp(tokens[5], "io")) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "io"); + return; + } + + iospec_file_name = tokens[6]; + + if (strcmp(tokens[7], "numa")) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "numa"); + return; + } + + if (parser_read_uint32(&numa_node, tokens[8])) { + snprintf(out, out_size, MSG_ARG_INVALID, "numa_node"); + return; + } + + /* Pipeline create. */ + p = softnic_pipeline_create(softnic, + pipeline_name, + lib_file_name, + iospec_file_name, + (int)numa_node); + if (!p) + snprintf(out, out_size, "Pipeline creation failed.\n"); +} + /** * thread pipeline enable [ period ] */ @@ -504,6 +565,11 @@ softnic_cli_process(char *in, char *out, size_t out_size, void *arg) cmd_softnic_pipeline_libbuild(softnic, tokens, n_tokens, out, out_size); return; } + + if (n_tokens >= 3 && !strcmp(tokens[2], "build")) { + cmd_softnic_pipeline_build(softnic, tokens, n_tokens, out, out_size); + return; + } } if (strcmp(tokens[0], "thread") == 0) { -- 2.34.1