DPDK patches and discussions
 help / color / mirror / Atom feed
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Cc: "Kamalakannan R ." <kamalakannan.r@intel.com>
Subject: [PATCH V6 16/17] examples/pipelines: remove obsolete tap CLI command
Date: Thu, 28 Jul 2022 15:11:46 +0000	[thread overview]
Message-ID: <20220728151147.603265-17-cristian.dumitrescu@intel.com> (raw)
In-Reply-To: <20220728151147.603265-1-cristian.dumitrescu@intel.com>

Remove the tap CLI command, as the file descriptor I/O ports of the
pipeline are now configured trough the I/O specification file.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Kamalakannan R. <kamalakannan.r@intel.com>
---
 examples/pipeline/cli.c | 37 -----------------
 examples/pipeline/obj.c | 89 -----------------------------------------
 examples/pipeline/obj.h | 18 ---------
 3 files changed, 144 deletions(-)

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index d56a830fb7..75c32b9089 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -466,32 +466,6 @@ cmd_ring(char **tokens,
 	}
 }
 
-static const char cmd_tap_help[] =
-"tap <tap_name>\n";
-
-static void
-cmd_tap(char **tokens,
-	uint32_t n_tokens,
-	char *out,
-	size_t out_size,
-	void *obj)
-{
-	struct tap *tap;
-	char *name;
-
-	if (n_tokens < 2) {
-		snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
-		return;
-	}
-	name = tokens[1];
-
-	tap = tap_create(obj, name);
-	if (tap == NULL) {
-		snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
-		return;
-	}
-}
-
 static const char cmd_pipeline_codegen_help[] =
 "pipeline codegen <spec_file> <code_file>\n";
 
@@ -2645,7 +2619,6 @@ cmd_help(char **tokens,
 			"List of commands:\n"
 			"\tmempool\n"
 			"\tethdev\n"
-			"\ttap\n"
 			"\tpipeline codegen\n"
 			"\tpipeline libbuild\n"
 			"\tpipeline build\n"
@@ -2690,11 +2663,6 @@ cmd_help(char **tokens,
 		return;
 	}
 
-	if (strcmp(tokens[0], "tap") == 0) {
-		snprintf(out, out_size, "\n%s\n", cmd_tap_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);
@@ -2950,11 +2918,6 @@ cli_process(char *in, char *out, size_t out_size, void *obj)
 		return;
 	}
 
-	if (strcmp(tokens[0], "tap") == 0) {
-		cmd_tap(tokens, n_tokens, out, out_size, obj);
-		return;
-	}
-
 	if (strcmp(tokens[0], "pipeline") == 0) {
 		if ((n_tokens >= 3) &&
 			(strcmp(tokens[1], "codegen") == 0)) {
diff --git a/examples/pipeline/obj.c b/examples/pipeline/obj.c
index 950ab831fb..b7e2316eec 100644
--- a/examples/pipeline/obj.c
+++ b/examples/pipeline/obj.c
@@ -35,11 +35,6 @@ TAILQ_HEAD(link_list, link);
  */
 TAILQ_HEAD(ring_list, ring);
 
-/*
- * tap
- */
-TAILQ_HEAD(tap_list, tap);
-
 /*
  * obj
  */
@@ -47,7 +42,6 @@ struct obj {
 	struct mempool_list mempool_list;
 	struct link_list link_list;
 	struct ring_list ring_list;
-	struct tap_list tap_list;
 };
 
 /*
@@ -416,88 +410,6 @@ ring_find(struct obj *obj, const char *name)
 	return NULL;
 }
 
-/*
- * tap
- */
-#define TAP_DEV		"/dev/net/tun"
-
-struct tap *
-tap_find(struct obj *obj, const char *name)
-{
-	struct tap *tap;
-
-	if (!obj || !name)
-		return NULL;
-
-	TAILQ_FOREACH(tap, &obj->tap_list, node)
-		if (strcmp(tap->name, name) == 0)
-			return tap;
-
-	return NULL;
-}
-
-struct tap *
-tap_next(struct obj *obj, struct tap *tap)
-{
-	return (tap == NULL) ?
-		TAILQ_FIRST(&obj->tap_list) : TAILQ_NEXT(tap, node);
-}
-
-#ifndef RTE_EXEC_ENV_LINUX
-
-struct tap *
-tap_create(struct obj *obj __rte_unused, const char *name __rte_unused)
-{
-	return NULL;
-}
-
-#else
-
-struct tap *
-tap_create(struct obj *obj, const char *name)
-{
-	struct tap *tap;
-	struct ifreq ifr;
-	int fd, status;
-
-	/* Check input params */
-	if ((name == NULL) ||
-		tap_find(obj, name))
-		return NULL;
-
-	/* Resource create */
-	fd = open(TAP_DEV, O_RDWR | O_NONBLOCK);
-	if (fd < 0)
-		return NULL;
-
-	memset(&ifr, 0, sizeof(ifr));
-	ifr.ifr_flags = IFF_TAP | IFF_NO_PI; /* No packet information */
-	strlcpy(ifr.ifr_name, name, IFNAMSIZ);
-
-	status = ioctl(fd, TUNSETIFF, (void *) &ifr);
-	if (status < 0) {
-		close(fd);
-		return NULL;
-	}
-
-	/* Node allocation */
-	tap = calloc(1, sizeof(struct tap));
-	if (tap == NULL) {
-		close(fd);
-		return NULL;
-	}
-	/* Node fill in */
-	strlcpy(tap->name, name, sizeof(tap->name));
-	tap->fd = fd;
-
-	/* Node add to list */
-	TAILQ_INSERT_TAIL(&obj->tap_list, tap, node);
-
-	return tap;
-}
-
-#endif
-
 /*
  * obj
  */
@@ -513,7 +425,6 @@ obj_init(void)
 	TAILQ_INIT(&obj->mempool_list);
 	TAILQ_INIT(&obj->link_list);
 	TAILQ_INIT(&obj->ring_list);
-	TAILQ_INIT(&obj->tap_list);
 
 	return obj;
 }
diff --git a/examples/pipeline/obj.h b/examples/pipeline/obj.h
index af270a8e57..8ea1c414c2 100644
--- a/examples/pipeline/obj.h
+++ b/examples/pipeline/obj.h
@@ -121,22 +121,4 @@ ring_create(struct obj *obj,
 struct ring *
 ring_find(struct obj *obj, const char *name);
 
-/*
- * tap
- */
-struct tap {
-	TAILQ_ENTRY(tap) node;
-	char name[NAME_SIZE];
-	int fd;
-};
-
-struct tap *
-tap_find(struct obj *obj, const char *name);
-
-struct tap *
-tap_next(struct obj *obj, struct tap *tap);
-
-struct tap *
-tap_create(struct obj *obj, const char *name);
-
 #endif /* _INCLUDE_OBJ_H_ */
-- 
2.34.1


  parent reply	other threads:[~2022-07-28 15:13 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 13:07 [PATCH 1/9] pipeline: move specification data structures to internal header Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 2/9] pipeline: add pipeline specification data structure Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 3/9] pipeline: rework the specification file-based pipeline build Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 4/9] pipeline: generate the code for pipeline specification structure Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 5/9] pipeline: add API for pipeline code generation Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 6/9] pipeline: add API for shared library-based pipeline build Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 7/9] examples/pipeline: add CLI command for pipeline code generation Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 8/9] examples/pipeline: add CLI command for shared library build Cristian Dumitrescu
2022-07-18 13:07 ` [PATCH 9/9] examples/pipeline: call CLI commands for code generation and build Cristian Dumitrescu
2022-07-18 13:25 ` [PATCH V2 1/9] pipeline: move specification data structures to internal header Cristian Dumitrescu
2022-07-18 13:25   ` [PATCH V2 2/9] pipeline: add pipeline specification data structure Cristian Dumitrescu
2022-07-18 13:25   ` [PATCH V2 3/9] pipeline: rework the specification file-based pipeline build Cristian Dumitrescu
2022-07-18 13:25   ` [PATCH V2 4/9] pipeline: generate the code for pipeline specification structure Cristian Dumitrescu
2022-07-18 13:25   ` [PATCH V2 5/9] pipeline: add API for pipeline code generation Cristian Dumitrescu
2022-07-18 13:26   ` [PATCH V2 6/9] pipeline: add API for shared library-based pipeline build Cristian Dumitrescu
2022-07-18 13:26   ` [PATCH V2 7/9] examples/pipeline: add CLI command for pipeline code generation Cristian Dumitrescu
2022-07-18 13:26   ` [PATCH V2 8/9] examples/pipeline: add CLI command for shared library build Cristian Dumitrescu
2022-07-18 13:26   ` [PATCH V2 9/9] examples/pipeline: call CLI commands for code generation and build Cristian Dumitrescu
2022-07-27 22:36   ` [PATCH V3 01/17] pipeline: add pipeline name Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 02/17] pipeline: move specification data structures to internal header Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 03/17] pipeline: add pipeline specification data structure Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 04/17] pipeline: rework the specification file-based pipeline build Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 05/17] pipeline: generate the code for pipeline specification structure Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 06/17] pipeline: add support for pipeline I/O specification Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 07/17] pipeline: add API for pipeline code generation Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 08/17] pipeline: add API for shared library-based pipeline build Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 09/17] examples/pipeline: add CLI command for pipeline code generation Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 10/17] examples/pipeline: add CLI command for shared library build Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 11/17] examples/pipeline: remove the obsolete pipeline create CLI command Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 12/17] examples/pipeline: remove the obsolete port configuration CLI commands Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 13/17] examples/pipeline: remove the obsolete mirroring configuration CLI command Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 14/17] examples/pipeline: use the pipeline name query API Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 15/17] examples/pipeline: rework the link CLI command Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 16/17] examples/pipelines: remove obsolete tap " Cristian Dumitrescu
2022-07-27 22:36     ` [PATCH V3 17/17] examples/pipeline: call the code generation and build CLI commands Cristian Dumitrescu
2022-07-27 22:54     ` [PATCH V4 01/17] pipeline: add pipeline name Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 02/17] pipeline: move specification data structures to internal header Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 03/17] pipeline: add pipeline specification data structure Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 04/17] pipeline: rework the specification file-based pipeline build Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 05/17] pipeline: generate the code for pipeline specification structure Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 06/17] pipeline: add support for pipeline I/O specification Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 07/17] pipeline: add API for pipeline code generation Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 08/17] pipeline: add API for shared library-based pipeline build Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 09/17] examples/pipeline: add CLI command for pipeline code generation Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 10/17] examples/pipeline: add CLI command for shared library build Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 11/17] examples/pipeline: remove the obsolete pipeline create CLI command Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 12/17] examples/pipeline: remove the obsolete port configuration CLI commands Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 13/17] examples/pipeline: remove the obsolete mirroring configuration CLI command Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 14/17] examples/pipeline: use the pipeline name query API Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 15/17] examples/pipeline: rework the link CLI command Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 16/17] examples/pipelines: remove obsolete tap " Cristian Dumitrescu
2022-07-27 22:54       ` [PATCH V4 17/17] examples/pipeline: call the code generation and build CLI commands Cristian Dumitrescu
2022-07-27 23:01       ` [PATCH V5 01/17] pipeline: add pipeline name Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 02/17] pipeline: move specification data structures to internal header Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 03/17] pipeline: add pipeline specification data structure Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 04/17] pipeline: rework the specification file-based pipeline build Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 05/17] pipeline: generate the code for pipeline specification structure Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 06/17] pipeline: add support for pipeline I/O specification Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 07/17] pipeline: add API for pipeline code generation Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 08/17] pipeline: add API for shared library-based pipeline build Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 09/17] examples/pipeline: add CLI command for pipeline code generation Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 10/17] examples/pipeline: add CLI command for shared library build Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 11/17] examples/pipeline: remove the obsolete pipeline create CLI command Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 12/17] examples/pipeline: remove the obsolete port configuration CLI commands Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 13/17] examples/pipeline: remove the obsolete mirroring configuration CLI command Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 14/17] examples/pipeline: use the pipeline name query API Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 15/17] examples/pipeline: rework the link CLI command Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 16/17] examples/pipelines: remove obsolete tap " Cristian Dumitrescu
2022-07-27 23:01         ` [PATCH V5 17/17] examples/pipeline: call the code generation and build CLI commands Cristian Dumitrescu
2022-07-28  8:22         ` [PATCH V5 01/17] pipeline: add pipeline name Bruce Richardson
2022-07-28 15:17           ` Dumitrescu, Cristian
2022-07-28 15:11 ` [PATCH V6 00/17] pipeline: pipeline configuration and build improvements Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 01/17] pipeline: add pipeline name Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 02/17] pipeline: move specification data structures to internal header Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 03/17] pipeline: add pipeline specification data structure Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 04/17] pipeline: rework the specification file-based pipeline build Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 05/17] pipeline: generate the code for pipeline specification structure Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 06/17] pipeline: add support for pipeline I/O specification Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 07/17] pipeline: add API for pipeline code generation Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 08/17] pipeline: add API for shared library-based pipeline build Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 09/17] examples/pipeline: add CLI command for pipeline code generation Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 10/17] examples/pipeline: add CLI command for shared library build Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 11/17] examples/pipeline: remove the obsolete pipeline create CLI command Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 12/17] examples/pipeline: remove the obsolete port configuration CLI commands Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 13/17] examples/pipeline: remove the obsolete mirroring configuration CLI command Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 14/17] examples/pipeline: use the pipeline name query API Cristian Dumitrescu
2022-07-28 15:11   ` [PATCH V6 15/17] examples/pipeline: rework the link CLI command Cristian Dumitrescu
2022-07-28 15:11   ` Cristian Dumitrescu [this message]
2022-07-28 15:11   ` [PATCH V6 17/17] examples/pipeline: call the code generation and build CLI commands Cristian Dumitrescu
2022-09-15 15:54   ` [PATCH V6 00/17] pipeline: pipeline configuration and build improvements Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220728151147.603265-17-cristian.dumitrescu@intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=kamalakannan.r@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).