From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 3D0FC558B for ; Fri, 18 Nov 2016 10:44:01 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 18 Nov 2016 01:44:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,656,1473145200"; d="scan'208";a="1061062244" Received: from dpdk7.bj.intel.com ([172.16.182.76]) by orsmga001.jf.intel.com with ESMTP; 18 Nov 2016 01:43:59 -0800 From: Qiming Yang To: dev@dpdk.org Cc: remy.horton@intel.com, Qiming Yang Date: Fri, 18 Nov 2016 17:40:13 +0800 Message-Id: <1479462013-11562-1-git-send-email-qiming.yang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] 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: Fri, 18 Nov 2016 09:44:02 -0000 Function pcmd_drvinfo_callback uses struct info to get the ethtool infomation of each port. Struct info will store the infomation of previous port until this infomation be updated. This patch fixes this issue. Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application") Signed-off-by: Qiming Yang --- 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