From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id 214B52C12 for ; Thu, 29 Mar 2018 08:17:26 +0200 (CEST) Received: by mail-lf0-f65.google.com with SMTP id u3-v6so6769810lff.5 for ; Wed, 28 Mar 2018 23:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=ecVxHvxMIFZRS/+OgmiD5KsaHCiGnNoyTxQzitg1ZZg=; b=VX8yNwXT5e0oh46ylpISErMIEDAY7tF8GQAuiKDxXw8SDi4TKvTskqnXt2T/JlSWZF nkT6qEBiV5j3G/mIafmFbu6sJPXXbM2WHq1D5qbQILrn41NHzudV484gXYlTlV7JR1RF to3y0jQwsyG8j1qrnPMF5i9+k3hDG4LNaTkMLiozr+nT98KjhcMGouAnbLLYUTRuUy4F wbDZkWSiaG80zdGMS/li/1J45AKfdbVnOLqAq9S/yYJxiZ3FJcXfcB+t4Ia+EIqom2Kv 5HgIwRMJjVjHvWnURsWY4bHyN7hYW5H6bLmykUFa5bQRImKktE3MYazBGt7drX3GPVkb eD7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=ecVxHvxMIFZRS/+OgmiD5KsaHCiGnNoyTxQzitg1ZZg=; b=hdH4X16EuI7t+sFZnT+QO4qddc3Y3y3FzrDsejM3+l1L1khjpqP3w3LCGU69aZGVur vgAgMJ2aZJ1YeuEfBjWStcn3et41IwDMhRoaBA30Zg/5koYXLKZwJpYpY2bo3QW3RXDU AQh5IuUyQu+QVWWS6fMHB5XTTtZYOJe8vImnhIYUsxoiGNS/WsRofg59bihNwQSKnMHm l49ybwKwAD8PVlOzAXTGso5w7kGtwTycIJA6pLtarKP8XjyqsDdbDkR110z/nJKXWi35 ApiE71FJX+MYw9plCB4UqHrIBB7HxMRvfN5dwsKRmSztcU6PLsDdZWgeRbqgmsrxE577 PsTQ== X-Gm-Message-State: AElRT7EQ3Mtb5qI7pH1uZ50woecr9dRjRBpz1tOPNneL11cyY0CCPrAY Matapum0SFdxwyc7WxpECogftQ== X-Google-Smtp-Source: AIpwx4+jKfkxj6TW7zrBagwJX+rw8/dk6LDI5Nbe35sG4BFgXhIzn2NEbPL3M+rxk1sS4lwn+lMrGQ== X-Received: by 10.46.99.93 with SMTP id x90mr4578179ljb.2.1522304245291; Wed, 28 Mar 2018 23:17:25 -0700 (PDT) Received: from localhost (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id a142-v6sm998497lfb.11.2018.03.28.23.17.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 23:17:24 -0700 (PDT) Date: Thu, 29 Mar 2018 08:17:23 +0200 From: Tomasz Duszynski To: Ferruh Yigit Cc: Wenzhuo Lu , Jingjing Wu , "John W. Linville" , Shepard Siegel , Ed Czeck , John Miller , Allain Legacy , Matt Peters , Harish Patil , Rasesh Mody , Ajit Khaparde , Somnath Kotur , Rahul Lakkireddy , Hemant Agrawal , Shreyansh Jain , Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , John Daley , Hyong Youb Kim , Qi Zhang , Xiao Wang , Beilei Xing , Konstantin Ananyev , Shijith Thotton , Srisivasubramanian Srinivasan , Adrien Mazarguil , Nelio Laranjeiro , Yongseok Koh , Jacek Siuda , Tomasz Duszynski , Dmitri Epshtein , Natalie Samsonov , Jianbo Liu , Alejandro Lucero , Tetsuya Mukawa , Santosh Shukla , Jerin Jacob , Shahed Shaikh , Bruce Richardson , Andrew Rybchenko , Matej Vido , Pascal Mazon , Maciej Czekaj , Maxime Coquelin , Tiwei Bie , Shrikrishna Khare , Remy Horton , Ori Kam , Pablo de Lara , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , Cristian Dumitrescu , Thomas Monjalon , dev@dpdk.org Message-ID: <20180329061723.GA31647@sh> References: <20180327174052.266285-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20180327174052.266285-1-ferruh.yigit@intel.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) X-Mailman-Approved-At: Thu, 29 Mar 2018 09:59:04 +0200 Subject: Re: [dpdk-dev] [PATCH] ethdev: replace bus specific struct with generic dev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2018 06:17:26 -0000 On Tue, Mar 27, 2018 at 06:40:52PM +0100, Ferruh Yigit wrote: > Public struct rte_eth_dev_info has a "struct rte_pci_device" field in it > although it is common for all ethdev in all buses. > > Replacing pci specific struct with generic device struct and updating > places that are using pci device in a way to get this information from > generic device. > > Signed-off-by: Ferruh Yigit > --- > Cc: Pablo de Lara > > There is no deprecation notice sent for this update but in this release > ethdev info already updated and ABI already broken, it can be good > opportunity for this update. > --- > app/test-pmd/config.c | 11 ++++++++++- > app/test-pmd/testpmd.h | 24 ++++++++++++++++++------ > drivers/net/af_packet/rte_eth_af_packet.c | 1 + > drivers/net/ark/ark_ethdev.c | 4 +++- > drivers/net/avf/avf_ethdev.c | 2 +- > drivers/net/avp/avp_ethdev.c | 2 +- > drivers/net/bnx2x/bnx2x_ethdev.c | 2 +- > drivers/net/bnxt/bnxt_ethdev.c | 2 +- > drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- > drivers/net/dpaa/dpaa_ethdev.c | 1 + > drivers/net/dpaa2/dpaa2_ethdev.c | 1 + > drivers/net/e1000/em_ethdev.c | 2 +- > drivers/net/e1000/igb_ethdev.c | 4 ++-- > drivers/net/ena/ena_ethdev.c | 2 +- > drivers/net/enic/enic_ethdev.c | 2 +- > drivers/net/fm10k/fm10k_ethdev.c | 2 +- > drivers/net/i40e/i40e_ethdev.c | 2 +- > drivers/net/i40e/i40e_ethdev_vf.c | 2 +- > drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++-- > drivers/net/kni/rte_eth_kni.c | 2 +- > drivers/net/liquidio/lio_ethdev.c | 2 +- > drivers/net/mlx4/mlx4_ethdev.c | 2 +- > drivers/net/mlx5/mlx5_ethdev.c | 2 +- > drivers/net/mrvl/mrvl_ethdev.c | 2 ++ > drivers/net/nfp/nfp_net.c | 2 +- > drivers/net/null/rte_eth_null.c | 1 + > drivers/net/octeontx/octeontx_ethdev.c | 2 +- > drivers/net/pcap/rte_eth_pcap.c | 1 + > drivers/net/qede/qede_ethdev.c | 2 +- > drivers/net/ring/rte_eth_ring.c | 1 + > drivers/net/sfc/sfc_ethdev.c | 2 +- > drivers/net/szedata2/rte_eth_szedata2.c | 2 +- > drivers/net/tap/rte_eth_tap.c | 2 +- > drivers/net/thunderx/nicvf_ethdev.c | 2 +- > drivers/net/virtio/virtio_ethdev.c | 2 +- > drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- > examples/ethtool/lib/rte_ethtool.c | 15 +++++++++------ > examples/ip_pipeline/init.c | 10 ++++++++-- > examples/kni/main.c | 10 +++++++--- > lib/librte_ether/rte_ethdev.h | 2 +- > test/test/test_kni.c | 28 ++++++++++++++++++++++---= --- > 41 files changed, 114 insertions(+), 54 deletions(-) > [...] > diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethde= v.c > index c0483b912..d46c65255 100644 > --- a/drivers/net/mrvl/mrvl_ethdev.c > +++ b/drivers/net/mrvl/mrvl_ethdev.c > @@ -1314,6 +1314,8 @@ static void > mrvl_dev_infos_get(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *info) > { > + info->device =3D dev->device; Since dev is used perhaps __rte_unused can be dropped. Besides that, Acked-by: Tomasz Duszynski > + > info->speed_capa =3D ETH_LINK_SPEED_10M | > ETH_LINK_SPEED_100M | > ETH_LINK_SPEED_1G | > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c > index 8591c7de0..add00baf9 100644 > --- a/drivers/net/nfp/nfp_net.c > +++ b/drivers/net/nfp/nfp_net.c > @@ -1159,7 +1159,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *dev_info) > > hw =3D NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > - dev_info->pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > + dev_info->device =3D dev->device; > dev_info->max_rx_queues =3D (uint16_t)hw->max_rx_queues; > dev_info->max_tx_queues =3D (uint16_t)hw->max_tx_queues; > dev_info->min_rx_bufsize =3D ETHER_MIN_MTU; > diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_n= ull.c > index 73fe8b04a..7506f77f6 100644 > --- a/drivers/net/null/rte_eth_null.c > +++ b/drivers/net/null/rte_eth_null.c > @@ -292,6 +292,7 @@ eth_dev_info(struct rte_eth_dev *dev, > return; > > internals =3D dev->data->dev_private; > + dev_info->device =3D dev->device; > dev_info->max_mac_addrs =3D 1; > dev_info->max_rx_pktlen =3D (uint32_t)-1; > dev_info->max_rx_queues =3D RTE_DIM(internals->rx_null_queues); > diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeont= x/octeontx_ethdev.c > index 90dd249a6..edd4dd3ff 100644 > --- a/drivers/net/octeontx/octeontx_ethdev.c > +++ b/drivers/net/octeontx/octeontx_ethdev.c > @@ -611,7 +611,7 @@ octeontx_dev_info(struct rte_eth_dev *dev, > dev_info->max_rx_queues =3D 1; > dev_info->max_tx_queues =3D PKO_MAX_NUM_DQ; > dev_info->min_rx_bufsize =3D 0; > - dev_info->pci_dev =3D NULL; > + dev_info->device =3D NULL; > > dev_info->default_rxconf =3D (struct rte_eth_rxconf) { > .rx_free_thresh =3D 0, > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_p= cap.c > index c1571e1fe..2e739a24e 100644 > --- a/drivers/net/pcap/rte_eth_pcap.c > +++ b/drivers/net/pcap/rte_eth_pcap.c > @@ -526,6 +526,7 @@ eth_dev_info(struct rte_eth_dev *dev, > { > struct pmd_internals *internals =3D dev->data->dev_private; > > + dev_info->device =3D dev->device; > dev_info->if_index =3D internals->if_index; > dev_info->max_mac_addrs =3D 1; > dev_info->max_rx_pktlen =3D (uint32_t) -1; > diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethde= v.c > index a91f43683..59d604b78 100644 > --- a/drivers/net/qede/qede_ethdev.c > +++ b/drivers/net/qede/qede_ethdev.c > @@ -1515,7 +1515,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev, > > PMD_INIT_FUNC_TRACE(edev); > > - dev_info->pci_dev =3D RTE_ETH_DEV_TO_PCI(eth_dev); > + dev_info->device =3D eth_dev->device; > dev_info->min_rx_bufsize =3D (uint32_t)QEDE_MIN_RX_BUFF_SIZE; > dev_info->max_rx_pktlen =3D (uint32_t)ETH_TX_MAX_NON_LSO_PKT_LEN; > dev_info->rx_desc_lim =3D qede_rx_desc_lim; > diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_r= ing.c > index df13c44be..14274fa36 100644 > --- a/drivers/net/ring/rte_eth_ring.c > +++ b/drivers/net/ring/rte_eth_ring.c > @@ -153,6 +153,7 @@ eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > struct pmd_internals *internals =3D dev->data->dev_private; > + dev_info->device =3D dev->device; > dev_info->max_mac_addrs =3D 1; > dev_info->max_rx_pktlen =3D (uint32_t)-1; > dev_info->max_rx_queues =3D (uint16_t)internals->max_rx_queues; > diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c > index f16d52081..2c0ad7ecf 100644 > --- a/drivers/net/sfc/sfc_ethdev.c > +++ b/drivers/net/sfc/sfc_ethdev.c > @@ -89,7 +89,7 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_e= th_dev_info *dev_info) > > sfc_log_init(sa, "entry"); > > - dev_info->pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > + dev_info->device =3D dev->device; > dev_info->max_rx_pktlen =3D EFX_MAC_PDU_MAX; > > /* Autonegotiation may be disabled */ > diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedat= a2/rte_eth_szedata2.c > index 1d02aee6f..4157cc88f 100644 > --- a/drivers/net/szedata2/rte_eth_szedata2.c > +++ b/drivers/net/szedata2/rte_eth_szedata2.c > @@ -1031,7 +1031,7 @@ eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > struct pmd_internals *internals =3D dev->data->dev_private; > - dev_info->pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > + dev_info->device =3D dev->device; > dev_info->if_index =3D 0; > dev_info->max_mac_addrs =3D 1; > dev_info->max_rx_pktlen =3D (uint32_t)-1; > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c > index 67ed9d466..23843e32e 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -688,7 +688,7 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_= dev_info *dev_info) > dev_info->max_rx_queues =3D RTE_PMD_TAP_MAX_QUEUES; > dev_info->max_tx_queues =3D RTE_PMD_TAP_MAX_QUEUES; > dev_info->min_rx_bufsize =3D 0; > - dev_info->pci_dev =3D NULL; > + dev_info->device =3D NULL; > dev_info->speed_capa =3D tap_dev_speed_capa(); > dev_info->rx_offload_capa =3D tap_rx_offload_get_port_capa(); > dev_info->tx_offload_capa =3D tap_tx_offload_get_port_capa(); > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/n= icvf_ethdev.c > index 067f2243b..f9e4a5810 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.c > +++ b/drivers/net/thunderx/nicvf_ethdev.c > @@ -1400,7 +1400,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct = rte_eth_dev_info *dev_info) > > PMD_INIT_FUNC_TRACE(); > > - dev_info->pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > + dev_info->device =3D dev->device; > > /* Autonegotiation may be disabled */ > dev_info->speed_capa =3D ETH_LINK_SPEED_FIXED; > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virt= io_ethdev.c > index 4dddb1c80..c623ce186 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -2057,7 +2057,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct= rte_eth_dev_info *dev_info) > > dev_info->speed_capa =3D ETH_LINK_SPEED_10G; /* fake value */ > > - dev_info->pci_dev =3D dev->device ? RTE_ETH_DEV_TO_PCI(dev) : NULL; > + dev_info->device =3D dev->device; > dev_info->max_rx_queues =3D > RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_RX_QUEUES); > dev_info->max_tx_queues =3D > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/v= mxnet3_ethdev.c > index 426008722..220668e19 100644 > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c > @@ -1025,7 +1025,7 @@ static void > vmxnet3_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > - dev_info->pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > + dev_info->device =3D dev->device; > > dev_info->max_rx_queues =3D VMXNET3_MAX_RX_QUEUES; > dev_info->max_tx_queues =3D VMXNET3_MAX_TX_QUEUES; > diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rt= e_ethtool.c > index 90dfbb739..4c770ec6a 100644 > --- a/examples/ethtool/lib/rte_ethtool.c > +++ b/examples/ethtool/lib/rte_ethtool.c > @@ -22,6 +22,8 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtoo= l_drvinfo *drvinfo) > { > struct rte_eth_dev_info dev_info; > struct rte_dev_reg_info reg_info; > + const struct rte_pci_device *pci_dev; > + const struct rte_bus *bus; > int n; > int ret; > > @@ -46,15 +48,16 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct etht= ool_drvinfo *drvinfo) > snprintf(drvinfo->version, sizeof(drvinfo->version), "%s", > rte_version()); > /* TODO: replace bus_info by rte_devargs.name */ > - if (dev_info.pci_dev) > + bus =3D rte_bus_find_by_device(dev_info.device); > + if (bus && !strcmp(bus->name, "pci")) { > + pci_dev =3D RTE_DEV_TO_PCI(dev_info.device); > snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info), > "%04x:%02x:%02x.%x", > - dev_info.pci_dev->addr.domain, > - dev_info.pci_dev->addr.bus, > - dev_info.pci_dev->addr.devid, > - dev_info.pci_dev->addr.function); > - else > + pci_dev->addr.domain, pci_dev->addr.bus, > + pci_dev->addr.devid, pci_dev->addr.function); > + } else { > snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info), "N/A"); > + } > > memset(®_info, 0, sizeof(reg_info)); > rte_eth_dev_get_reg_info(port_id, ®_info); > diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c > index bb07efa13..f57236b7a 100644 > --- a/examples/ip_pipeline/init.c > +++ b/examples/ip_pipeline/init.c > @@ -1266,6 +1266,8 @@ app_init_kni(struct app_params *app) { > struct rte_eth_dev_info dev_info; > struct app_mempool_params *mempool_params; > struct rte_mempool *mempool; > + const struct rte_pci_device *pci_dev; > + const struct rte_bus *bus; > struct rte_kni_conf conf; > struct rte_kni_ops ops; > > @@ -1297,8 +1299,12 @@ app_init_kni(struct app_params *app) { > } > conf.group_id =3D p_link->pmd_id; > conf.mbuf_size =3D mempool_params->buffer_size; > - conf.addr =3D dev_info.pci_dev->addr; > - conf.id =3D dev_info.pci_dev->id; > + bus =3D rte_bus_find_by_device(dev_info.device); > + if (bus && !strcmp(bus->name, "pci")) { > + pci_dev =3D RTE_DEV_TO_PCI(dev_info.device); > + conf.addr =3D pci_dev->addr; > + conf.id =3D pci_dev->id; > + } > > memset(&ops, 0, sizeof(ops)); > ops.port_id =3D (uint8_t) p_link->pmd_id; > diff --git a/examples/kni/main.c b/examples/kni/main.c > index 0d9980ee1..06eb74f6f 100644 > --- a/examples/kni/main.c > +++ b/examples/kni/main.c > @@ -834,13 +834,17 @@ kni_alloc(uint16_t port_id) > if (i =3D=3D 0) { > struct rte_kni_ops ops; > struct rte_eth_dev_info dev_info; > + const struct rte_pci_device *pci_dev; > + const struct rte_bus *bus; > > memset(&dev_info, 0, sizeof(dev_info)); > rte_eth_dev_info_get(port_id, &dev_info); > > - if (dev_info.pci_dev) { > - conf.addr =3D dev_info.pci_dev->addr; > - conf.id =3D dev_info.pci_dev->id; > + bus =3D rte_bus_find_by_device(dev_info.device); > + if (bus && !strcmp(bus->name, "pci")) { > + pci_dev =3D RTE_DEV_TO_PCI(dev_info.device); > + conf.addr =3D pci_dev->addr; > + conf.id =3D pci_dev->id; > } > /* Get the interface default mac address */ > rte_eth_macaddr_get(port_id, > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index ab1030d42..0ed903966 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -995,7 +995,7 @@ struct rte_pci_device; > * Ethernet device information > */ > struct rte_eth_dev_info { > - struct rte_pci_device *pci_dev; /**< Device PCI information. */ > + struct rte_device *device; /** Generic device information */ > const char *driver_name; /**< Device Driver name. */ > unsigned int if_index; /**< Index to bound host interface, or 0 if none. > Use if_indextoname() to translate into an interface name. */ > diff --git a/test/test/test_kni.c b/test/test/test_kni.c > index e4839cdb7..e23eb0837 100644 > --- a/test/test/test_kni.c > +++ b/test/test/test_kni.c > @@ -357,6 +357,8 @@ test_kni_processing(uint16_t port_id, struct rte_memp= ool *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; > > if (!mp) > return -1; > @@ -366,8 +368,12 @@ test_kni_processing(uint16_t port_id, struct rte_mem= pool *mp) > memset(&ops, 0, sizeof(ops)); > > rte_eth_dev_info_get(port_id, &info); > - conf.addr =3D info.pci_dev->addr; > - conf.id =3D info.pci_dev->id; > + bus =3D rte_bus_find_by_device(info.device); > + if (bus && !strcmp(bus->name, "pci")) { > + pci_dev =3D RTE_DEV_TO_PCI(info.device); > + conf.addr =3D pci_dev->addr; > + conf.id =3D pci_dev->id; > + } > snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT); > > /* core id 1 configured for kernel thread */ > @@ -465,6 +471,8 @@ 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; > > /* Initialize KNI subsytem */ > rte_kni_init(KNI_TEST_MAX_PORTS); > @@ -523,8 +531,12 @@ test_kni(void) > memset(&conf, 0, sizeof(conf)); > memset(&ops, 0, sizeof(ops)); > rte_eth_dev_info_get(port_id, &info); > - conf.addr =3D info.pci_dev->addr; > - conf.id =3D info.pci_dev->id; > + bus =3D rte_bus_find_by_device(info.device); > + if (bus && !strcmp(bus->name, "pci")) { > + pci_dev =3D RTE_DEV_TO_PCI(info.device); > + conf.addr =3D pci_dev->addr; > + conf.id =3D pci_dev->id; > + } > conf.group_id =3D port_id; > conf.mbuf_size =3D MAX_PACKET_SZ; > > @@ -552,8 +564,12 @@ test_kni(void) > memset(&info, 0, sizeof(info)); > memset(&ops, 0, sizeof(ops)); > rte_eth_dev_info_get(port_id, &info); > - conf.addr =3D info.pci_dev->addr; > - conf.id =3D info.pci_dev->id; > + bus =3D rte_bus_find_by_device(info.device); > + if (bus && !strcmp(bus->name, "pci")) { > + pci_dev =3D RTE_DEV_TO_PCI(info.device); > + conf.addr =3D pci_dev->addr; > + conf.id =3D pci_dev->id; > + } > conf.group_id =3D port_id; > conf.mbuf_size =3D MAX_PACKET_SZ; > > -- > 2.14.3 > -- - Tomasz Duszy=C5=84ski