netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	Maor Dickman <maord@nvidia.com>, Roi Dayan <roid@nvidia.com>,
	Oz Shlomo <ozsh@nvidia.com>,
	Yevgeny Kliteynik <kliteyn@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net 07/18] net/mlx5e: Don't match on Geneve options in case option masks are all zero
Date: Wed, 10 Mar 2021 11:03:31 -0800	[thread overview]
Message-ID: <20210310190342.238957-8-saeed@kernel.org> (raw)
In-Reply-To: <20210310190342.238957-1-saeed@kernel.org>

From: Maor Dickman <maord@nvidia.com>

The cited change added offload support for Geneve options without verifying
the validity of the options masks, this caused offload of rules with match
on Geneve options with class,type and data masks which are zero to fail.

Fix by ignoring the match on Geneve options in case option masks are
all zero.

Fixes: 9272e3df3023 ("net/mlx5e: Geneve, Add support for encap/decap flows offload")
Signed-off-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c
index e472ed0eacfb..7ed3f9f79f11 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c
@@ -227,6 +227,10 @@ static int mlx5e_tc_tun_parse_geneve_options(struct mlx5e_priv *priv,
 	option_key = (struct geneve_opt *)&enc_opts.key->data[0];
 	option_mask = (struct geneve_opt *)&enc_opts.mask->data[0];
 
+	if (option_mask->opt_class == 0 && option_mask->type == 0 &&
+	    !memchr_inv(option_mask->opt_data, 0, option_mask->length * 4))
+		return 0;
+
 	if (option_key->length > max_tlv_option_data_len) {
 		NL_SET_ERR_MSG_MOD(extack,
 				   "Matching on GENEVE options: unsupported option len");
-- 
2.29.2


  parent reply	other threads:[~2021-03-10 19:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 19:03 [pull request][net 00/18] mlx5 fixes 2021-03-10 Saeed Mahameed
2021-03-10 19:03 ` [net 01/18] net/mlx5e: Enforce minimum value check for ICOSQ size Saeed Mahameed
2021-03-10 23:40   ` patchwork-bot+netdevbpf
2021-03-10 19:03 ` [net 02/18] net/mlx5e: RX, Mind the MPWQE gaps when calculating offsets Saeed Mahameed
2021-03-10 19:03 ` [net 03/18] net/mlx5e: Accumulate port PTP TX stats with other channels stats Saeed Mahameed
2021-03-10 19:03 ` [net 04/18] net/mlx5e: Set PTP channel pointer explicitly to NULL Saeed Mahameed
2021-03-10 19:03 ` [net 05/18] net/mlx5e: When changing XDP program without reset, take refs for XSK RQs Saeed Mahameed
2021-03-10 19:03 ` [net 06/18] net/mlx5e: Revert parameters on errors when changing PTP state without reset Saeed Mahameed
2021-03-10 19:03 ` Saeed Mahameed [this message]
2021-03-10 19:03 ` [net 08/18] net/mlx5: Fix turn-off PPS command Saeed Mahameed
2021-03-10 19:03 ` [net 09/18] net/mlx5e: Check correct ip_version in decapsulation route resolution Saeed Mahameed
2021-03-10 19:03 ` [net 10/18] net/mlx5: Disable VF tunnel TX offload if ignore_flow_level isn't supported Saeed Mahameed
2021-03-10 19:03 ` [net 11/18] net/mlx5e: Fix error flow in change profile Saeed Mahameed
2021-03-10 19:03 ` [net 12/18] net/mlx5: Set QP timestamp mode to default Saeed Mahameed
2021-03-10 19:03 ` [net 13/18] RDMA/mlx5: Fix timestamp default mode Saeed Mahameed
2021-03-10 19:25   ` Jason Gunthorpe
2021-03-11  8:58   ` Leon Romanovsky
2021-03-10 19:03 ` [net 14/18] net/mlx5e: E-switch, Fix rate calculation division Saeed Mahameed
2021-03-10 19:03 ` [net 15/18] net/mlx5: SF, Correct vhca context size Saeed Mahameed
2021-03-10 19:03 ` [net 16/18] net/mlx5: SF: Fix memory leak of work item Saeed Mahameed
2021-03-10 19:03 ` [net 17/18] net/mlx5: SF: Fix error flow of SFs allocation flow Saeed Mahameed
2021-03-10 19:03 ` [net 18/18] net/mlx5: DR, Fix potential shift wrapping of 32-bit value in STEv1 getter 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=20210310190342.238957-8-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kliteyn@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maord@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=ozsh@nvidia.com \
    --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).