All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Cc: Yogesh Jangra <yogesh.jangra@intel.com>
Subject: [PATCH V3 08/21] net/softnic: remove the list of Ethernet devices
Date: Thu,  1 Sep 2022 14:20:28 +0000	[thread overview]
Message-ID: <20220901142041.2628537-9-cristian.dumitrescu@intel.com> (raw)
In-Reply-To: <20220901142041.2628537-1-cristian.dumitrescu@intel.com>

The list of Ethernet devices within this driver is redundant, as the
DPDK global list of Ethernet devices can be used instead.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
---
 drivers/net/softnic/meson.build               |   1 -
 drivers/net/softnic/rte_eth_softnic.c         |   3 -
 drivers/net/softnic/rte_eth_softnic_cli.c     |  49 ---------
 .../net/softnic/rte_eth_softnic_internals.h   |  37 -------
 drivers/net/softnic/rte_eth_softnic_link.c    | 101 ------------------
 5 files changed, 191 deletions(-)
 delete mode 100644 drivers/net/softnic/rte_eth_softnic_link.c

diff --git a/drivers/net/softnic/meson.build b/drivers/net/softnic/meson.build
index f0cfc6dc17..0ffe26d671 100644
--- a/drivers/net/softnic/meson.build
+++ b/drivers/net/softnic/meson.build
@@ -11,7 +11,6 @@ sources = files(
         'parser.c',
         'rte_eth_softnic.c',
         'rte_eth_softnic_cli.c',
-        'rte_eth_softnic_link.c',
         'rte_eth_softnic_mempool.c',
         'rte_eth_softnic_pipeline.c',
         'rte_eth_softnic_swq.c',
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index a940952c7a..b1f4edd629 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -160,7 +160,6 @@ pmd_dev_stop(struct rte_eth_dev *dev)
 	/* Firmware */
 	softnic_pipeline_disable_all(p);
 	softnic_pipeline_free(p);
-	softnic_link_free(p);
 	softnic_softnic_swq_free_keep_rxq_txq(p);
 	softnic_mempool_free(p);
 
@@ -178,7 +177,6 @@ pmd_free(struct pmd_internals *p)
 
 	softnic_thread_free(p);
 	softnic_pipeline_free(p);
-	softnic_link_free(p);
 	softnic_swq_free(p);
 	softnic_mempool_free(p);
 
@@ -256,7 +254,6 @@ pmd_init(struct pmd_params *params)
 	/* Resources */
 	softnic_mempool_init(p);
 	softnic_swq_init(p);
-	softnic_link_init(p);
 	softnic_pipeline_init(p);
 
 	status = softnic_thread_init(p);
diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c
index 2b00b65c6c..ec9ac133b9 100644
--- a/drivers/net/softnic/rte_eth_softnic_cli.c
+++ b/drivers/net/softnic/rte_eth_softnic_cli.c
@@ -102,50 +102,6 @@ cmd_mempool(struct pmd_internals *softnic,
 	}
 }
 
-/**
- * link <link_name>
- *    dev <device_name> | port <port_id>
- */
-static void
-cmd_link(struct pmd_internals *softnic,
-	char **tokens,
-	uint32_t n_tokens,
-	char *out,
-	size_t out_size)
-{
-	struct softnic_link_params p;
-	struct softnic_link *link;
-	char *name;
-
-	memset(&p, 0, sizeof(p));
-
-	if (n_tokens != 4) {
-		snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
-		return;
-	}
-	name = tokens[1];
-
-	if (strcmp(tokens[2], "dev") == 0) {
-		p.dev_name = tokens[3];
-	} else if (strcmp(tokens[2], "port") == 0) {
-		p.dev_name = NULL;
-
-		if (softnic_parser_read_uint16(&p.port_id, tokens[3]) != 0) {
-			snprintf(out, out_size, MSG_ARG_INVALID, "port_id");
-			return;
-		}
-	} else {
-		snprintf(out, out_size, MSG_ARG_NOT_FOUND, "dev or port");
-		return;
-	}
-
-	link = softnic_link_create(softnic, name, &p);
-	if (link == NULL) {
-		snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
-		return;
-	}
-}
-
 /**
  * swq <swq_name>
  *  size <size>
@@ -309,11 +265,6 @@ softnic_cli_process(char *in, char *out, size_t out_size, void *arg)
 		return;
 	}
 
-	if (strcmp(tokens[0], "link") == 0) {
-		cmd_link(softnic, tokens, n_tokens, out, out_size);
-		return;
-	}
-
 	if (strcmp(tokens[0], "swq") == 0) {
 		cmd_swq(softnic, tokens, n_tokens, out, out_size);
 		return;
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index d817883a39..a1c2309589 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -70,24 +70,6 @@ struct softnic_swq {
 
 TAILQ_HEAD(softnic_swq_list, softnic_swq);
 
-/**
- * LINK
- */
-struct softnic_link_params {
-	const char *dev_name;
-	uint16_t port_id; /**< Valid only when *dev_name* is NULL. */
-};
-
-struct softnic_link {
-	TAILQ_ENTRY(softnic_link) node;
-	char name[NAME_SIZE];
-	uint16_t port_id;
-	uint32_t n_rxq;
-	uint32_t n_txq;
-};
-
-TAILQ_HEAD(softnic_link_list, softnic_link);
-
 /**
  * Pipeline
  */
@@ -162,7 +144,6 @@ struct pmd_internals {
 	struct softnic_conn *conn;
 	struct softnic_mempool_list mempool_list;
 	struct softnic_swq_list swq_list;
-	struct softnic_link_list link_list;
 	struct pipeline_list pipeline_list;
 	struct softnic_thread thread[RTE_MAX_LCORE];
 	struct softnic_thread_data thread_data[RTE_MAX_LCORE];
@@ -223,24 +204,6 @@ softnic_swq_create(struct pmd_internals *p,
 	const char *name,
 	struct softnic_swq_params *params);
 
-/**
- * LINK
- */
-int
-softnic_link_init(struct pmd_internals *p);
-
-void
-softnic_link_free(struct pmd_internals *p);
-
-struct softnic_link *
-softnic_link_find(struct pmd_internals *p,
-	const char *name);
-
-struct softnic_link *
-softnic_link_create(struct pmd_internals *p,
-	const char *name,
-	struct softnic_link_params *params);
-
 /**
  * Pipeline
  */
diff --git a/drivers/net/softnic/rte_eth_softnic_link.c b/drivers/net/softnic/rte_eth_softnic_link.c
deleted file mode 100644
index 21a64069f6..0000000000
--- a/drivers/net/softnic/rte_eth_softnic_link.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2018 Intel Corporation
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <rte_ethdev.h>
-#include <rte_string_fns.h>
-
-#include "rte_eth_softnic_internals.h"
-
-int
-softnic_link_init(struct pmd_internals *p)
-{
-	TAILQ_INIT(&p->link_list);
-
-	return 0;
-}
-
-void
-softnic_link_free(struct pmd_internals *p)
-{
-	for ( ; ; ) {
-		struct softnic_link *link;
-
-		link = TAILQ_FIRST(&p->link_list);
-		if (link == NULL)
-			break;
-
-		TAILQ_REMOVE(&p->link_list, link, node);
-		free(link);
-	}
-}
-
-struct softnic_link *
-softnic_link_find(struct pmd_internals *p,
-	const char *name)
-{
-	struct softnic_link *link;
-
-	if (name == NULL)
-		return NULL;
-
-	TAILQ_FOREACH(link, &p->link_list, node)
-		if (strcmp(link->name, name) == 0)
-			return link;
-
-	return NULL;
-}
-
-struct softnic_link *
-softnic_link_create(struct pmd_internals *p,
-	const char *name,
-	struct softnic_link_params *params)
-{
-	struct rte_eth_dev_info port_info;
-	struct softnic_link *link;
-	uint16_t port_id;
-	int ret;
-
-	/* Check input params */
-	if (name == NULL ||
-		softnic_link_find(p, name) ||
-		params == NULL)
-		return NULL;
-
-	port_id = params->port_id;
-	if (params->dev_name) {
-		int status;
-
-		status = rte_eth_dev_get_port_by_name(params->dev_name,
-			&port_id);
-
-		if (status)
-			return NULL;
-	} else {
-		if (!rte_eth_dev_is_valid_port(port_id))
-			return NULL;
-	}
-
-	ret = rte_eth_dev_info_get(port_id, &port_info);
-	if (ret != 0)
-		return NULL;
-
-	/* Node allocation */
-	link = calloc(1, sizeof(struct softnic_link));
-	if (link == NULL)
-		return NULL;
-
-	/* Node fill in */
-	strlcpy(link->name, name, sizeof(link->name));
-	link->port_id = port_id;
-	link->n_rxq = port_info.nb_rx_queues;
-	link->n_txq = port_info.nb_tx_queues;
-
-	/* Node add to list */
-	TAILQ_INSERT_TAIL(&p->link_list, link, node);
-
-	return link;
-}
-- 
2.34.1


  parent reply	other threads:[~2022-09-01 14:22 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 16:58 [PATCH 00/21] net/softnic: replace the legacy pipeline with SWX pipeline Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 01/21] net/softnic: remove the traffic manager support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 02/21] net/softnic: remove flow support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 03/21] net/softnic: remove the meter support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 04/21] net/softnic: remove cryptodev support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 05/21] net/softnic: remove tap support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 06/21] net/softnic: remove the legacy pipeline CLI commands Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 07/21] net/softnic: replace the legacy pipeline with the SWX pipeline Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 08/21] net/softnic: remove the list of Ethernet devices Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 09/21] net/softnic: remove unused text parsing functions Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 10/21] net/softnic: add pipeline code generation CLI command Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 11/21] net/softnic: add pipeline library build " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 12/21] net/softnic: add pipeline " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 13/21] net/softnic: add pipeline table CLI commands Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 14/21] net/softnic: add pipeline selector " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 15/21] net/softnic: add pipeline learner " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 16/21] net/softnic: add pipeline commit and abort " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 17/21] net/softnic: add the pipeline register read/write " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 18/21] net/softnic: add the pipeline meter " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 19/21] net/softnic: add pipeline statistics CLI command Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 20/21] net/softnic: add pipeline mirroring " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 21/21] net/softnic: update the default device program Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 00/21] net/softnic: replace the legacy pipeline with SWX pipeline Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 01/21] net/softnic: remove the traffic manager support Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 02/21] net/softnic: remove flow support Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 03/21] net/softnic: remove the meter support Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 04/21] net/softnic: remove cryptodev support Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 05/21] net/softnic: remove tap support Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 06/21] net/softnic: remove the legacy pipeline CLI commands Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 07/21] net/softnic: replace the legacy pipeline with the SWX pipeline Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 08/21] net/softnic: remove the list of Ethernet devices Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 09/21] net/softnic: remove unused text parsing functions Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 10/21] net/softnic: add pipeline code generation CLI command Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 11/21] net/softnic: add pipeline library build " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 12/21] net/softnic: add pipeline " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 13/21] net/softnic: add pipeline table CLI commands Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 14/21] net/softnic: add pipeline selector " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 15/21] net/softnic: add pipeline learner " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 16/21] net/softnic: add pipeline commit and abort " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 17/21] net/softnic: add the pipeline register read/write " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 18/21] net/softnic: add the pipeline meter " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 19/21] net/softnic: add pipeline statistics CLI command Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 20/21] net/softnic: add pipeline mirroring " Cristian Dumitrescu
2022-08-26 13:17   ` [PATCH V2 21/21] net/softnic: update the default device program Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 00/21] net/softnic: replace the legacy pipeline with SWX pipeline Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 01/21] net/softnic: remove the traffic manager support Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 02/21] net/softnic: remove flow support Cristian Dumitrescu
2022-11-30 11:18     ` Ferruh Yigit
2022-12-01 11:27       ` Dumitrescu, Cristian
2022-09-01 14:20   ` [PATCH V3 03/21] net/softnic: remove the meter support Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 04/21] net/softnic: remove cryptodev support Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 05/21] net/softnic: remove tap support Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 06/21] net/softnic: remove the legacy pipeline CLI commands Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 07/21] net/softnic: replace the legacy pipeline with the SWX pipeline Cristian Dumitrescu
2022-09-01 14:20   ` Cristian Dumitrescu [this message]
2022-09-01 14:20   ` [PATCH V3 09/21] net/softnic: remove unused text parsing functions Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 10/21] net/softnic: add pipeline code generation CLI command Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 11/21] net/softnic: add pipeline library build " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 12/21] net/softnic: add pipeline " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 13/21] net/softnic: add pipeline table CLI commands Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 14/21] net/softnic: add pipeline selector " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 15/21] net/softnic: add pipeline learner " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 16/21] net/softnic: add pipeline commit and abort " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 17/21] net/softnic: add the pipeline register read/write " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 18/21] net/softnic: add the pipeline meter " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 19/21] net/softnic: add pipeline statistics CLI command Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 20/21] net/softnic: add pipeline mirroring " Cristian Dumitrescu
2022-09-01 14:20   ` [PATCH V3 21/21] net/softnic: update the default device program Cristian Dumitrescu
2022-09-21 11:48   ` [PATCH V3 00/21] net/softnic: replace the legacy pipeline with SWX pipeline 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=20220901142041.2628537-9-cristian.dumitrescu@intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=yogesh.jangra@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.