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")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
#ifndef RTE_PMD_MLX5_DEFS_H_
#define RTE_PMD_MLX5_DEFS_H_
+#include <rte_ethdev.h>
+
#include "mlx5_autoconf.h"
/* Reported driver name. */
/* 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_ */
#include <rte_malloc.h>
#include "mlx5.h"
+#include "mlx5_defs.h"
#include "mlx5_prm.h"
/* Define minimal priority for control plane flows. */
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;
#include <rte_ethdev.h>
#include "mlx5.h"
+#include "mlx5_defs.h"
#include "mlx5_rxtx.h"
/**
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);