From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D9BDCA0350 for ; Tue, 12 May 2020 04:14:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9174D1C0D1; Tue, 12 May 2020 04:14:59 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 17B2F1C07E; Tue, 12 May 2020 04:14:54 +0200 (CEST) IronPort-SDR: h1IiNQSyUhlOakRjwi2QSW8QXt/9gPAvm6SuiEbgdh0WvRWKc+ykzoTThvvl3wJXbS65IpEW5W wHfao7LY8xyw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 19:14:43 -0700 IronPort-SDR: bSN7buxpculPStoDlZKHnD2Qk8pYQsgwQl/kVuwy4QQv07dhyXvwEKZC59vRP4CRf4No0hig6b GiHDsoWJQDJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,381,1583222400"; d="scan'208";a="250737414" Received: from dpdk-xuting-main.sh.intel.com ([10.67.116.253]) by orsmga007.jf.intel.com with ESMTP; 11 May 2020 19:14:41 -0700 From: Ting Xu To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, beilei.xing@intel.com, bernard.iremonger@intel.com, xiaolong.ye@intel.com, stable@dpdk.org Date: Tue, 12 May 2020 10:13:56 +0000 Message-Id: <20200512101356.23729-1-ting.xu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200511102504.23936-1-ting.xu@intel.com> References: <20200511102504.23936-1-ting.xu@intel.com> Subject: [dpdk-stable] [PATCH v2] app/testpmd: fix DCB set failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- v1->v2: modify commit log, move memset to else leg --- app/test-pmd/testpmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index a2d0be56b..9ad34421c 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3448,6 +3448,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; -- 2.17.1