From patchwork Thu Jul 28 15:11:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Dumitrescu X-Patchwork-Id: 114365 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9CD4BA00C5; Thu, 28 Jul 2022 17:13:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19AAA42C03; Thu, 28 Jul 2022 17:12:10 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id D84AC42BFB for ; Thu, 28 Jul 2022 17:12:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659021125; x=1690557125; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1pxNzdR4+Ogc2O+1sQCAmm9gE9nlMHT6QsLEbNxvYjk=; b=md/f6ZQVUhzy+jAIHcWErgL1ZTDBp9iaDDhAPg/phWmwKh3OZSaSU/0y X9j2Gtz9id+z9l14Q6xumTA/T/n9BGMWQs27edF44A7GFd4gd8kZvIV1O 5fY9qSoETZD5+s5di23wlH7cdZ/mt+C76QDfm0dONsPOB5ViPn79xUAOH 2n/uBV+mmfSX27yQ/nZdsvCsLAK1BW0/p2KewYGZJRhCRRjwInIEpRqh5 wFcLuD3aoM5zj4lRZCSwfD3f2xgn3CYbtEQmGaVR2EVKvNMBUvZDfPLxE 93RXZkWfCEBU0UIExzPqSiaArKZjZgFN2zCfy+jv8nOp6k0jlbbZuHvqw A==; X-IronPort-AV: E=McAfee;i="6400,9594,10422"; a="288547404" X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="288547404" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 08:12:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="633727319" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by orsmga001.jf.intel.com with ESMTP; 28 Jul 2022 08:12:02 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: "Kamalakannan R ." Subject: [PATCH V6 12/17] examples/pipeline: remove the obsolete port configuration CLI commands Date: Thu, 28 Jul 2022 15:11:42 +0000 Message-Id: <20220728151147.603265-13-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220728151147.603265-1-cristian.dumitrescu@intel.com> References: <20220718130713.339003-1-cristian.dumitrescu@intel.com> <20220728151147.603265-1-cristian.dumitrescu@intel.com> MIME-Version: 1.0 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 The pipeline I/O ports configuration is now done through the I/O specification file, hence these CLI commands are no longer needed. Signed-off-by: Cristian Dumitrescu Signed-off-by: Kamalakannan R. --- examples/pipeline/cli.c | 465 ---------------------------------------- 1 file changed, 465 deletions(-) diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c index 7b725a9c27..b26e73c706 100644 --- a/examples/pipeline/cli.c +++ b/examples/pipeline/cli.c @@ -523,438 +523,6 @@ cmd_tap(char **tokens, } } -static const char cmd_pipeline_port_in_help[] = -"pipeline port in \n" -" link rxq bsz \n" -" ring bsz \n" -" | source loop \n" -" | tap mempool mtu bsz \n"; - -static void -cmd_pipeline_port_in(char **tokens, - uint32_t n_tokens, - char *out, - size_t out_size, - void *obj) -{ - struct pipeline *p; - int status; - uint32_t port_id = 0, t0; - - if (n_tokens < 6) { - snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); - return; - } - - p = pipeline_find(obj, tokens[1]); - if (!p || p->ctl) { - snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); - return; - } - - if (strcmp(tokens[2], "port") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "port"); - return; - } - - if (strcmp(tokens[3], "in") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "in"); - return; - } - - if (parser_read_uint32(&port_id, tokens[4]) != 0) { - snprintf(out, out_size, MSG_ARG_INVALID, "port_id"); - return; - } - - t0 = 5; - - if (strcmp(tokens[t0], "link") == 0) { - struct rte_swx_port_ethdev_reader_params params; - struct link *link; - - if (n_tokens < t0 + 6) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline port in link"); - return; - } - - link = link_find(obj, tokens[t0 + 1]); - if (!link) { - snprintf(out, out_size, MSG_ARG_INVALID, - "link_name"); - return; - } - params.dev_name = link->dev_name; - - if (strcmp(tokens[t0 + 2], "rxq") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "rxq"); - return; - } - - if (parser_read_uint16(¶ms.queue_id, tokens[t0 + 3]) != 0) { - snprintf(out, out_size, MSG_ARG_INVALID, - "queue_id"); - return; - } - - if (strcmp(tokens[t0 + 4], "bsz") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "bsz"); - return; - } - - if (parser_read_uint32(¶ms.burst_size, tokens[t0 + 5])) { - snprintf(out, out_size, MSG_ARG_INVALID, - "burst_size"); - return; - } - - t0 += 6; - - status = rte_swx_pipeline_port_in_config(p->p, - port_id, - "ethdev", - ¶ms); - } else if (strcmp(tokens[t0], "ring") == 0) { - struct rte_swx_port_ring_reader_params params; - struct ring *ring; - - if (n_tokens < t0 + 4) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline port in ring"); - return; - } - - ring = ring_find(obj, tokens[t0 + 1]); - if (!ring) { - snprintf(out, out_size, MSG_ARG_INVALID, - "ring_name"); - return; - } - params.name = ring->name; - - if (strcmp(tokens[t0 + 2], "bsz") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "bsz"); - return; - } - - if (parser_read_uint32(¶ms.burst_size, tokens[t0 + 3])) { - snprintf(out, out_size, MSG_ARG_INVALID, - "burst_size"); - return; - } - - t0 += 4; - - status = rte_swx_pipeline_port_in_config(p->p, - port_id, - "ring", - ¶ms); - } else if (strcmp(tokens[t0], "source") == 0) { - struct rte_swx_port_source_params params; - struct mempool *mp; - - if (n_tokens < t0 + 5) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline port in source"); - return; - } - - mp = mempool_find(obj, tokens[t0 + 1]); - if (!mp) { - snprintf(out, out_size, MSG_ARG_INVALID, - "mempool_name"); - return; - } - params.pool = mp->m; - - params.file_name = tokens[t0 + 2]; - - if (strcmp(tokens[t0 + 3], "loop") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "loop"); - return; - } - - if (parser_read_uint64(¶ms.n_loops, tokens[t0 + 4])) { - snprintf(out, out_size, MSG_ARG_INVALID, - "n_loops"); - return; - } - - t0 += 5; - - status = rte_swx_pipeline_port_in_config(p->p, - port_id, - "source", - ¶ms); - } else if (strcmp(tokens[t0], "tap") == 0) { - struct rte_swx_port_fd_reader_params params; - struct tap *tap; - struct mempool *mp; - - if (n_tokens < t0 + 8) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline port in tap"); - return; - } - - tap = tap_find(obj, tokens[t0 + 1]); - if (!tap) { - snprintf(out, out_size, MSG_ARG_INVALID, - "tap_name"); - return; - } - params.fd = tap->fd; - - if (strcmp(tokens[t0 + 2], "mempool") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, - "mempool"); - return; - } - - mp = mempool_find(obj, tokens[t0 + 3]); - if (!mp) { - snprintf(out, out_size, MSG_ARG_INVALID, - "mempool_name"); - return; - } - params.mempool = mp->m; - - if (strcmp(tokens[t0 + 4], "mtu") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, - "mtu"); - return; - } - - if (parser_read_uint32(¶ms.mtu, tokens[t0 + 5]) != 0) { - snprintf(out, out_size, MSG_ARG_INVALID, "mtu"); - return; - } - - if (strcmp(tokens[t0 + 6], "bsz") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "bsz"); - return; - } - - if (parser_read_uint32(¶ms.burst_size, tokens[t0 + 7])) { - snprintf(out, out_size, MSG_ARG_INVALID, - "burst_size"); - return; - } - - t0 += 8; - - status = rte_swx_pipeline_port_in_config(p->p, - port_id, - "fd", - ¶ms); - - } else { - snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); - return; - } - - if (status) { - snprintf(out, out_size, "port in error."); - return; - } - - if (n_tokens != t0) { - snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); - return; - } -} - -static const char cmd_pipeline_port_out_help[] = -"pipeline port out \n" -" link txq bsz \n" -" ring bsz \n" -" | sink | none\n" -" | tap bsz \n"; - -static void -cmd_pipeline_port_out(char **tokens, - uint32_t n_tokens, - char *out, - size_t out_size, - void *obj) -{ - struct pipeline *p; - int status; - uint32_t port_id = 0, t0; - - if (n_tokens < 6) { - snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); - return; - } - - p = pipeline_find(obj, tokens[1]); - if (!p || p->ctl) { - snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); - return; - } - - if (strcmp(tokens[2], "port") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "port"); - return; - } - - if (strcmp(tokens[3], "out") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "out"); - return; - } - - if (parser_read_uint32(&port_id, tokens[4]) != 0) { - snprintf(out, out_size, MSG_ARG_INVALID, "port_id"); - return; - } - - t0 = 5; - - if (strcmp(tokens[t0], "link") == 0) { - struct rte_swx_port_ethdev_writer_params params; - struct link *link; - - if (n_tokens < t0 + 6) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline port out link"); - return; - } - - link = link_find(obj, tokens[t0 + 1]); - if (!link) { - snprintf(out, out_size, MSG_ARG_INVALID, - "link_name"); - return; - } - params.dev_name = link->dev_name; - - if (strcmp(tokens[t0 + 2], "txq") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "txq"); - return; - } - - if (parser_read_uint16(¶ms.queue_id, tokens[t0 + 3]) != 0) { - snprintf(out, out_size, MSG_ARG_INVALID, - "queue_id"); - return; - } - - if (strcmp(tokens[t0 + 4], "bsz") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "bsz"); - return; - } - - if (parser_read_uint32(¶ms.burst_size, tokens[t0 + 5])) { - snprintf(out, out_size, MSG_ARG_INVALID, - "burst_size"); - return; - } - - t0 += 6; - - status = rte_swx_pipeline_port_out_config(p->p, - port_id, - "ethdev", - ¶ms); - } else if (strcmp(tokens[t0], "ring") == 0) { - struct rte_swx_port_ring_writer_params params; - struct ring *ring; - - if (n_tokens < t0 + 4) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline port out link"); - return; - } - - ring = ring_find(obj, tokens[t0 + 1]); - if (!ring) { - snprintf(out, out_size, MSG_ARG_INVALID, - "ring_name"); - return; - } - params.name = ring->name; - - if (strcmp(tokens[t0 + 2], "bsz") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "bsz"); - return; - } - - if (parser_read_uint32(¶ms.burst_size, tokens[t0 + 3])) { - snprintf(out, out_size, MSG_ARG_INVALID, - "burst_size"); - return; - } - - t0 += 4; - - status = rte_swx_pipeline_port_out_config(p->p, - port_id, - "ring", - ¶ms); - } else if (strcmp(tokens[t0], "sink") == 0) { - struct rte_swx_port_sink_params params; - - params.file_name = strcmp(tokens[t0 + 1], "none") ? - tokens[t0 + 1] : NULL; - - t0 += 2; - - status = rte_swx_pipeline_port_out_config(p->p, - port_id, - "sink", - ¶ms); - } else if (strcmp(tokens[t0], "tap") == 0) { - struct rte_swx_port_fd_writer_params params; - struct tap *tap; - - if (n_tokens < t0 + 4) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline port out tap"); - return; - } - - tap = tap_find(obj, tokens[t0 + 1]); - if (!tap) { - snprintf(out, out_size, MSG_ARG_INVALID, - "tap_name"); - return; - } - params.fd = tap->fd; - - if (strcmp(tokens[t0 + 2], "bsz") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "bsz"); - return; - } - - if (parser_read_uint32(¶ms.burst_size, tokens[t0 + 3])) { - snprintf(out, out_size, MSG_ARG_INVALID, - "burst_size"); - return; - } - - t0 += 4; - - status = rte_swx_pipeline_port_out_config(p->p, - port_id, - "fd", - ¶ms); - } else { - snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); - return; - } - - if (status) { - snprintf(out, out_size, "port out error."); - return; - } - - if (n_tokens != t0) { - snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); - return; - } -} - static const char cmd_pipeline_codegen_help[] = "pipeline codegen \n"; @@ -3155,8 +2723,6 @@ cmd_help(char **tokens, "\tmempool\n" "\tlink\n" "\ttap\n" - "\tpipeline port in\n" - "\tpipeline port out\n" "\tpipeline codegen\n" "\tpipeline libbuild\n" "\tpipeline build\n" @@ -3207,21 +2773,6 @@ cmd_help(char **tokens, return; } - if ((strcmp(tokens[0], "pipeline") == 0) && - (n_tokens == 3) && (strcmp(tokens[1], "port") == 0)) { - if (strcmp(tokens[2], "in") == 0) { - snprintf(out, out_size, "\n%s\n", - cmd_pipeline_port_in_help); - return; - } - - if (strcmp(tokens[2], "out") == 0) { - snprintf(out, out_size, "\n%s\n", - cmd_pipeline_port_out_help); - return; - } - } - if ((strcmp(tokens[0], "pipeline") == 0) && (n_tokens == 2) && (strcmp(tokens[1], "codegen") == 0)) { snprintf(out, out_size, "\n%s\n", cmd_pipeline_codegen_help); @@ -3489,22 +3040,6 @@ cli_process(char *in, char *out, size_t out_size, void *obj) } if (strcmp(tokens[0], "pipeline") == 0) { - if ((n_tokens >= 4) && - (strcmp(tokens[2], "port") == 0) && - (strcmp(tokens[3], "in") == 0)) { - cmd_pipeline_port_in(tokens, n_tokens, out, out_size, - obj); - return; - } - - if ((n_tokens >= 4) && - (strcmp(tokens[2], "port") == 0) && - (strcmp(tokens[3], "out") == 0)) { - cmd_pipeline_port_out(tokens, n_tokens, out, out_size, - obj); - return; - } - if ((n_tokens >= 3) && (strcmp(tokens[1], "codegen") == 0)) { cmd_pipeline_codegen(tokens, n_tokens, out, out_size,