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 2734DA00C4; Thu, 28 Jul 2022 01:02:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FF0342BE2; Thu, 28 Jul 2022 01:01:54 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 2EE8042BB7 for ; Thu, 28 Jul 2022 01:01:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658962908; x=1690498908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1pxNzdR4+Ogc2O+1sQCAmm9gE9nlMHT6QsLEbNxvYjk=; b=aQ9lkl4Gk5CQssujuRkMxImbLN+HotkUAiIjFx1/pbP+VEKas2FaskwB 5S5g1arS/a1HPZq8Iegjg/hjuUaeT224Hwfzto+pUNA9YnphkJKzExsF4 4+dbaq0A7d1D+mD10twkg8/v0cBoQbGMezn76TZvbW6m4om/P6O2+RRiK LXZp76JzJFSIn9H+PFHQz0nmoEMF77sahi3swZpslL2A/YkGPm8VFQAwG kqOpC06IPyTczeNEC/1c/HCMpAc4qlj1mRlKL6Nq1eLzKyS6OKbBszjvs Xb0y2Oz5VHEy1Tz1HmpAi+SedJ5Tg3y9zEbphntNVXX1fwlfNYzeOuDgi A==; X-IronPort-AV: E=McAfee;i="6400,9594,10421"; a="314150929" X-IronPort-AV: E=Sophos;i="5.93,196,1654585200"; d="scan'208";a="314150929" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2022 16:01:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,196,1654585200"; d="scan'208";a="846444365" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by fmsmga006.fm.intel.com with ESMTP; 27 Jul 2022 16:01:44 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: "Kamalakannan R ." Subject: [PATCH V5 12/17] examples/pipeline: remove the obsolete port configuration CLI commands Date: Wed, 27 Jul 2022 23:01:27 +0000 Message-Id: <20220727230132.601114-12-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220727230132.601114-1-cristian.dumitrescu@intel.com> References: <20220727225431.600913-1-cristian.dumitrescu@intel.com> <20220727230132.601114-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