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 3CCE9A00C2; Wed, 17 Mar 2021 08:25:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36E11242B2A; Wed, 17 Mar 2021 08:25:43 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 0C458242B2A for ; Wed, 17 Mar 2021 08:25:41 +0100 (CET) IronPort-SDR: TsbVHu4GO3k1Kpm7OY+gfvMKZEsCoUAY5NrX6ujQ4yPsmrhAqrdctyZeBh7cl9h/+QmpDrIRWs lN+yeO+dO8DQ== X-IronPort-AV: E=McAfee;i="6000,8403,9925"; a="209369059" X-IronPort-AV: E=Sophos;i="5.81,255,1610438400"; d="scan'208";a="209369059" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2021 00:25:41 -0700 IronPort-SDR: UOCta8AyDaMVO+Q4sp4/B3ZS4UPALzKEZArOYchqUnvJWaukWgSUno0hfsmJqnE2tUny6vdQYU Mb67VwHn5blw== X-IronPort-AV: E=Sophos;i="5.81,255,1610438400"; d="scan'208";a="405829310" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2021 00:25:40 -0700 From: Haiyang Zhao To: dts@dpdk.org Cc: Lijuan.Tu@intel.com, Haiyang Zhao Date: Wed, 17 Mar 2021 15:16:23 +0800 Message-Id: <20210317071625.13041-4-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210317071625.13041-1-haiyangx.zhao@intel.com> References: <20210317071625.13041-1-haiyangx.zhao@intel.com> Subject: [dts] [PATCH V1 3/5] nics/net_device: add attribute pkg and get method X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" add attribute pkg to record nic current package and add the related get method. Signed-off-by: Haiyang Zhao --- nics/net_device.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nics/net_device.py b/nics/net_device.py index bdc9d37d..387ec5b2 100644 --- a/nics/net_device.py +++ b/nics/net_device.py @@ -71,6 +71,7 @@ class NetDevice(object): self.intf2_name = None self.get_interface_name() self.socket = self.get_nic_socket() + self.pkg = {} def stop(self): pass @@ -118,6 +119,17 @@ class NetDevice(object): """ return self.crb.get_pci_dev_driver(self.domain_id, self.bus_id, self.devfun_id) + def get_nic_pkg(self): + """ + Get the NIC pkg. + """ + out = self.__send_expect('dmesg | grep "DDP package" | tail -1', '# ') + pkg_info = out.split(': ')[-1].lower().split('package version') + if len(pkg_info) > 1: + self.pkg['type'] = pkg_info[0].strip() + self.pkg['version'] = pkg_info[1].strip() + return self.pkg + def get_nic_socket(self): """ Get socket id of specified pci device. @@ -428,7 +440,6 @@ class NetDevice(object): self.__send_expect("ifconfig %s down" % intf, "# ") self.__send_expect("ifconfig %s up" % intf, "# ") - @nic_has_driver def disable_ipv6(self): """ -- 2.17.1