From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E9BF28E8C for ; Sun, 13 Dec 2015 05:57:55 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 12 Dec 2015 20:57:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,420,1444719600"; d="scan'208";a="617116538" Received: from shilc102.sh.intel.com ([10.239.39.44]) by FMSMGA003.fm.intel.com with ESMTP; 12 Dec 2015 20:57:54 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shilc102.sh.intel.com with ESMTP id tBD4vq3a003193; Sun, 13 Dec 2015 12:57:52 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tBD4voe8004412; Sun, 13 Dec 2015 12:57:52 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id tBD4vnjJ004408; Sun, 13 Dec 2015 12:57:49 +0800 From: Yong Liu To: dts@dpdk.org Date: Sun, 13 Dec 2015 12:57:38 +0800 Message-Id: <1449982664-4362-3-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1449982664-4362-1-git-send-email-yong.liu@intel.com> References: <1449982664-4362-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 2/8] framework crb: add function to retrieve port information X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 04:57:56 -0000 From: Marvin Liu Add new function will retrieve port information based on pci address. Signed-off-by: Marvin Liu diff --git a/framework/crb.py b/framework/crb.py index 9377565..525d6a1 100644 --- a/framework/crb.py +++ b/framework/crb.py @@ -689,3 +689,11 @@ class Crb(object): perCorelCs = [_ for _ in perSocklCs if _['core'] == coreNum] return perCorelCs[threadid]['thread'] + + def get_port_info(self, pci): + """ + return port info by pci id + """ + for port_info in self.ports_info: + if port_info['pci'] == pci: + return port_info -- 1.9.3