From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7EF1A0A0E; Wed, 7 Apr 2021 17:30:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CF48141010; Wed, 7 Apr 2021 17:30:26 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 9E98E406A3 for ; Wed, 7 Apr 2021 17:30:24 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@nvidia.com) with SMTP; 7 Apr 2021 18:30:20 +0300 Received: from nvidia.com (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 137FUJQb007342; Wed, 7 Apr 2021 18:30:19 +0300 From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: rasland@nvidia.com, matan@nvidia.com, orika@nvidia.com, stable@dpdk.org Date: Wed, 7 Apr 2021 15:30:15 +0000 Message-Id: <20210407153015.32035-1-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/mlx4: fix RSS action hash key null pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" If RSS action contains non zero hash key length and NULL key buffer pointer the default hash key should be used. The check for the NULL pointer this was missing in the mlx4 PMD causing crash, for example, in testpmd with command: flow validate 0 ingress group 0 pattern eth / ipv4 / end actions rss queues 0 end key_len 40 / end Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx4/mlx4_flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 43a65abcc0..71ea91b3fb 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -791,7 +791,8 @@ mlx4_flow_prepare(struct mlx4_priv *priv, rss = action->conf; /* Default RSS configuration if none is provided. */ if (rss->key_len) { - rss_key = rss->key; + rss_key = rss->key ? + rss->key : mlx4_rss_hash_key_default; rss_key_len = rss->key_len; } else { rss_key = mlx4_rss_hash_key_default; -- 2.28.0