From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Alaa Hleihel <alaa@nvidia.com>,
Roi Dayan <roid@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>
Subject: [net 2/6] net/mlx5e: Allow to match on MPLS parameters only for MPLS over UDP
Date: Mon, 22 Mar 2021 13:25:20 -0700 [thread overview]
Message-ID: <20210322202524.68886-3-saeed@kernel.org> (raw)
In-Reply-To: <20210322202524.68886-1-saeed@kernel.org>
From: Alaa Hleihel <alaa@nvidia.com>
Currently, we support hardware offload only for MPLS over UDP.
However, rules matching on MPLS parameters are now wrongly offloaded
for regular MPLS, without actually taking the parameters into
consideration when doing the offload.
Fix it by rejecting such unsupported rules.
Fixes: 72046a91d134 ("net/mlx5e: Allow to match on mpls parameters")
Signed-off-by: Alaa Hleihel <alaa@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 0cacf46dc950..3359098c51d4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -2296,6 +2296,16 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
*match_level = MLX5_MATCH_L4;
}
+ /* Currenlty supported only for MPLS over UDP */
+ if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS) &&
+ !netif_is_bareudp(filter_dev)) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Matching on MPLS is supported only for MPLS over UDP");
+ netdev_err(priv->netdev,
+ "Matching on MPLS is supported only for MPLS over UDP\n");
+ return -EOPNOTSUPP;
+ }
+
return 0;
}
--
2.30.2
next prev parent reply other threads:[~2021-03-22 20:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 20:25 [pull request][net 0/6] mlx5 fixes 2021-03-22 Saeed Mahameed
2021-03-22 20:25 ` [net 1/6] net/mlx5: Add back multicast stats for uplink representor Saeed Mahameed
2021-03-23 0:30 ` patchwork-bot+netdevbpf
2021-03-22 20:25 ` Saeed Mahameed [this message]
2021-03-22 20:25 ` [net 3/6] net/mlx5e: Offload tuple rewrite for non-CT flows Saeed Mahameed
2021-03-22 20:25 ` [net 4/6] net/mlx5e: Fix error path for ethtool set-priv-flag Saeed Mahameed
2021-03-22 20:25 ` [net 5/6] net/mlx5e: Fix division by 0 in mlx5e_select_queue Saeed Mahameed
2021-03-22 20:25 ` [net 6/6] net/mlx5: SF, do not use ecpu bit for vhca state processing Saeed Mahameed
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=20210322202524.68886-3-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=alaa@nvidia.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=roid@nvidia.com \
--cc=saeedm@nvidia.com \
/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).