From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id E7B391B686 for ; Tue, 6 Feb 2018 10:21:54 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id 141so2364430wme.3 for ; Tue, 06 Feb 2018 01:21:54 -0800 (PST) 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; bh=VzEjrc9HzVH0nfyZoy1N2UXuJ+qDsMTfJWE2Dl1uOzI=; b=jinXCj3TQAi8IjPfjuH2LNucakCOCC2AvAox1Dz1iX5VVqsmJ1HmHm/EfrL4wCL47m wsUsDM7ovXTkdKtYMLUNaFKosd8/UZ2b9zt0J8g/rbZoM2sl04/SoMv+jQJTAXtyotc8 t+nX7yKOvVXmxvC9hWRQTFpRPA5kI5m43x1x6WLYcMCCtZpoKfxteXTph9vvLRkiRw18 2tsuHDNwOp0sJt+AVgV8gysU+PtlkYVYaQir1TdGAc2XaTO65KSTwVbjba8Wu+aU4vD7 niX6a/75+sky0YEw1TxOpLSoRawkcR6PdAsJpmjJizsEZbYg63i+cqKc55nHCsJSpekC smSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VzEjrc9HzVH0nfyZoy1N2UXuJ+qDsMTfJWE2Dl1uOzI=; b=svt6/iw3rGo/QX7MoIDeks0owWA1OA16n32YiJbAJTBM+xfzFMPokLDsOSiAWj9x0o Ttd355E15xpoz4xvvnY0mNWD+phoNQaiTmBlnak1AhYIOK3Va+RzRJs2clS3wLIPwMzR 0NVxp7UF0E3HAKebpkaHo4LQoIei3xiAAb0OXW1ayQag1LWadZ9rFIRZYeSGZkzfKj+I t1oujD3eiMyhhqbjMHVqgZlj4nvCd+8xIO0MSyi4eFtJQIOd4d1chypQnTzUUZid6Imx ku4ErRwYYFrYmn3efjCDJMUgjfFPbtxr7QcmKPhstveU25I+2ESSqf59/ZQeeNjupOTT qPLw== X-Gm-Message-State: APf1xPAUYP3Svhwnz80WPB7wg5j+tvPWSrdHAx/C7sJE+uUs/V/HdGzP dUwOLnE+4hhxovO+5CjjLiZ9dETsOg== X-Google-Smtp-Source: AH8x227QhUv/eKVJFaHgGKTdl8UtqkbhTgdA+0dRIowD8aAaOTUb6qxI/3KBP8qN7jby8P/m4JMz8A== X-Received: by 10.28.145.21 with SMTP id t21mr1400215wmd.136.1517908914429; Tue, 06 Feb 2018 01:21:54 -0800 (PST) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f22sm7738509wmi.24.2018.02.06.01.21.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 01:21:54 -0800 (PST) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Adrien Mazarguil , Shahaf Shuler , Yongseok Koh , stable@dpdk.org Date: Tue, 6 Feb 2018 10:22:15 +0100 Message-Id: <1864797385ebf75b72ddc3ec2107df4dad70b860.1517908908.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow RSS configuration 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: , X-List-Received-Date: Tue, 06 Feb 2018 09:21:55 -0000 An RSS configuration without a key is valid according to the rte_eth_rss_conf API definition. Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow") Cc: stable@dpdk.org Reported-by: Yuanhan Liu Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index ea90556d0..fd6f96083 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -514,7 +514,8 @@ mlx5_flow_item_validate(const struct rte_flow_item *item, } /** - * Copy the RSS configuration from the user ones. + * Copy the RSS configuration from the user ones, of the rss_conf is null, + * uses the driver one. * * @param priv * Pointer to private structure. @@ -531,21 +532,25 @@ priv_flow_convert_rss_conf(struct priv *priv, struct mlx5_flow_parse *parser, const struct rte_eth_rss_conf *rss_conf) { - const struct rte_eth_rss_conf *rss; - + /* + * This function is also called at the beginning of + * priv_flow_convert_actions() to initialise the parser with the + * device default RSS configuration. + */ + (void)priv; if (rss_conf) { if (rss_conf->rss_hf & MLX5_RSS_HF_MASK) return EINVAL; - rss = rss_conf; - } else { - rss = &priv->rss_conf; + if (rss_conf->rss_key_len != 40) + return EINVAL; + if (rss_conf->rss_key_len && rss_conf->rss_key) { + parser->rss_conf.rss_key_len = rss_conf->rss_key_len; + memcpy(parser->rss_key, rss_conf->rss_key, + rss_conf->rss_key_len); + parser->rss_conf.rss_key = parser->rss_key; + } + parser->rss_conf.rss_hf = rss_conf->rss_hf; } - if (rss->rss_key_len > 40) - return EINVAL; - parser->rss_conf.rss_key_len = rss->rss_key_len; - parser->rss_conf.rss_hf = rss->rss_hf; - memcpy(parser->rss_key, rss->rss_key, rss->rss_key_len); - parser->rss_conf.rss_key = parser->rss_key; return 0; } -- 2.11.0