summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rss.c
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2018-03-26 13:12:18 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2018-03-30 14:08:44 +0200
commita1572312f713f0b218063c6213499e36a8b47c86 (patch)
tree351a37e07fd10ae93c6ac654ff4ca124c2161609 /drivers/net/mlx5/mlx5_rss.c
parent66669155da323e6d8516c3b276888ee0f3cbd799 (diff)
downloaddpdk-next-eventdev-a1572312f713f0b218063c6213499e36a8b47c86.zip
dpdk-next-eventdev-a1572312f713f0b218063c6213499e36a8b47c86.tar.gz
dpdk-next-eventdev-a1572312f713f0b218063c6213499e36a8b47c86.tar.xz
net/mlx5: enforce RSS key length limitation
RSS hash key must be 40 Bytes long. Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rss.c')
-rw-r--r--drivers/net/mlx5/mlx5_rss.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index c490854..501e492 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -50,6 +50,13 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
return -rte_errno;
}
if (rss_conf->rss_key && rss_conf->rss_key_len) {
+ if (rss_conf->rss_key_len != rss_hash_default_key_len) {
+ DRV_LOG(ERR,
+ "port %u RSS key len must be %zu Bytes long",
+ dev->data->port_id, rss_hash_default_key_len);
+ rte_errno = EINVAL;
+ return -rte_errno;
+ }
priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
rss_conf->rss_key_len, 0);
if (!priv->rss_conf.rss_key) {