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
Subject: [dpdk-dev] [PATCH v2 2/3] net/mlx4: fix default RSS hash fields
Date: Thu, 26 Apr 2018 18:26:15 +0200 [thread overview]
Message-ID: <20180426162142.6617-2-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <20180426162142.6617-1-adrien.mazarguil@6wind.com>
Using special types value -1 with mlx4_conv_rss_types() is supposed to
return a supported set of Verbs RSS hash fields, that is, priv->hw_rss_sup
unmodified.
Due to the way this function is written and because it is also used to
initially populate priv->hw_rss_sup however, this special value works
properly only once and fails with ENOTSUP errors afterward.
This problem can be seen when re-creating default flows (e.g. by entering
and leaving isolated mode).
Fixes: 024e87bef40b ("net/mlx4: restore UDP RSS by probing capabilities")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx4/mlx4.c | 15 +++++++--------
drivers/net/mlx4/mlx4_flow.c | 13 ++++---------
2 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 3dd72dbf5..4e472fa1d 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -569,14 +569,13 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
if (!priv->hw_rss_sup) {
WARN("no RSS capabilities reported; disabling support"
" 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_types(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_INNER);
+ priv->hw_rss_sup =
+ IBV_RX_HASH_SRC_IPV4 |
+ IBV_RX_HASH_DST_IPV4 |
+ IBV_RX_HASH_SRC_IPV6 |
+ IBV_RX_HASH_DST_IPV6 |
+ IBV_RX_HASH_SRC_PORT_TCP |
+ IBV_RX_HASH_DST_PORT_TCP;
}
DEBUG("supported RSS hash fields mask: %016" PRIx64,
priv->hw_rss_sup);
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index e3d7aa8ef..bebad074e 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -125,20 +125,15 @@ mlx4_conv_rss_types(struct priv *priv, uint64_t types)
uint64_t conv = 0;
unsigned int i;
+ if (types == (uint64_t)-1)
+ return priv->hw_rss_sup;
for (i = 0; i != RTE_DIM(in); ++i)
if (types & in[i]) {
seen |= types & in[i];
conv |= out[i];
}
- if ((conv & priv->hw_rss_sup) == conv) {
- if (types == (uint64_t)-1) {
- /* Include inner RSS by default if supported. */
- conv |= priv->hw_rss_sup & IBV_RX_HASH_INNER;
- return conv;
- }
- if (!(types & ~seen))
- return conv;
- }
+ if ((conv & priv->hw_rss_sup) == conv && !(types & ~seen))
+ return conv;
rte_errno = ENOTSUP;
return (uint64_t)-1;
}
--
2.11.0
next prev parent reply other threads:[~2018-04-26 16:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 15:40 [dpdk-dev] [PATCH v1] net/mlx4: fix Rx resource leak in case of error Adrien Mazarguil
2018-04-26 16:26 ` [dpdk-dev] [PATCH v2 1/3] " Adrien Mazarguil
2018-04-26 16:26 ` Adrien Mazarguil [this message]
2018-04-26 16:26 ` [dpdk-dev] [PATCH v2 3/3] net/mlx4: fix inner RSS support for broken kernels Adrien Mazarguil
2018-04-29 6:02 ` [dpdk-dev] [PATCH v2 1/3] net/mlx4: fix Rx resource leak in case of error 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=20180426162142.6617-2-adrien.mazarguil@6wind.com \
--to=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.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).