DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chenbo Xia <chenbo.xia@intel.com>
To: dev@dpdk.org, david.marchand@redhat.com
Cc: stable@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH v2 5/7] kni: remove unused PCI info from test and example
Date: Sat, 18 Sep 2021 10:24:41 +0800	[thread overview]
Message-ID: <20210918022443.12719-6-chenbo.xia@intel.com> (raw)
In-Reply-To: <20210918022443.12719-1-chenbo.xia@intel.com>

PCI device id and address in structure rte_kni_conf are never used
in the test, example and kni library. So remove the related code.

Fixes: ea6b39b5b847 ("kni: remove ethtool support")
Cc: stable@dpdk.org

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test/test_kni.c        | 57 --------------------------------------
 examples/ip_pipeline/kni.c | 16 -----------
 2 files changed, 73 deletions(-)

diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 96733554b6..aa9a316c50 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -25,7 +25,6 @@ test_kni(void)
 #include <rte_string_fns.h>
 #include <rte_mempool.h>
 #include <rte_ethdev.h>
-#include <rte_bus_pci.h>
 #include <rte_cycles.h>
 #include <rte_kni.h>
 
@@ -424,32 +423,14 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)
 	unsigned i;
 	struct rte_kni *kni;
 	struct rte_kni_conf conf;
-	struct rte_eth_dev_info info;
 	struct rte_kni_ops ops;
-	const struct rte_pci_device *pci_dev;
-	const struct rte_bus *bus = NULL;
 
 	if (!mp)
 		return -1;
 
 	memset(&conf, 0, sizeof(conf));
-	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
 
-	ret = rte_eth_dev_info_get(port_id, &info);
-	if (ret != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port_id, strerror(-ret));
-		return -1;
-	}
-
-	if (info.device)
-		bus = rte_bus_find_by_device(info.device);
-	if (bus && !strcmp(bus->name, "pci")) {
-		pci_dev = RTE_DEV_TO_PCI(info.device);
-		conf.addr = pci_dev->addr;
-		conf.id = pci_dev->id;
-	}
 	snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
 
 	/* core id 1 configured for kernel thread */
@@ -543,10 +524,7 @@ test_kni(void)
 	struct rte_kni *kni;
 	struct rte_mempool *mp;
 	struct rte_kni_conf conf;
-	struct rte_eth_dev_info info;
 	struct rte_kni_ops ops;
-	const struct rte_pci_device *pci_dev;
-	const struct rte_bus *bus;
 	FILE *fd;
 	DIR *dir;
 	char buf[16];
@@ -634,26 +612,9 @@ test_kni(void)
 	fclose(fd);
 
 	/* test of allocating KNI with NULL mempool pointer */
-	memset(&info, 0, sizeof(info));
 	memset(&conf, 0, sizeof(conf));
 	memset(&ops, 0, sizeof(ops));
 
-	ret = rte_eth_dev_info_get(port_id, &info);
-	if (ret != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port_id, strerror(-ret));
-		return -1;
-	}
-
-	if (info.device)
-		bus = rte_bus_find_by_device(info.device);
-	else
-		bus = NULL;
-	if (bus && !strcmp(bus->name, "pci")) {
-		pci_dev = RTE_DEV_TO_PCI(info.device);
-		conf.addr = pci_dev->addr;
-		conf.id = pci_dev->id;
-	}
 	conf.group_id = port_id;
 	conf.mbuf_size = MAX_PACKET_SZ;
 
@@ -678,26 +639,8 @@ test_kni(void)
 
 	/* test of allocating KNI without a name */
 	memset(&conf, 0, sizeof(conf));
-	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
 
-	ret = rte_eth_dev_info_get(port_id, &info);
-	if (ret != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port_id, strerror(-ret));
-		ret = -1;
-		goto fail;
-	}
-
-	if (info.device)
-		bus = rte_bus_find_by_device(info.device);
-	else
-		bus = NULL;
-	if (bus && !strcmp(bus->name, "pci")) {
-		pci_dev = RTE_DEV_TO_PCI(info.device);
-		conf.addr = pci_dev->addr;
-		conf.id = pci_dev->id;
-	}
 	conf.group_id = port_id;
 	conf.mbuf_size = MAX_PACKET_SZ;
 
diff --git a/examples/ip_pipeline/kni.c b/examples/ip_pipeline/kni.c
index a2d3331cb0..fccecc3dc6 100644
--- a/examples/ip_pipeline/kni.c
+++ b/examples/ip_pipeline/kni.c
@@ -6,7 +6,6 @@
 #include <string.h>
 
 #include <rte_ethdev.h>
-#include <rte_bus_pci.h>
 #include <rte_string_fns.h>
 
 #include "kni.h"
@@ -100,16 +99,12 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
 struct kni *
 kni_create(const char *name, struct kni_params *params)
 {
-	struct rte_eth_dev_info dev_info;
 	struct rte_kni_conf kni_conf;
 	struct rte_kni_ops kni_ops;
 	struct kni *kni;
 	struct mempool *mempool;
 	struct link *link;
 	struct rte_kni *k;
-	const struct rte_pci_device *pci_dev;
-	const struct rte_bus *bus = NULL;
-	int ret;
 
 	/* Check input params */
 	if ((name == NULL) ||
@@ -124,23 +119,12 @@ kni_create(const char *name, struct kni_params *params)
 		return NULL;
 
 	/* Resource create */
-	ret = rte_eth_dev_info_get(link->port_id, &dev_info);
-	if (ret != 0)
-		return NULL;
-
 	memset(&kni_conf, 0, sizeof(kni_conf));
 	strlcpy(kni_conf.name, name, RTE_KNI_NAMESIZE);
 	kni_conf.force_bind = params->force_bind;
 	kni_conf.core_id = params->thread_id;
 	kni_conf.group_id = link->port_id;
 	kni_conf.mbuf_size = mempool->buffer_size;
-	if (dev_info.device)
-		bus = rte_bus_find_by_device(dev_info.device);
-	if (bus && !strcmp(bus->name, "pci")) {
-		pci_dev = RTE_DEV_TO_PCI(dev_info.device);
-		kni_conf.addr = pci_dev->addr;
-		kni_conf.id = pci_dev->id;
-	}
 
 	memset(&kni_ops, 0, sizeof(kni_ops));
 	kni_ops.port_id = link->port_id;
-- 
2.17.1


  parent reply	other threads:[~2021-09-18  2:39 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10  2:23 [dpdk-dev] [PATCH 0/8] Removal of PCI bus ABIs Chenbo Xia
2021-09-10  2:23 ` [dpdk-dev] [PATCH 1/8] bus/pci: add new memory resource access APIs Chenbo Xia
2021-09-13 11:59   ` Kinsella, Ray
2021-09-10  2:23 ` [dpdk-dev] [PATCH 2/8] app/testpmd: use PCI " Chenbo Xia
2021-09-16  6:10   ` Li, Xiaoyun
2021-09-16  6:38     ` Xia, Chenbo
2021-09-10  2:23 ` [dpdk-dev] [PATCH 3/8] examples/ethtool: use PCI library API to get PCI address Chenbo Xia
2021-09-10  2:23 ` [dpdk-dev] [PATCH 4/8] examples/kni: remove unused PCI bus header Chenbo Xia
2021-09-17 15:38   ` Ferruh Yigit
2021-09-10  2:23 ` [dpdk-dev] [PATCH 5/8] test/kni: remove setting of PCI ID and address Chenbo Xia
2021-09-10  7:12   ` David Marchand
2021-09-17 15:38   ` Ferruh Yigit
2021-09-10  2:24 ` [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: " Chenbo Xia
2021-09-10  7:18   ` David Marchand
2021-09-10  8:21     ` Xia, Chenbo
2021-09-17  3:09     ` Xia, Chenbo
2021-09-17 11:55       ` David Marchand
2021-09-17 15:37         ` Ferruh Yigit
2021-09-10  2:24 ` [dpdk-dev] [PATCH 7/8] kni: replace unused variable definition with reserved bytes Chenbo Xia
2021-09-10  2:24 ` [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus Chenbo Xia
2021-09-13 12:06   ` Kinsella, Ray
2021-09-14  8:15   ` Xu, Rosen
2021-09-18  2:24 ` [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs Chenbo Xia
2021-09-18  2:24   ` [dpdk-dev] [PATCH v2 1/7] bus/pci: add new memory resource access APIs Chenbo Xia
2021-09-18  2:24   ` [dpdk-dev] [PATCH v2 2/7] app/testpmd: use PCI " Chenbo Xia
2021-09-18  2:44     ` Li, Xiaoyun
2021-09-18  2:24   ` [dpdk-dev] [PATCH v2 3/7] examples/ethtool: use PCI library API to get PCI address Chenbo Xia
2021-09-18  2:24   ` [dpdk-dev] [PATCH v2 4/7] examples/kni: remove unused PCI bus header Chenbo Xia
2021-09-18  2:24   ` Chenbo Xia [this message]
2021-09-18  2:24   ` [dpdk-dev] [PATCH v2 6/7] kni: replace unused variable definition with reserved bytes Chenbo Xia
2021-09-18  2:24   ` [dpdk-dev] [PATCH v2 7/7] bus/pci: remove ABIs in PCI bus Chenbo Xia
2021-09-29  7:38   ` [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs Xia, Chenbo
2021-09-30  8:45     ` David Marchand
2021-10-04 13:37       ` David Marchand
2021-10-04 15:56         ` Harris, James R
2021-10-06  4:25           ` Xia, Chenbo
2021-10-08  6:15             ` Liu, Changpeng
2021-10-08  7:08               ` David Marchand
2021-10-08  7:44                 ` Liu, Changpeng
2021-10-11  6:58                   ` Xia, Chenbo
2021-10-11 12:55                     ` Thomas Monjalon
2021-10-12  0:35                       ` Harris, James R
2021-10-12  7:04                         ` Thomas Monjalon
2021-10-12 16:59                           ` Walker, Benjamin
2021-10-12 18:43                             ` Thomas Monjalon
2021-10-12 19:26                               ` Walker, Benjamin
2021-10-12 21:50                                 ` Thomas Monjalon
2021-10-13 17:56                                   ` Walker, Benjamin
2021-10-13 18:59                                     ` Thomas Monjalon
2021-10-13 22:48                                       ` Walker, Benjamin
2021-10-14  6:41                                         ` Thomas Monjalon
2022-07-11 12:11                                           ` Thomas Monjalon
2021-10-14  2:21                                       ` Xia, Chenbo
2021-10-14  6:41                                         ` Thomas Monjalon
2021-10-14  7:00                                           ` Xia, Chenbo
2021-10-14  7:07                                             ` Thomas Monjalon
2021-10-14  8:07                                               ` Xia, Chenbo
2021-10-14  8:25                                                 ` Thomas Monjalon
2021-10-27 12:03                                                   ` Xia, Chenbo

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=20210918022443.12719-6-chenbo.xia@intel.com \
    --to=chenbo.xia@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nhorman@tuxdriver.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).