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 25A90A0548; Fri, 10 Sep 2021 04:38:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19785410E8; Fri, 10 Sep 2021 04:38:10 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 93432410E8 for ; Fri, 10 Sep 2021 04:38:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="243292323" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="243292323" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 19:38:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540096607" Received: from npg-dpdk-virtio-xiachenbo-nw.sh.intel.com ([10.67.119.53]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2021 19:38:06 -0700 From: Chenbo Xia To: dev@dpdk.org Cc: Ferruh Yigit Date: Fri, 10 Sep 2021 10:23:59 +0800 Message-Id: <20210910022402.26620-6-chenbo.xia@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210910022402.26620-1-chenbo.xia@intel.com> References: <20210910022402.26620-1-chenbo.xia@intel.com> Subject: [dpdk-dev] [PATCH 5/8] test/kni: remove setting of PCI ID and address 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 Sender: "dev" PCI device id and address in structure rte_kni_conf are never used in the test and kni library. So remove the related code. Signed-off-by: Chenbo Xia --- app/test/test_kni.c | 57 --------------------------------------------- 1 file changed, 57 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 #include #include -#include #include #include @@ -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; -- 2.17.1