From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id D0E821B1B8 for ; Wed, 24 Jan 2018 16:38:21 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D61DA223B5; Wed, 24 Jan 2018 10:38:20 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:38:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=+sfZt8fHU+k8GAXgx pE2krB6wYnFM+Hx1z+URuRt98g=; b=s/A2q+l7ztL1X5UY2F5A4m12csS5gXJmE N8ouRC7yhgooMb/XKtckoYvLJmQfBHXpL9Sh7nIyBJLR2c+yb4o6+IR2/PIE/6Nv TJ9teJfjZtsynMXKK0aB+vr39y5UuJhchf6i2nlPEdvqx59QUPW0MvV/ZiicNpmW M9TX1ph4wFJ5FdKjVh5bOxCYBJD1918xmo+mxYW0WpkD3OMsUJCwPoFyanAH/Csv uELbupEjUYyi613IyiYXFDHMnSwSekDljyUEAuB87RBqCfOA10+AHG8EWVEL6hSp EgIU+6RoBEAWaqL+Qi9JRhd82UCVY6JW1ws73X/2hmO+YY0aMsxzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=+sfZt8fHU+k8GAXgxpE2krB6wYnFM+Hx1z+URuRt98g=; b=Qp4M3fG7 2xuQT41flcZr1h+iI3kBGYiicg8XIo5prqzfn2mmoKMfW1q7OCuDZRFOQRRyx2XF OGhcLr4SldpbmjYXCSDKcNTppQxK2xyeFL1x12CNWtPL3yfaC76grD8CMjnLUVUR /AiiAtj1xOQ0nloV8OQhE1TBhG4Nf9nKtLTE6wsfVivStVTqnqZss3g/EHJcnwG7 pD7aKdKhz9CKuawfdk0eB76OWnvZB1tm8vByDpL5odOPBUt6TEOpXsSLi/VYw9gJ ucp9Hj9Gl4fxwKBtIA3ShXaAx0CHrkP3GHxmgbDydNAklIafeOUVht9z2/dnI8fp XyCXKjVvNkmtmw== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id AE8BC7E538; Wed, 24 Jan 2018 10:38:18 -0500 (EST) From: Yuanhan Liu To: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= Cc: Yongseok Koh , dpdk stable Date: Wed, 24 Jan 2018 23:32:04 +0800 Message-Id: <1516808026-25523-56-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx5: fix un-supported RSS hash fields use' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:38:22 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From a003543e486ad1aa228823dbefec5a0214dc0161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= Date: Wed, 3 Jan 2018 10:14:19 +0100 Subject: [PATCH] net/mlx5: fix un-supported RSS hash fields use [ upstream commit b365799b3cd440437367b4539f1792eb65c86cc7 ] MLX5 NIC does not support all hash fields, this patch limit by refusing impossible RSS combination to avoid errors. Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get") Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5_defs.h | 5 +++++ drivers/net/mlx5/mlx5_flow.c | 11 +++++++++-- drivers/net/mlx5/mlx5_rss.c | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h index 3a7706c..64bb071 100644 --- a/drivers/net/mlx5/mlx5_defs.h +++ b/drivers/net/mlx5/mlx5_defs.h @@ -34,6 +34,8 @@ #ifndef RTE_PMD_MLX5_DEFS_H_ #define RTE_PMD_MLX5_DEFS_H_ +#include + #include "mlx5_autoconf.h" /* Reported driver name. */ @@ -105,4 +107,7 @@ /* Number of packets vectorized Rx can simultaneously process in a loop. */ #define MLX5_VPMD_DESCS_PER_LOOP 4 +/* Supported RSS */ +#define MLX5_RSS_HF_MASK (~(ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP)) + #endif /* RTE_PMD_MLX5_DEFS_H_ */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 75ea299..c16b571 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -50,6 +50,7 @@ #include #include "mlx5.h" +#include "mlx5_defs.h" #include "mlx5_prm.h" /* Define minimal priority for control plane flows. */ @@ -579,9 +580,15 @@ 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 = - rss_conf ? rss_conf : &priv->rss_conf; + const struct rte_eth_rss_conf *rss; + if (rss_conf) { + if (rss_conf->rss_hf & MLX5_RSS_HF_MASK) + return EINVAL; + rss = rss_conf; + } else { + rss = &priv->rss_conf; + } if (rss->rss_key_len > 40) return EINVAL; parser->rss_conf.rss_key_len = rss->rss_key_len; diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c index f3de46d..7c0cf4d 100644 --- a/drivers/net/mlx5/mlx5_rss.c +++ b/drivers/net/mlx5/mlx5_rss.c @@ -51,6 +51,7 @@ #include #include "mlx5.h" +#include "mlx5_defs.h" #include "mlx5_rxtx.h" /** @@ -72,6 +73,10 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev, int ret = 0; priv_lock(priv); + if (rss_conf->rss_hf & MLX5_RSS_HF_MASK) { + ret = -EINVAL; + goto out; + } if (rss_conf->rss_key && rss_conf->rss_key_len) { priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key, rss_conf->rss_key_len, 0); -- 2.7.4