summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rxq.c
diff options
context:
space:
mode:
authorNelio Laranjeiro <nelio.laranjeiro@6wind.com>2018-07-12 11:30:59 +0200
committerShahaf Shuler <shahafs@mellanox.com>2018-07-12 12:10:03 +0200
commitc388a2f6d71b77e318036171adf44824f3211ec4 (patch)
tree3dc41bcf68353b169c92b71f28f4cc17993951c7 /drivers/net/mlx5/mlx5_rxq.c
parentcd24d526395e97f57ec4c1db89efa970ffabc1d1 (diff)
downloaddpdk-c388a2f6d71b77e318036171adf44824f3211ec4.zip
dpdk-c388a2f6d71b77e318036171adf44824f3211ec4.tar.gz
dpdk-c388a2f6d71b77e318036171adf44824f3211ec4.tar.xz
net/mlx5: use a macro for the RSS key size
ConnectX 4-5 support only 40 bytes of RSS key, using a compiled size hash key is not necessary. Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rxq.c')
-rw-r--r--drivers/net/mlx5/mlx5_rxq.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index d960daa..d50b82c 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -52,7 +52,9 @@ uint8_t rss_hash_default_key[] = {
};
/* Length of the default RSS hash key. */
-const size_t rss_hash_default_key_len = sizeof(rss_hash_default_key);
+static_assert(MLX5_RSS_HASH_KEY_LEN ==
+ (unsigned int)sizeof(rss_hash_default_key),
+ "wrong RSS default key size.");
/**
* Check whether Multi-Packet RQ can be enabled for the device.
@@ -1771,7 +1773,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev,
return NULL;
}
if (!rss_key_len) {
- rss_key_len = rss_hash_default_key_len;
+ rss_key_len = MLX5_RSS_HASH_KEY_LEN;
rss_key = rss_hash_default_key;
}
#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
@@ -1791,7 +1793,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev,
.rx_hash_conf = (struct ibv_rx_hash_conf){
.rx_hash_function = IBV_RX_HASH_FUNC_TOEPLITZ,
.rx_hash_key_len = rss_key_len ? rss_key_len :
- rss_hash_default_key_len,
+ MLX5_RSS_HASH_KEY_LEN,
.rx_hash_key = rss_key ?
(void *)(uintptr_t)rss_key :
rss_hash_default_key,
@@ -1815,7 +1817,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev,
.rx_hash_conf = (struct ibv_rx_hash_conf){
.rx_hash_function = IBV_RX_HASH_FUNC_TOEPLITZ,
.rx_hash_key_len = rss_key_len ? rss_key_len :
- rss_hash_default_key_len,
+ MLX5_RSS_HASH_KEY_LEN,
.rx_hash_key = rss_key ?
(void *)(uintptr_t)rss_key :
rss_hash_default_key,
@@ -2138,7 +2140,7 @@ mlx5_hrxq_drop_new(struct rte_eth_dev *dev)
.rx_hash_conf = (struct ibv_rx_hash_conf){
.rx_hash_function =
IBV_RX_HASH_FUNC_TOEPLITZ,
- .rx_hash_key_len = rss_hash_default_key_len,
+ .rx_hash_key_len = MLX5_RSS_HASH_KEY_LEN,
.rx_hash_key = rss_hash_default_key,
.rx_hash_fields_mask = 0,
},