[dpdk-stable] [dpdk-dev] [PATCH v1] app/testpmd: fix DCB set failure in FreeBSD	by clang
    Huang, ZhiminX 
    zhiminx.huang at intel.com
       
    Mon May 11 09:50:27 CEST 2020
    
    
  
Tested-by: Huang, ZhiminX <zhiminx.huang at intel.com>
Regards,
HuangZhiMin
-----Original Message-----
From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Ting Xu
Sent: Monday, May 11, 2020 6:25 PM
To: dev at dpdk.org
Cc: Lu, Wenzhuo <wenzhuo.lu at intel.com>; Xing, Beilei <beilei.xing at intel.com>; Iremonger, Bernard <bernard.iremonger at intel.com>; stable at dpdk.org
Subject: [dpdk-dev] [PATCH v1] app/testpmd: fix DCB set failure in FreeBSD by clang
When set DCB in testpmd by clang, 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 random address.
Fixes: b57b66a97ebf ("app/testpmd: support mbuf dynamic flag")
Cc: stable at dpdk.org
Signed-off-by: Ting Xu <ting.xu at intel.com>
---
 app/test-pmd/testpmd.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 99bacddbf..1276476ca 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3408,6 +3408,7 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf,
 	int32_t rc;
 	struct rte_eth_rss_conf rss_conf;
 
+	memset(&rss_conf, 0, sizeof(struct rte_eth_rss_conf));
 	/*
 	 * Builds up the correct configuration for dcb+vt based on the vlan tags array
 	 * given above, and the number of traffic classes available for use.
--
2.17.1
    
    
More information about the stable
mailing list