From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A6EFB20873; Tue, 2 May 2017 05:30:44 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 02 May 2017 05:30:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=bmImrOZQjcOjGPI +iGoFsVVMAaPxdZAeT/+0kk1Oi8w=; b=rBTqJYwGOcF8jpetFydbHvvS/uZgu3R IQHP3xBEpV8aDj3oqbMrECPsUI0pr0J9Y9bmp8mUFXGW2bfD3VfZwyBKR+SSwiLd WpOFX2vf6ZzN2PsRPJrJzhn/XkasbtjcfhYEeoArMg9SsXs6prO5CCOTVodnMoIR Y3JwRSqk+OgY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=bmImrOZQjcOjGPI+iGoFsVVMAaPxdZAeT/+0kk1Oi8w=; b=qF9aPM0f 2NTXsxFf0mqSwL4LSdPfPFBj6t1sMTCd5fkbM13gMi9PM/ZVzcfVzfTek5pe1ZMO G/6Kv6zZQBkDPz0V56o1enXTv39U3XAlGlN6KBL2JbB9a3qvInXdJKRi8GstzLvM 4VL9wscZ7CWsWPUxlcgtB0Q0M4BSXNXYm8IHcudr+CPbFIdqWQzobCx2zVmqPEiM 4HdohQxZHLFgYRkVvDaH5XZH7gdUVontiC9J3GD1kzkBVqygX1kPts78f5EOIC7f +aNC6YIiQ5c53Nda3eAsA0G4KJ+lNG56jjqW0UsDRL1xnPro6kj5q9FxVRQ1LjVs qXiavdaU8LiIvA== X-ME-Sender: X-Sasl-enc: X88nBJ8yV/xTp1e4QSx1hPRf1+BLWw0mCtTjikSMxgSa 1493717444 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 602A92436D; Tue, 2 May 2017 05:30:44 -0400 (EDT) From: Thomas Monjalon To: "Pei, Yulong" Cc: dev@dpdk.org, "Wu, Jingjing" Date: Tue, 02 May 2017 11:30:43 +0200 Message-ID: <1665927.oW9BhQAo5K@xps> In-Reply-To: <188971FCDA171749BED5DA74ABF3E6F03B6C56DC@shsmsx102.ccr.corp.intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add bus info when display port info 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: Tue, 02 May 2017 09:30:45 -0000 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.