From: Ting Xu Date: Tue, 12 May 2020 10:13:56 +0000 (+0000) Subject: app/testpmd: fix DCB set X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5139bc12b0d133fd99d0a0c07f0c5a31cff0ac39;p=dpdk.git app/testpmd: fix DCB set When set DCB in testpmd, there is a segmentation fault. It is because the local variable rss_conf in get_eth_dcb_conf() is not cleared, so that the pointer member variable rss_key has a random address, which leads to an error in the following processing. This patch initialized the local variable rss_conf to avoid this situation. Fixes: ac7c491c3fec ("app/testpmd: fix DCB config") Cc: stable@dpdk.org Signed-off-by: Ting Xu Reviewed-by: Ferruh Yigit --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index baccc3a495..4989d22ca8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3460,6 +3460,8 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, struct rte_eth_dcb_tx_conf *tx_conf = ð_conf->tx_adv_conf.dcb_tx_conf; + memset(&rss_conf, 0, sizeof(struct rte_eth_rss_conf)); + rc = rte_eth_dev_rss_hash_conf_get(pid, &rss_conf); if (rc != 0) return rc;