From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB4F8ECAAA3 for ; Fri, 26 Aug 2022 13:19:44 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5036542B98; Fri, 26 Aug 2022 15:18:17 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id F0D7C40143 for ; Fri, 26 Aug 2022 15:18:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661519882; x=1693055882; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S4PXGKGKmO8ip4f1y4RiQ8zutx5+NEbe+ra7/Z/3X1M=; b=D0c+TACSUSmrphQ47y1WvvnMwW9RsZOK2l0UAU4CieLgs7QEU0ncV5hy o7gnJKnMIl68u/wt/i3Wz3LiJa+lDzcSt3IQv4+RMwjNgXe4ndWb/H5eX nVinyLZIs8s+WqOfzXU4KT/YdoNdMi65unKPB1cx4D3ijudAORw1fbbdi GUZ7n78JmL9BYIArEATWujU9DYC9CNbqKLfgSjxQ2FTKj72nDr6QuD6rf c5bTeEayN3DBLDjsZu3D9TrLanLHSwAKtgbQY7D94s+zu3v4AO6wXrUKt 46IYbwS+PJdnfyqXk6PYVQ2n4wkrwhx8njiK9v7KSmS604P9g6rSKMTjS Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="320598593" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="320598593" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 06:17:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="610561646" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by orsmga002.jf.intel.com with ESMTP; 26 Aug 2022 06:17:49 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: Yogesh Jangra Subject: [PATCH V2 12/21] net/softnic: add pipeline build CLI command Date: Fri, 26 Aug 2022 13:17:28 +0000 Message-Id: <20220826131737.1741743-13-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220826131737.1741743-1-cristian.dumitrescu@intel.com> References: <20220804165839.1074817-1-cristian.dumitrescu@intel.com> <20220826131737.1741743-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