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 34DF7A0032; Thu, 1 Sep 2022 16:22:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B6AD42B8D; Thu, 1 Sep 2022 16:21:14 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 443094280E for ; Thu, 1 Sep 2022 16:21:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662042067; x=1693578067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PNkzkB7Pjcz00Pn5w1zrDD3jeaebPQgcUQFfR/KyJdI=; b=ktap/73coor9DZ6e/FN3yDovFH7tQEKttzGM3Hd6v76i2PSBU1vwHUhs u2g2tyYiYbUBq/AMofBEv5QCmEi/KJL2fzy3ymKrrJ+MRS5H7n6zkU4fb p0hc394tj89K0eIj+aLuQp3R3eilfvvPb4vVAMSzjLADtSQn3JsWtXMlC ZGNhDyiQNGkbDr6boPyqHFf2EtjNZNK0PpmWEcsT0ork7f0YUg4KHuhEQ EztmimTUQAK+ialJdkCkEC3CHL/L9arIjygorgsEZscEKvXX7rmPEV9IW ME7RfPZH+CdCYk4c4oWJRTJ4M3XMt8NGknuI48NWyb6LQHsaJ1r0aZuBS A==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="357444041" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="357444041" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 07:20:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="680870184" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by fmsmga004.fm.intel.com with ESMTP; 01 Sep 2022 07:20:50 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: Yogesh Jangra Subject: [PATCH V3 08/21] net/softnic: remove the list of Ethernet devices Date: Thu, 1 Sep 2022 14:20:28 +0000 Message-Id: <20220901142041.2628537-9-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220901142041.2628537-1-cristian.dumitrescu@intel.com> References: <20220804165839.1074817-1-cristian.dumitrescu@intel.com> <20220901142041.2628537-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 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 Signed-off-by: Yogesh Jangra --- 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 - * dev | port - */ -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 * 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 -#include - -#include -#include - -#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