]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: enforce RSS key length limitation
authorShahaf Shuler <shahafs@mellanox.com>
Mon, 26 Mar 2018 10:12:18 +0000 (13:12 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:44 +0000 (14:08 +0200)
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>
drivers/net/mlx5/mlx5_ethdev.c
drivers/net/mlx5/mlx5_rss.c

index f5511ce7008fda019077e6cdb05aaf4446f73436..365101af9874a6effe6664c81b2a545edecd2590 100644 (file)
@@ -329,7 +329,8 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
        if (use_app_rss_key &&
            (dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len !=
             rss_hash_default_key_len)) {
-               /* MLX5 RSS only support 40bytes key. */
+               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;
        }
index c490854e10f09e6cebf856b2b748e872b2b551d4..501e492b3168b30adc80052a854aaa20d189d943 100644 (file)
@@ -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) {