app/testpmd: fix uninitialized members when setting PFC
authorWei Hu (Xavier) <xavier.huwei@huawei.com>
Tue, 21 Jan 2020 11:44:33 +0000 (19:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 08:51:21 +0000 (09:51 +0100)
commit8a433297282662460a951882c80b5b0d5a8d88cf
tree9078397299747335468c8c29a5d6f306486a468d
parent3b687ec6e11b506bd9971b6ac536f6d89f5c6d56
app/testpmd: fix uninitialized members when setting PFC

Only a part of members in the local structure variable named pfc_conf
are initialized in the function named cmd_priority_flow_ctrl_set_parsed
when typing "set pfc_ctrl..." command, and others are random values.
However, those uninitialized members may cause failure.

This patch adds clearing zero operation before calling the API named
rte_eth_dev_priority_flow_ctrl_set API with pfc_conf as the input
parameter.

Fixes: 9b53e542e9e1 ("app/testpmd: add priority flow control")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Xuan Li <lixuan47@hisilicon.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/cmdline.c