From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id C80619406 for ; Mon, 5 Oct 2015 19:55:39 +0200 (CEST) Received: by wicgb1 with SMTP id gb1so130867659wic.1 for ; Mon, 05 Oct 2015 10:55:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=57TO6Jg7uqMdM9Hcj7Le0HNYIBRacq7gRQ1xsZo4Qr0=; b=ict6HeN8q9r6Uz+wvQbogx5fn6hS4GeWt5HaaXTQbfGhiF7X+SdxDAAAzD+gox9w71 WwSm5KTNn3jCCSqlkae4m4/AADrAyw28QnmsGAHydD3vqqJ1rIIEHjQCLh/EQ9IRhgY6 XVaGBcQFPlUIiMiI54NQXFgAbGPXjYBdeTQpC/v/uPPNXdQ8dD3hKPxxn1UtbUSmYkJX bxhvhw9HHy+jgfpgVyP1Mhkq18FNw8OvWVK9Qc2g0FlktUBbSvZrPYzTpAFcCKVNUesB i3nBYIH6EITU9R/Q53EwmQj6mMjqsrpgNBG9sna08KvmrfaoHmLAoYx48+ENtCfe9WhB m9+g== X-Gm-Message-State: ALoCoQkJ32y0Wxwi2CIhV/WIloR6ISrrogqPTnm+yUU39uAJro3psOj7ol5grOlgveMJATIs1lgO X-Received: by 10.180.211.243 with SMTP id nf19mr13489463wic.74.1444067739698; Mon, 05 Oct 2015 10:55:39 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id fz1sm15810074wic.8.2015.10.05.10.55.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 05 Oct 2015 10:55:39 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 5 Oct 2015 19:54:47 +0200 Message-Id: <1444067692-29645-13-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444067692-29645-1-git-send-email-adrien.mazarguil@6wind.com> References: <1444067692-29645-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 12/17] app/testpmd: fix missing initialization in the RSS hash show command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 17:55:40 -0000 The "show port X rss-hash" command sometimes displays garbage instead of the expected RSS hash key because the maximum key length is undefined. When the requested key is too large to fit in the buffer, rte_eth_dev_rss_hash_conf_get() does not update it. Signed-off-by: Adrien Mazarguil Signed-off-by: Nelio Laranjeiro --- app/test-pmd/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f3b96a3..e2dc33e 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -879,7 +879,7 @@ void port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key) { struct rte_eth_rss_conf rss_conf; - uint8_t rss_key[10 * 4]; + uint8_t rss_key[10 * 4] = ""; uint64_t rss_hf; uint8_t i; int diag; @@ -895,6 +895,7 @@ port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key) /* Get RSS hash key if asked to display it */ rss_conf.rss_key = (show_rss_key) ? rss_key : NULL; + rss_conf.rss_key_len = sizeof(rss_key); diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf); if (diag != 0) { switch (diag) { -- 2.1.0