From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7970FA0559; Mon, 16 Mar 2020 11:09:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 066BB1C036; Mon, 16 Mar 2020 11:09:34 +0100 (CET) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id BF97A1C02B for ; Mon, 16 Mar 2020 11:09:32 +0100 (CET) Received: by mail-lf1-f68.google.com with SMTP id n13so11673370lfh.5 for ; Mon, 16 Mar 2020 03:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=TN/5ftDhcnZFDZ8+Cu47nnfotXLVxbQ/01LIPhG3IrA=; b=rFtOMaiF+UmcKxOsJnbNMNxJ9m1JdtjVYLB3mEOUz/9O124zBXIjCgpfRKNuIfUeaT iyWHxwElby6H+FOAL0HZ0z+6n5np/SV5o90u0jnULE63m4sx2Zcrbi4avcFcOyeDyYzk dSLr6+6g0BaU6OuG8/MT3a8PFIGI7VIgaM16kaTO3f0Z6qUoihI6ut/7ZmebsswIwIho LcXDz6y3UD3casCkzd0YH3gHvDnhUetP+err49ZpZWDw+7na06VcohVTTjPZhIfoLNIk ZviKZr7IZbMNEC9LgKJw6qaojb1w45JRiG6YEiRrUlBcbabCsqqo3JoCHP3T6F3r9LlN 2s3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TN/5ftDhcnZFDZ8+Cu47nnfotXLVxbQ/01LIPhG3IrA=; b=GkYa1wSu7yBSJBxc7TqA6Ani3y3ES06/nehaFfVn+Q2xHzQ6E6ZhQbtCez4wFQimzR u2tuPF10jXmA6lz8JVftHQg+IiGvBiUqSHo7kC3V2Bbgz8S+JQwjkk3SWQCFnXCEN9SY GwQHZF38yDl3mAY3sGZlEbDagfQnK3L8h0V4rdYt20u3NGH8BYQhigtAcHcf2gapddCV DeJ4vsnIR7UfUEY4cUBQmmAe/Eq8s4BDL0X9Kv8O1G4NQdiIu4KhajaSdfPiNmvWirw/ Bs+VRo5rvpRDTdMq1saW2MPfoBcoSaxbg3Skk4zXJ0ROXxwHqju0/kKftrAECa+lRCJq 1L6g== X-Gm-Message-State: ANhLgQ2f3UK8/xxXgijWNYI+H8LHlX8/UYYfVh2rgy7G6Pwr3YQLXW5o WgvA13A7tSlPiK53BHL7o+JvPg== X-Google-Smtp-Source: ADFU+vuIFZtG7XVhRRdpWiwK3n1YOCYIMXH25L7SmpWAo9pBHwMjifqMEReGiNwIcb/unzE0W1qUlw== X-Received: by 2002:ac2:4145:: with SMTP id c5mr16156688lfi.19.1584353372229; Mon, 16 Mar 2020 03:09:32 -0700 (PDT) Received: from localhost.localdomain ([182.191.83.208]) by smtp.gmail.com with ESMTPSA id a22sm34564838ljp.96.2020.03.16.03.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 03:09:31 -0700 (PDT) From: Muhammad Ahmad To: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com Cc: Muhammad Ahmad , dev@dpdk.org Date: Mon, 16 Mar 2020 15:07:54 +0500 Message-Id: <20200316100754.13447-1-muhammad.ahmad@emumba.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] testpmd: added rte_eth_dev_fw_version_get in testpmd rte_eth_dev_fw_version_get() was not called in test pmd. Added rte_eth_dev_fw_version_get() in testpmd under show 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Muhammad Ahmad Bugzilla ID: 225 Cc: dev@dpdk.org Reported-by: Thomas Monjalon Signed-off-by: Muhammad Ahmad --- app/test-pmd/config.c | 6 ++++++ app/test-pmd/testpmd.h | 3 ++- app/test-pmd/util.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 8cf84ccd3..0abec7d47 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -52,6 +52,8 @@ #include "testpmd.h" +#define ETHTOOL_FWVERS_LEN 32 + static char *flowtype_to_str(uint16_t flow_type); static const struct { @@ -523,6 +525,7 @@ port_infos_display(portid_t port_id) uint16_t mtu; char name[RTE_ETH_NAME_MAX_LEN]; int ret; + char fw_version[ETHTOOL_FWVERS_LEN]; if (port_id_is_invalid(port_id, ENABLED_WARN)) { print_valid_ports(); @@ -544,6 +547,9 @@ port_infos_display(portid_t port_id) rte_eth_dev_get_name_by_port(port_id, name); printf("\nDevice name: %s", name); printf("\nDriver name: %s", dev_info.driver_name); + if (eth_dev_fw_version_get_err(port_id, fw_version, + ETHTOOL_FWVERS_LEN) == 0) + printf("\nfirmware-version: %s", fw_version); if (dev_info.device->devargs && dev_info.device->devargs->args) printf("\nDevargs: %s", dev_info.device->devargs->args); printf("\nConnect to socket: %u", port->socket_id); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 7a7c73f79..6b7842d3d 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -850,7 +850,8 @@ void eth_set_allmulticast_mode(uint16_t port, int enable); int eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link); int eth_macaddr_get_print_err(uint16_t port_id, struct rte_ether_addr *mac_addr); - +int eth_dev_fw_version_get_err(uint16_t port_id, + char *fw_version, size_t fw_size); /* Functions to display the set of MAC addresses added to a port*/ void show_macs(portid_t port_id); void show_mcast_macs(portid_t port_id); diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c index 8488fa1a8..2ac76f18e 100644 --- a/app/test-pmd/util.c +++ b/app/test-pmd/util.c @@ -375,3 +375,17 @@ eth_macaddr_get_print_err(uint16_t port_id, struct rte_ether_addr *mac_addr) return ret; } + +int +eth_dev_fw_version_get_err(uint16_t port_id, char *fw_version, size_t fw_size) +{ + int ret; + + ret = rte_eth_dev_fw_version_get(port_id, fw_version, fw_size); + if (ret < 0) + printf("firmware version get error: (%s)\n", strerror(-ret)); + else if (ret > 0) + printf("Insufficient fw version buffer size, " + "the minimum size should be %d\n", ret); + return ret; +} -- 2.17.1