From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 58776A00C5;
	Sat,  9 Jul 2022 10:27:26 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 7969242825;
	Sat,  9 Jul 2022 10:27:23 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by mails.dpdk.org (Postfix) with ESMTP id B069D40A81
 for <dev@dpdk.org>; Sat,  9 Jul 2022 10:27:22 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1657355242;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=nKG2gxnis7tK/eFPzuC9UNIVfAvuGKRtkvvQ/BjHsuM=;
 b=GK4uLVHRyAdRzwm3l5ljSn6vgstJfsoaTGnLrI3XJP3/IMj6e5BLbHxXUiVm+dC1aJwjeU
 4ng9cV1YQ4E0DiVUcFAGx/T/J3Dyhl6+POJ9+6KUXZc0TwcXQmGcsVWQXcFDgtpctmdW5c
 6p8yV4Yu1287hL9R5nRbOz7fjq3CXVs=
Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com
 [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-553-aCVxOCFCOs2Ukg9MuE0Mww-1; Sat, 09 Jul 2022 04:27:18 -0400
X-MC-Unique: aCVxOCFCOs2Ukg9MuE0Mww-1
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com
 [10.11.54.4])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA78D857A87;
 Sat,  9 Jul 2022 08:27:17 +0000 (UTC)
Received: from localhost.localdomain (unknown [10.40.192.194])
 by smtp.corp.redhat.com (Postfix) with ESMTP id 53C702026D64;
 Sat,  9 Jul 2022 08:27:17 +0000 (UTC)
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [RFC v2 v2 03/29] kni: stop populating PCI info in examples
Date: Sat,  9 Jul 2022 10:26:18 +0200
Message-Id: <20220709082644.664675-4-david.marchand@redhat.com>
In-Reply-To: <20220709082644.664675-1-david.marchand@redhat.com>
References: <20220628144643.1213026-1-david.marchand@redhat.com>
 <20220709082644.664675-1-david.marchand@redhat.com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="US-ASCII"; x-default=true
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

addr and id fields are deprecated and are not used in the kni library.
Stop populating them in in-tree examples.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_kni.c        | 30 ------------------------------
 examples/ip_pipeline/kni.c | 10 ----------
 2 files changed, 40 deletions(-)

diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 622315c8b1..4039da0b08 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>
 
@@ -426,8 +425,6 @@ test_kni_processing(uint16_t port_id, 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 = NULL;
 
 	if (!mp)
 		return -1;
@@ -443,13 +440,6 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)
 		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 */
@@ -545,8 +535,6 @@ test_kni(void)
 	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];
@@ -645,15 +633,6 @@ test_kni(void)
 		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;
 
@@ -689,15 +668,6 @@ test_kni(void)
 		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..cd02c39478 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"
@@ -107,8 +106,6 @@ kni_create(const char *name, struct kni_params *params)
 	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 */
@@ -134,13 +131,6 @@ kni_create(const char *name, struct kni_params *params)
 	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.36.1