summaryrefslogtreecommitdiff
path: root/examples/ethtool
diff options
context:
space:
mode:
authorQiming Yang <qiming.yang@intel.com>2016-11-22 09:41:24 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-12-20 18:22:03 +0100
commitbcb5b1af485bc2c3c327a5550cb3ca0f3d5c768b (patch)
treef528e1c4145272e36e742499de1971f2364c2093 /examples/ethtool
parent6c66be9a769fdfeee3ca1d4c0d444e23402ce073 (diff)
downloaddpdk-bcb5b1af485bc2c3c327a5550cb3ca0f3d5c768b.zip
dpdk-bcb5b1af485bc2c3c327a5550cb3ca0f3d5c768b.tar.gz
dpdk-bcb5b1af485bc2c3c327a5550cb3ca0f3d5c768b.tar.xz
examples/ethtool: fix driver information
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 <qiming.yang@intel.com> Acked-by: Remy Horton <remy.horton@intel.com>
Diffstat (limited to 'examples/ethtool')
-rw-r--r--examples/ethtool/ethtool-app/ethapp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c
index 38e466c..6aeaa06 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;