From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 21AA9926B for ; Fri, 30 Oct 2015 19:56:14 +0100 (CET) Received: by wmff134 with SMTP id f134so18517260wmf.1 for ; Fri, 30 Oct 2015 11:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R2K6wlgos8dtVZXLgpF4ENIWjztV83l0yViRszL0aNE=; b=qIj/Ypq+CykP+WEhJrLxhHCvlnW+EUa40sJxJOF3ARu2eW0d2LMwHw7hLC5LNqC6WN dQTpHyEsMsMS+g6ejwhx0YhoN93pKWVhVJTSSjXQnjaddQrRxF1/wjH9TpIDVX8Rp9rC baxCSIGO0Vqm5ljPz7xx04T0zUYFGeI9d9W26j9/z+3tNmFfucWI+OPNFiQWQMKHTZ/z /7vOLsPUSgQLdIeO7gnGLKdnBC6Hn4H7hIxQm2aOE8p8KjHpIiaUf95HNh9rQxFpzZsF IU4K8aGN27M82VADERDYDB01zt9r+BUKwdo2LOyWpbo/ERvIs32Gys+/LY8b4eZw295V 8bEg== 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=R2K6wlgos8dtVZXLgpF4ENIWjztV83l0yViRszL0aNE=; b=mJnbjkx/JotmOJnkGlcAERSCforskFRiGfE6LUzTS+5/ijyGD+rnEYNRzax0XytKTC 4TSMFhgYmtDQCAEAAHIh4W3I1/8/NRfaIkpCDwSQzdRahKanFJp2cZXu6cjvCeXf3a0p 1vy0JtNXqRpMgwTp8KXNSmHDn7jT0sCAFwwJz+dBEYZoFbCBNVyAVj6AJsbPbit3iYm/ UOArGpAghBvS4r8R+glMoZMFvZ/BEZtAzH+cB/p8gdE+0kCShLA+L9nZfGl0Fe5GzMxx ARihW1L30ZRP/o/hGcQRCvn6zKC1qRBDBUwg4T5sqDRw4Jyl3h3A4AKqtVeuiS01TTAX sG7Q== X-Gm-Message-State: ALoCoQmb7ans7WNVjNwm1LBetsxZ4Fro7Yk6F6ATwI6uX/Ei5aw3z/8uLaU+gb5Pzz6hM5JsG3o9 X-Received: by 10.28.55.7 with SMTP id e7mr4876121wma.18.1446231374006; Fri, 30 Oct 2015 11:56:14 -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 l186sm4197400wmg.19.2015.10.30.11.56.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 30 Oct 2015 11:56:13 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 30 Oct 2015 19:55:14 +0100 Message-Id: <1446231319-8185-12-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1446231319-8185-1-git-send-email-adrien.mazarguil@6wind.com> References: <1444067692-29645-1-git-send-email-adrien.mazarguil@6wind.com> <1446231319-8185-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 11/16] 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: Fri, 30 Oct 2015 18:56:14 -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 8474706..d6f4e64 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