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 D26B6A00C4; Thu, 28 Jul 2022 00:37:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 765CF42B9B; Thu, 28 Jul 2022 00:36:58 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 1FBCA42B78 for ; Thu, 28 Jul 2022 00:36:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658961413; x=1690497413; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1pxNzdR4+Ogc2O+1sQCAmm9gE9nlMHT6QsLEbNxvYjk=; b=WAsn5xwW6o/4J06aSSrM0UjtFiYLIguVstFaNAnfO2Rc+kBF3CO5Fg6/ 9R4c8WcsWq/CJBdOieifOB4Sp8+O1Z71nbau3uwX/64shg5TQSGLdeiwJ QOx5Ma5g2yohGVApL5bcwg3qO/Sk0vzmCyd4mRNpdkzdANkpggOQtWZpc vqgwtkniUqTWY/ev+tKP7B7ispG1StQp+Hf+cR3VrrV+gkP4aMb1ov7+I DyaR4WWX9z9vFDXe75/m1Qdhl5qEn3OaUs4XVGzYl2F/nQEj0XhtOiASj bmsYLtClufwsJo8StOazZcVuUaIjMRVfKNC/1Y9UG9nPL2uG4rTxE7UoP Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10421"; a="350068840" X-IronPort-AV: E=Sophos;i="5.93,196,1654585200"; d="scan'208";a="350068840" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2022 15:36:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,196,1654585200"; d="scan'208";a="628567660" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by orsmga008.jf.intel.com with ESMTP; 27 Jul 2022 15:36:51 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: "Kamalakannan R ." Subject: [PATCH V3 12/17] examples/pipeline: remove the obsolete port configuration CLI commands Date: Wed, 27 Jul 2022 22:36:34 +0000 Message-Id: <20220727223639.598932-12-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220727223639.598932-1-cristian.dumitrescu@intel.com> References: <20220718132603.339314-1-cristian.dumitrescu@intel.com> <20220727223639.598932-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 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, -- 2.34.1