From: Adrien Mazarguil Date: Thu, 23 Nov 2017 17:38:04 +0000 (+0100) Subject: net/mlx4: restore inner VXLAN RSS support X-Git-Tag: spdx-start~607 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=55e8991e3199;p=dpdk.git net/mlx4: restore inner VXLAN RSS support Inner VXLAN RSS was supported and performed by default prior to the entire mlx4 refactoring that occurred in DPDK 17.11, however so far the new Verbs RSS API did not provide means to enable it. This will be addressed in Linux 4.15 and in RDMA core. Thanks to RSS capabilities, the PMD can now probe for its support and enable it again by default. Signed-off-by: Adrien Mazarguil Acked-by: Neil Horman --- diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 025b88766d..8c20eea416 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -582,14 +582,15 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) priv->hw_rss_sup = device_attr_ex.rss_caps.rx_hash_fields_mask; if (!priv->hw_rss_sup) { WARN("no RSS capabilities reported; disabling support" - " for UDP RSS"); + " for UDP RSS and inner VXLAN RSS"); /* Fake support for all possible RSS hash fields. */ priv->hw_rss_sup = ~UINT64_C(0); priv->hw_rss_sup = mlx4_conv_rss_hf(priv, -1); /* Filter out known unsupported fields. */ priv->hw_rss_sup &= ~(uint64_t)(IBV_RX_HASH_SRC_PORT_UDP | - IBV_RX_HASH_DST_PORT_UDP); + IBV_RX_HASH_DST_PORT_UDP | + IBV_RX_HASH_INNER); } DEBUG("supported RSS hash fields mask: %016" PRIx64, priv->hw_rss_sup); diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index e5ab934c13..99dc3357a9 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -53,6 +53,11 @@ #include #include +#ifndef IBV_RX_HASH_INNER +/** This is not necessarily defined by supported RDMA core versions. */ +#define IBV_RX_HASH_INNER (1ull << 31) +#endif /* IBV_RX_HASH_INNER */ + /** Maximum number of simultaneous MAC addresses. This value is arbitrary. */ #define MLX4_MAX_MAC_ADDRESSES 128 diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index a41d99dd8d..69025da426 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -158,8 +158,11 @@ mlx4_conv_rss_hf(struct priv *priv, uint64_t rss_hf) conv |= out[i]; } if ((conv & priv->hw_rss_sup) == conv) { - if (rss_hf == (uint64_t)-1) + if (rss_hf == (uint64_t)-1) { + /* Include inner RSS by default if supported. */ + conv |= priv->hw_rss_sup & IBV_RX_HASH_INNER; return conv; + } if (!(rss_hf & ~seen)) return conv; }