From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] app/testpmd: add bus info when display port info Date: Tue, 02 May 2017 11:30:43 +0200 Message-ID: <1665927.oW9BhQAo5K@xps> References: <1493181099-14232-1-git-send-email-yulong.pei@intel.com> <2267864.xljogAfNJv@xps> <188971FCDA171749BED5DA74ABF3E6F03B6C56DC@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Wu, Jingjing" To: "Pei, Yulong" Return-path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 2098137A2 for ; Tue, 2 May 2017 11:30:45 +0200 (CEST) In-Reply-To: <188971FCDA171749BED5DA74ABF3E6F03B6C56DC@shsmsx102.ccr.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 02/05/2017 03:58, Pei, Yulong: > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > 26/04/2017 06:31, Yulong Pei: > > > Display pci device bus info when show port info. > > > > > > Signed-off-by: Yulong Pei > > > --- > > > --- a/app/test-pmd/config.c > > > +++ b/app/test-pmd/config.c > > > @@ -469,6 +469,14 @@ port_infos_display(portid_t port_id) > > > > > > print_ethaddr("MAC address: ", &mac_addr); > > > printf("\nDriver name: %s", dev_info.driver_name); > > > printf("\nConnect to socket: %u", port->socket_id); > > > > > > + if (dev_info.pci_dev) > > > + printf("\nBus-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 > > > + printf("\nBus-info: N/A"); > > > > The bus information must be managed in a more generic way. > > The field pci_dev will probably be removed in a next release. > > Could you kind to tell me more information about what does "more generic way" mean ? It means we should not have a PCI field in ethdev. We should have a function to print a bus info in each bus implementation, and a generic function taking a rte_device object would call the right bus-specific function via a function pointer.