From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 42F9F2A5D for ; Tue, 22 Nov 2016 02:45:16 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP; 21 Nov 2016 17:45:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,678,1473145200"; d="scan'208";a="34220139" Received: from dpdk7.bj.intel.com ([172.16.182.76]) by fmsmga006.fm.intel.com with ESMTP; 21 Nov 2016 17:45:15 -0800 From: Qiming Yang To: dev@dpdk.org Cc: remy.horton@intel.com, Qiming Yang Date: Tue, 22 Nov 2016 09:41:24 +0800 Message-Id: <1479778884-26993-1-git-send-email-qiming.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479462013-11562-1-git-send-email-qiming.yang@intel.com> References: <1479462013-11562-1-git-send-email-qiming.yang@intel.com> Subject: [dpdk-dev] [PATCH v2] examples/ethtool: fix bug in drvinfo callback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2016 01:45:17 -0000 Function pcmd_drvinfo_callback uses struct info to get the ethtool information of each port. Struct info will store the information of previous port until this information be updated. This patch fixes this issue. Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application") Signed-off-by: Qiming Yang --- v2 changes: * fixed the spelling mistake in commit log --- --- examples/ethtool/ethtool-app/ethapp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c index 9b77385..192d941 100644 --- a/examples/ethtool/ethtool-app/ethapp.c +++ b/examples/ethtool/ethtool-app/ethapp.c @@ -177,6 +177,7 @@ pcmd_drvinfo_callback(__rte_unused void *ptr_params, int id_port; for (id_port = 0; id_port < rte_eth_dev_count(); id_port++) { + memset(&info, 0, sizeof(info)); if (rte_ethtool_get_drvinfo(id_port, &info)) { printf("Error getting info for port %i\n", id_port); return; -- 2.7.4