DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Shahaf Shuler <shahafs@mellanox.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
	dev@dpdk.org, stable@dpdk.org,
	Neil Horman <nhorman@tuxdriver.com>
Subject: [dpdk-dev] [PATCH v2 5/5] net/mlx4: restore inner VXLAN RSS support
Date: Thu, 23 Nov 2017 18:38:04 +0100	[thread overview]
Message-ID: <20171123172640.28827-6-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <20171123172640.28827-1-adrien.mazarguil@6wind.com>

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 <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
---
 drivers/net/mlx4/mlx4.c      | 5 +++--
 drivers/net/mlx4/mlx4.h      | 5 +++++
 drivers/net/mlx4/mlx4_flow.c | 5 ++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 025b88766..8c20eea41 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 e5ab934c1..99dc3357a 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -53,6 +53,11 @@
 #include <rte_mempool.h>
 #include <rte_spinlock.h>
 
+#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 a41d99dd8..69025da42 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;
 	}
-- 
2.11.0

  parent reply	other threads:[~2017-11-23 17:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 14:27 [dpdk-dev] [PATCH v1 0/5] net/mlx4: restore inner VXLAN & UDP " Adrien Mazarguil
2017-11-21 14:27 ` [dpdk-dev] [PATCH v1 1/5] net/mlx4: fix unnecessary include Adrien Mazarguil
2017-11-21 14:27 ` [dpdk-dev] [PATCH v1 2/5] net/mlx4: fix documentation in private structure Adrien Mazarguil
2017-11-21 14:27 ` [dpdk-dev] [PATCH v1 3/5] net/mlx4: use function to get default RSS fields Adrien Mazarguil
2017-11-21 14:27 ` [dpdk-dev] [PATCH v1 4/5] net/mlx4: restore UDP RSS by probing capabilities Adrien Mazarguil
2017-11-21 14:27 ` [dpdk-dev] [PATCH v1 5/5] net/mlx4: restore inner VXLAN RSS support Adrien Mazarguil
2017-11-21 14:41 ` [dpdk-dev] [PATCH v1 0/5] net/mlx4: restore inner VXLAN & UDP " Neil Horman
2017-11-23 17:37 ` [dpdk-dev] [PATCH v2 " Adrien Mazarguil
2017-11-23 17:37   ` [dpdk-dev] [PATCH v2 1/5] net/mlx4: fix unnecessary include Adrien Mazarguil
2017-11-23 17:37   ` [dpdk-dev] [PATCH v2 2/5] net/mlx4: fix documentation in private structure Adrien Mazarguil
2017-11-23 17:38   ` [dpdk-dev] [PATCH v2 3/5] net/mlx4: use function to get default RSS fields Adrien Mazarguil
2017-11-23 17:38   ` [dpdk-dev] [PATCH v2 4/5] net/mlx4: restore UDP RSS by probing capabilities Adrien Mazarguil
2017-11-23 17:38   ` Adrien Mazarguil [this message]
2017-12-04 12:07   ` [dpdk-dev] [PATCH v2 0/5] net/mlx4: restore inner VXLAN & UDP RSS support Shahaf Shuler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171123172640.28827-6-adrien.mazarguil@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nhorman@tuxdriver.com \
    --cc=shahafs@mellanox.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).