From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DATE_IN_FUTURE_06_12, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12F07C47255 for ; Tue, 12 May 2020 02:14:59 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id A0A67206B9 for ; Tue, 12 May 2020 02:14:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0A67206B9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CE701C0AF; Tue, 12 May 2020 04:14:57 +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-dev] [PATCH v2] app/testpmd: fix DCB set failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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